Removed kick prevention when flying in warzones.

Closes gh-526. Restoring a user's inventory when geting kicked. This
should technically solve an inventory reset problem. I've always found
the kick-prevention pretty hacky, anyway. Hopefully, the accidental
flying in warzones caused by War's teleporting people around has been
fixed upstream by the Bukkit folks since back in the day when this was
an issue.
This commit is contained in:
taoneill 2012-07-22 13:28:46 -04:00
parent e6d2bd0950
commit cd47e28e9f

View File

@ -188,18 +188,11 @@ public class WarPlayerListener implements Listener {
public void onPlayerKick(final PlayerKickEvent event) {
if (War.war.isLoaded()) {
Player player = event.getPlayer();
String reason = event.getReason();
if (reason.contains("moved") || reason.contains("too quickly") || reason.contains("Hacking")) {
boolean inWarzone = Warzone.getZoneByLocation(player) != null;
boolean inLobby = ZoneLobby.getLobbyByLocation(player) != null;
boolean inWarhub = false;
if (War.war.getWarHub() != null && War.war.getWarHub().getVolume().contains(player.getLocation())) {
inWarhub = true;
}
if (inWarzone || inLobby || inWarhub) {
event.setCancelled(true);
War.war.log("Prevented " + player.getName() + " from getting kicked.", java.util.logging.Level.WARNING);
}
Warzone warzone = Warzone.getZoneByLocation(player);
if (warzone != null) {
// kick player from warzone as well
warzone.handlePlayerLeave(player, warzone.getTeleport(), true);
}
}
}