diff --git a/pom.xml b/pom.xml index 659d25906..87d1d0fe6 100644 --- a/pom.xml +++ b/pom.xml @@ -182,5 +182,5 @@ http://maven.sk89q.com/repo/ - 3.0.3 + 3.0.3.1 diff --git a/src/com/wasteofplastic/askyblock/listeners/IslandGuard.java b/src/com/wasteofplastic/askyblock/listeners/IslandGuard.java index 34c0edc76..7490419c1 100644 --- a/src/com/wasteofplastic/askyblock/listeners/IslandGuard.java +++ b/src/com/wasteofplastic/askyblock/listeners/IslandGuard.java @@ -29,6 +29,7 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.World; +import org.bukkit.World.Environment; import org.bukkit.block.Biome; import org.bukkit.block.Block; import org.bukkit.block.BlockState; @@ -1800,33 +1801,6 @@ public void onPlayerInteract(final PlayerInteractEvent e) { } // Get island Island island = plugin.getGrid().getProtectedIslandAt(e.getPlayer().getLocation()); - /* This doesn't work because this event is not called when an ender pearl is thrown - // Ender pearl check - if(e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) { - if(e.getPlayer().getItemInHand().getType().equals(Material.ENDER_PEARL)) { - if (island == null) { - if (Settings.allowEnderPearls) { - return; - } - } else { - if (island.isSpawn()) { - if (Settings.allowEnderPearls) { - return; - } - } else { - // Regular island - if (island.getIgsFlag(Flags.allowEnderPearls)) { - return; - } - } - } - e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected); - e.setCancelled(true); - return; - } - } - */ - // Check for disallowed clicked blocks if (e.getClickedBlock() != null) { if (DEBUG) { @@ -2153,6 +2127,14 @@ public void onPlayerInteract(final PlayerInteractEvent e) { e.setCancelled(true); return; } + break; + case BED_BLOCK: + if (e.getPlayer().getWorld().getEnvironment().equals(Environment.NETHER)) { + // Prevent explosions + e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected); + e.setCancelled(true); + return; + } default: break; } diff --git a/src/com/wasteofplastic/askyblock/panels/ControlPanel.java b/src/com/wasteofplastic/askyblock/panels/ControlPanel.java index 7e58a08c6..13934f7ce 100644 --- a/src/com/wasteofplastic/askyblock/panels/ControlPanel.java +++ b/src/com/wasteofplastic/askyblock/panels/ControlPanel.java @@ -217,6 +217,10 @@ public void onInventoryClick(InventoryClickEvent event) { // Challenges if (inventory.getName().equals(plugin.myLocale(player.getUniqueId()).challengesguiTitle)) { event.setCancelled(true); + if (event.getClick().equals(ClickType.SHIFT_RIGHT)) { + player.closeInventory(); + return; + } if (event.getSlotType() == SlotType.OUTSIDE) { player.closeInventory(); return; @@ -276,6 +280,7 @@ public void onInventoryClick(InventoryClickEvent event) { } } } + return; } /* * Minishop section @@ -354,6 +359,7 @@ public void onInventoryClick(InventoryClickEvent event) { } } } + return; } // Check control panels for (String panelName : controlPanel.keySet()) {