Permalink
Browse files

Fix for trapped chests.

  • Loading branch information...
1 parent 19ea5b2 commit f68a5d1d004bba44f60540c75774c9ba3112a2fe @Meaglin committed Apr 9, 2013
Showing with 4 additions and 9 deletions.
  1. +2 −2 src/com/zones/listeners/EventUtil.java
  2. +2 −7 src/com/zones/listeners/ZonesPlayerListener.java
@@ -81,7 +81,7 @@ public static final void onModify(Zones plugin, Cancellable event, Player player
ZoneBase zone = wm.getActiveZone(block);
if(wm.getConfig().LIMIT_BUILD_BY_FLAG && !plugin.getPermissions().canUse(player,wm.getWorldName(), "zones.build")) {
- if (blockType == Material.CHEST.getId())
+ if (blockType == Material.CHEST.getId() || blockType == Material.TRAPPED_CHEST.getId())
player.sendMessage(ChatColor.RED + "You cannot change chests in this world!");
else if (blockType == Material.FURNACE.getId() || blockType == Material.BURNING_FURNACE.getId())
player.sendMessage(ChatColor.RED + "You cannot change furnaces in this world!");
@@ -96,7 +96,7 @@ else if (blockType == Material.NOTE_BLOCK.getId())
if(zone == null) {
if(wm.getConfig().LIMIT_BUILD_BY_FLAG && !plugin.getPermissions().canUse(player,wm.getWorldName(), "zones.inheritbuild")) {
- if (blockType == Material.CHEST.getId())
+ if (blockType == Material.CHEST.getId() || blockType == Material.TRAPPED_CHEST.getId())
player.sendMessage(ChatColor.RED + "You cannot change chests in this world!");
else if (blockType == Material.FURNACE.getId() || blockType == Material.BURNING_FURNACE.getId())
player.sendMessage(ChatColor.RED + "You cannot change furnaces in this world!");
@@ -281,7 +281,8 @@ public void onPlayerTeleport(PlayerTeleportEvent event) {
Material.BREWING_STAND.getId(),
Material.BEACON.getId(),
Material.COMMAND.getId(),
- Material.ANVIL.getId()
+ Material.ANVIL.getId(),
+ Material.TRAPPED_CHEST.getId()
);
@EventHandler(ignoreCancelled = true)
@@ -299,12 +300,6 @@ public void onPlayerInteract(PlayerInteractEvent event) {
int blockType = (event.getClickedBlock() != null ? event.getClickedBlock().getTypeId() : 0);
int toolType = (event.getItem() != null ? event.getItem().getTypeId() : 0);
-// Temp hack to disable ender chest until proper api came availeble.
-// if(blockType == 130) {
-// event.setCancelled(true);
-// return;
-// }
-
/*
* Using a huge ass if(...) would have been possible too however this seems more elegant and prolly is a little bit faster
* (however this speed difference would be very hard to determine :P )

0 comments on commit f68a5d1

Please sign in to comment.