mirror of
https://github.com/taoneill/war.git
synced 2025-01-03 06:17:33 +01:00
Fix #201, prevent opening zone edge chests if not playing
Roundabout fix but it solves the issue with smuggling items without requiring an additional setting
This commit is contained in:
parent
b772b71803
commit
b7138d65bd
@ -288,6 +288,14 @@ public class WarPlayerListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
War.war.badMsg(player, "drop.flag.disabled");
|
||||
}
|
||||
if (zone == null && event.getAction() == Action.RIGHT_CLICK_BLOCK
|
||||
&& (event.getClickedBlock().getType() == Material.CHEST || event.getClickedBlock().getType() == Material.TRAPPED_CHEST)
|
||||
&& Warzone.getZoneByLocation(event.getClickedBlock().getLocation()) != null
|
||||
&& !War.war.isZoneMaker(event.getPlayer())) {
|
||||
// prevent opening chests inside a warzone if a player is not a zone maker
|
||||
event.setCancelled(true);
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_CHEST_LOCKED, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK
|
||||
|
Loading…
Reference in New Issue
Block a user