Added Hunger Restoration on Limbo Respawn

Added code to EventHookContainer.revivePlayerInLimbo() so that the
player's food level is restored upon respawning in Limbo. Apparently it
was possible for players to have death loops from starving to death in
Hardcore Limbo.
This commit is contained in:
SenseiKiwi 2014-06-28 13:06:22 -04:00
parent 42568a1864
commit e3665c09dd

View file

@ -30,6 +30,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class EventHookContainer
{
private static final int MAX_FOOD_LEVEL = 20;
private final DDProperties properties;
public EventHookContainer(DDProperties properties)
@ -175,6 +177,7 @@ public class EventHookContainer
player.extinguish();
player.clearActivePotions();
player.setHealth(player.getMaxHealth());
player.getFoodStats().addStats(MAX_FOOD_LEVEL, 0);
Point4D destination = LimboProvider.getLimboSkySpawn(player, properties);
DDTeleporter.teleportEntity(player, destination, false);
}