4 Commits

Author SHA1 Message Date
Dylan K. Taylor
dc3bf8546e Refactored effects handling, split up concerns of effect types and instances
Removed json insanity for effects

Split up effect types and effect instances

Saturation is an instant effect
2018-03-07 12:42:31 +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
4f8e4f0522
Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
Dylan K. Taylor
8811188e71 Split FoodSource up into two interfaces 2017-09-26 11:48:47 +01:00