ddevault / Craft.Net

(Unmaintained, see TrueCraft) Minecraft server, client, and etc for .NET
MIT License
228 stars 64 forks source link

Eating Steak consumes food even with full hunger bar #152

Open cathode opened 11 years ago

cathode commented 11 years ago

Tested with Steak but may work with other food items. right-clicking to eat the food item in Minecraft results in 1 qty of the food item being deducted, even if the player has a full hunger bar. The eating animation doesn't play on the client.

cathode commented 11 years ago

Craft.Net.Server/EntityManager.cs line 406 the following should be inserted:

if (player.Food >= 20) return;

Simple. Although I also notice that the first time a player eats after logging in, the eating has no effect. Or perhaps the packet indicating EatingAccepted is being sent before the values are changed, when it should be sent after instead?

aholmes commented 11 years ago

This no longer appears to happen. However, now it seems that eating food when player.Food is less than 20 has no affect. The animation plays, but the food meter does not increase.