Allow event to decide whether cake be eaten while full
primetoxinz opened this issue · 9 comments
as per title. As per BTW cake is supposed to be edible even when hunger is full.
Correct, being able to somehow pass ignore to if (player.canEat(false))
in BlockCake
Hm, I see two possible implementations, and I'm not sure which would be better.
- An event that allows modifying that boolean, as suggested
- Have AppleCore make
BlockCake
implementIEdible
and then add asetAlwaysEdible
method toIEdible
a laItemFood
. Then, to makeBlockCake
always edible you'd do something like((IEdible)Blocks.CAKE).setAlwaysEdible(true)
at startup.
The second would be faster as it'd avoid having to fire events, but it might be more confusing for developers because IEdible wouldn't show up as implemented by BlockCake
in their IDEs...
I also think the latter would be preferable, as long as it is well documented I don't think the IDE information is too big of a deal. Doubt many people will need this hook anyways
Released v3.1.0: http://www.ryanliptak.com/maven/
Let me know if you have any issues with it.
Ok, got it tested and working in 1.7.10. Need to port it forward now (which might take a little while ((IEdibleBlock) Blocks.CAKE).setEdibleAtMaxHunger(true)
Awesome. Take your time, not dire on my end. Thanks for the hard work though :)