From 6b35645150bbb3484c470d5aa730c1de642c644d Mon Sep 17 00:00:00 2001 From: cmastudios Date: Thu, 7 Mar 2013 17:17:06 -0600 Subject: [PATCH] Prevent players from smuggling items into warzones with ender chests. This is mainly for servers such as the Warhub, where most players can make their own warzones. Inexperienced zone makers may place ender chests in zones which makes their zone susceptible to smuggling items. This may also apply for zones which would like to use ender chests for aesthetics. Hopefully this change shouldn't be a problem. I cannot think of any way that an ender chest would be used inside of a warzone. --- .../main/java/com/tommytony/war/event/WarPlayerListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/war/src/main/java/com/tommytony/war/event/WarPlayerListener.java b/war/src/main/java/com/tommytony/war/event/WarPlayerListener.java index aed3a54..fd2663f 100644 --- a/war/src/main/java/com/tommytony/war/event/WarPlayerListener.java +++ b/war/src/main/java/com/tommytony/war/event/WarPlayerListener.java @@ -231,6 +231,10 @@ public class WarPlayerListener implements Listener { War.war.badMsg(player, "Can't use items while still in spawn."); } } + if (zone != null && event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.ENDER_CHEST) { + event.setCancelled(true); + War.war.badMsg(player, "Can't use ender chests while playing in a warzone!"); + } } }