Fixed UHC height limit

fixed UHC rejoin health bug
This commit is contained in:
Chiss 2015-01-08 13:08:15 +11:00
parent 8ce097d837
commit 9daee9733f
2 changed files with 8 additions and 1 deletions

View File

@ -24,6 +24,7 @@ public abstract class TeamGame extends Game
private NautHashMap<String, Long> _rejoinTime = new NautHashMap<String, Long>();
protected NautHashMap<String, GameTeam> RejoinTeam = new NautHashMap<String, GameTeam>();
protected NautHashMap<String, Kit> RejoinKit = new NautHashMap<String, Kit>();
protected NautHashMap<String, Double> RejoinHealth = new NautHashMap<String, Double>();
protected long RejoinTime = 120000;
@ -79,6 +80,8 @@ public abstract class TeamGame extends Game
if (GetKit(player) != null)
RejoinKit.put(player.getName(), GetKit(player));
RejoinHealth.put(player.getName(), player.getHealth());
GetLocationStore().put(player.getName(), player.getLocation());
@ -104,6 +107,9 @@ public abstract class TeamGame extends Game
Kit kit = RejoinKit.remove(event.getPlayer().getName());
if (kit != null)
_playerKit.put(event.getPlayer(), kit);
if (RejoinHealth.containsKey(event.getPlayer().getName()))
event.getPlayer().setHealth(RejoinHealth.remove(event.getPlayer().getName()));
return;
}
@ -142,6 +148,7 @@ public abstract class TeamGame extends Game
Announce(team.GetColor() + C.Bold + name + " did not reconnect in time!", false);
RejoinKit.remove(name);
RejoinHealth.remove(name);
}
}

View File

@ -461,7 +461,7 @@ public class UHC extends TeamGame
if (event.getBlock().getX() >= -16 &&
event.getBlock().getX() <= 16 &&
event.getBlock().getZ() >= -16 &&
event.getBlock().getZ() >= 16 &&
event.getBlock().getZ() <= 16 &&
event.getBlock().getY() >= _yMax)
{
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot build this high up."));