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

View File

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