15 Commits

Author SHA1 Message Date
Dylan K. Taylor
6c8fa8ae28 More nullable and void typehints 2019-03-02 10:29:11 +00:00
Dylan K. Taylor
b252be1c7a Added ItemFactory::air() sugar
This makes it easier to create air stacks without accidents, and also reduces the amount of throwaway air objects which get created.
2019-02-16 12:19:54 +00:00
Dylan K. Taylor
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
Dylan K. Taylor
18777a9041 Remove useless EntityEventPacket
vanilla doesn't send this, and it doesn't do anything if we _do_ send it.
2017-09-26 12:50:36 +01:00
Dylan K. Taylor
876659cc73 Item factory refactor and added capability to register custom items 2017-08-21 17:49:26 +01:00
Dylan K. Taylor
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
Dylan K. Taylor
54453d0b0a Refactored entity IDs in packets for consistency and to clarify on types 2017-06-05 15:41:27 +01:00
Dylan K. Taylor
56990eb28b MCPE protocol gets its own namespace 2017-03-08 20:28:39 +00:00
Blabla
02ddcef24e Fix calls to undefined method Human->getServer() (#234)
* Fixes sendHeldItem to stop crashes when executing.

* Fix server calling for food consuming.
2017-01-07 13:01:26 +00:00
Dylan K. Taylor
598e7aac8f More PhpStorm inspections, import cleanup 2017-01-04 14:55:11 +00:00
Dylan K. Taylor
0bd7ea211d Refactored Server::broadcastPacket() to be non-static
Why the hell was this static at all? Seriously Shoghi?
2017-01-03 22:24:40 +00:00
PEMapModder
5459576833 Added hunger and experience saving 2016-02-17 19:56:19 +08:00
PEMapModder
e79976bdac Added events 2016-02-11 22:07:04 +08:00
PEMapModder
28967ca495 Fixed eating 2016-02-11 15:42:07 +08:00
PEMapModder
329a525ea1 Implemented food and hunger 2016-02-10 22:49:48 +08:00