Commit Graph

148 Commits

Author SHA1 Message Date
9d2eb5e911 Human: Added some void typehints 2018-01-05 12:30:03 +00:00
b6c1124d50 Move XP drop amount to Human instead of Player 2018-01-05 12:09:24 +00:00
03fda936a8 Added XP level-up sounds and refactored XP gain sound handling 2018-01-05 11:58:54 +00:00
a84910f04c Implemented XP orbs 2018-01-04 19:28:19 +00:00
3ee225caec Human: Refactored XP API methods 2018-01-04 19:15:26 +00:00
6e1df36188 Consumables refactor (#1796)
* Removed broken EntityEatEvents - these don't fit the pattern since they only apply to Human entities anyway. PlayerItemConsumeEvent and PlayerInteractEvent can be used for cancellation purposes, and plugins can do custom stuff without mess.

* Restrict item consuming to Living entities only

* Added FoodSource->requiresHunger()

* Only items implementing the Consumable interface can now be consumed.

* The effects from consuming items are now generic-ized by way of the Living->consume() function. This is overridden in Human to allow applying food and hunger.

* Fixed the hardcoded mess for buckets
2017-12-23 13:03:41 +00:00
686e1c4470 Implement ender chest (#1462) 2017-11-22 14:25:21 +00:00
74b074753f Bulk addition of constant visibilities
thanks PhpStorm inspections plugin for annoying the shit out of me until
I did this.
2017-11-21 14:44:10 +00:00
665130561e Further cleanup on NBT dynamic field access
not sure how I missed so many of these... there are probably lots more besides :(
2017-11-17 11:19:36 +00:00
aa399a1109 migrate to new CompoundTag API (#1515) 2017-11-10 15:38:21 +00:00
991d321928 improved geometry debloating, also apply on skin changes 2017-10-29 12:14:16 +00:00
600d80331a Accept null for targets in Human->sendSkin()
For humans, it'll send to all viewers. For players, it'll send to all viewers, and the player itself.
2017-10-29 11:18:34 +00:00
9fb93985d6 Cleaned up Entity->spawnTo() 2017-10-19 16:13:09 +01:00
584810780a Moved projectile-related classes to their own namespace 2017-10-19 12:27:44 +01:00
3b5eb45ff5 More usages of Item->isNull() 2017-10-16 12:29:39 +01:00
68809d992b Added BaseInventory->removeAllViewers() 2017-10-16 11:15:03 +01:00
246c6daef6 how irritating 2017-10-09 11:30:11 +01:00
2601e35990 Cleaned up and added API for entity air supply, fixed oxygen being used in creative/spectator
this commit also includes respiration checks because it's cherry-picked
from api3/blocks, but respiration won't work until it's registered.
2017-10-09 11:28:40 +01:00
8fafef2f7f Added tagType parameter to ListTag constructor, remove some boilerplate code 2017-10-08 13:28:01 +01:00
e6cecabf3f New skin API, add support for custom capes & custom geometry (#1416)
* Added support for changing skins ingame, custom capes & geometry
* Use PlayerSkinPacket for setting Human skin instead of PlayerList hack
2017-09-29 14:09:00 +01:00
38fad4b963 Implement difficulty per-world (#878)
* Moved Server::getDifficultyFromString() to Level
* Added ability to set difficulty in worlds section of pocketmine.yml for generation
2017-09-26 11:16:51 +01:00
6aa9b081e9 Cleanup unused imports 2017-09-21 12:26:41 +01:00
8cae20e818 Removed hotbar slot linking (works like PC now) 2017-09-19 18:36:57 +01:00
5d75d3d5b6 Merge branch 'php/7.0' into mcpe-1.2 2017-09-01 23:10:58 +01:00
120cf56a47 Misc return typehints 2017-08-30 12:59:26 +01:00
95752ef542 Merge branch 'master' into mcpe-1.2 2017-08-23 13:20:35 +01:00
da4c9cf404 Fixed inventory cyclic references causing players to not get garbage-collected 2017-08-23 13:13:15 +01:00
a52fa93998 Remove Entity->length 2017-08-23 02:21:33 -04:00
445a67954d Merge changes from master 2017-08-22 14:13:31 +01:00
456ddd3fb3 Removed obsolete parameters from Entity->attack() and Entity->heal() 2017-08-21 13:25:11 +01:00
4f1302adf2 Merge branch 'master' into mcpe-1.2 2017-08-17 17:14:16 +01:00
e825ebd8fa Added some wrapper methods to make data flags less of a pain in the ass to work with 2017-08-17 16:52:17 +01:00
21a1e0eb6b Player API typehints 2017-08-17 11:08:54 +01:00
741394dab1 Typehinted up entity API
Did you guys think ALPHA7 changes were done?!
Sone stuff still needs some work, most notably data-properties can't be typed yet because they are just mushed into a couple of methods.
2017-08-16 19:04:30 +01:00
9be1b929a5 Added PhpDoc for packet field types and changed float x,y,z to Vector3 2017-08-13 20:02:07 +01:00
b4c2305c7f Minor cleanup of Human->initEntity() 2017-08-08 10:44:11 +01:00
dbb92096e4 More typehints, documentation fixes and static analysis cleanup 2017-07-15 12:12:06 +01:00
c3b8be3f60 and more typehints 2017-07-14 10:56:51 +01:00
2a7b736f18 Heap of bugfixes, cleanup and PHP 7 upgrades 2017-07-13 19:18:56 +01:00
d474f73665 Move base offset to Human from Player
fixes jojoe77777/Slapper#58
2017-07-03 19:58:07 +01:00
a4b8dd43e6 Removed useless confusing array indices in CompoundTag constructors (#1116) 2017-06-20 12:11:24 +01:00
cd66f58526 Restrict XpSeed to the bounds of an int32, close #1040 2017-06-09 16:05:28 +01:00
e18a3ac933 Fixed UUID-related issues 2017-06-07 13:11:03 +01:00
cf07af8b55 Fix some strict type violations reported by PhpStorm (strict types <3) 2017-06-07 12:54:12 +01:00
51091fe87b Fix player data saving 2017-06-07 12:54:12 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
8382970d56 Merge branch 'master' into mcpe-1.1 2017-05-30 16:09:46 +01:00
86f3b257a7 Remove unneeded foreach loop in Human::getDrops() (#941)
* Remove unneeded foreach loop in Human::getDrops()

* Use array_values() for backwards compatibility.
2017-05-30 13:27:47 +01:00
0a4d62b405 Added encode and decode methods for more packets 2017-05-15 15:56:59 +01:00
d682fdfdf0 Food and exhaustion should not apply in creative, close #860 2017-04-24 13:31:05 +01:00