mirror of
https://github.com/taoneill/war.git
synced 2024-11-27 04:35:35 +01:00
Closes gh-355. Prevented use of items when still in spawn, including potions (which could be abused by switching between loadouts).
This commit is contained in:
parent
a86683a98a
commit
1eed5ca366
@ -246,9 +246,10 @@ public class WarPlayerListener extends PlayerListener {
|
||||
|
||||
Warzone zone = Warzone.getZoneByPlayerName(player.getName());
|
||||
if (zone != null && zone.getLoadoutSelections().containsKey(player.getName())
|
||||
&& zone.getLoadoutSelections().get(player.getName()).isStillInSpawn() && player.getItemInHand().getType() == Material.BOW) {
|
||||
&& zone.getLoadoutSelections().get(player.getName()).isStillInSpawn()) {
|
||||
event.setUseItemInHand(Result.DENY);
|
||||
War.war.badMsg(player, "Can't shoot from inside the spawn.");
|
||||
War.war.badMsg(player, "Can't use items while still in spawn.");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user