Hunger now takes longer to decrease

This commit is contained in:
libraryaddict 2015-01-21 19:00:26 +13:00
parent dd2418232c
commit eb7e68885b

View File

@ -29,6 +29,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.hanging.HangingBreakEvent;
import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
@ -892,6 +893,12 @@ public abstract class Game implements Listener
return Manager.IsTeamBalance() ? team.GetSize() < Math.max(1, UtilServer.getPlayers().length / GetTeamList().size()) : true;
}
@EventHandler
public final void onFoodLevelChangeEvent(FoodLevelChangeEvent event)
{
((Player) event.getEntity()).setSaturation(3.8F); // While not entirely accurate, this is a pretty good guess at original food level changes
}
public GameTeam GetTeamPreference(Player player)
{
for (GameTeam team : _teamPreference.keySet())