mirror of
https://github.com/taoneill/war.git
synced 2024-11-13 05:54:31 +01:00
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:
parent
e6d2bd0950
commit
cd47e28e9f
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user