8 Commits

Author SHA1 Message Date
Dylan K. Taylor
082e3404c3 Potion: Implement potion effects 2017-12-23 15:07:39 +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
375243860e Potion: Restrict item stack size to 1 2017-12-21 15:02:56 +00:00
Dylan K. Taylor
9e142655ea Removed redundant count parameter from item constructors, added some documentation and tightened safety checks
the count parameter is useless since Item ctor should now only be used for constructing item _types_, not actual items. All item creations for inventories etc, should go through the ItemFactory.
2017-08-25 19:06:23 +01:00
Dylan K. Taylor
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
PEMapModder
e79976bdac Added events 2016-02-11 22:07:04 +08:00
PEMapModder
329a525ea1 Implemented food and hunger 2016-02-10 22:49:48 +08:00
Intyre
8a0bd85656
Item and Block, some wont work yet 2016-01-28 04:37:09 +01:00