* Fixed players being able to break fire. Fixes #72.
This commit is contained in:
parent
a8516aa665
commit
2a1f8fc123
@ -30,8 +30,5 @@ public class OnBlockBreakEvent implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
if (event.getBlock().equals(Material.FIRE)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ public class OnPlayerInteractEvent implements Listener {
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerInteractEvent(PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
Block block = event.getClickedBlock();
|
||||
if (PermissionsM.hasPerm(player, Permissions.create, false)) {
|
||||
ItemStack item = player.getItemInHand();
|
||||
if (item.getType() != Material.AIR) {
|
||||
@ -141,26 +142,33 @@ public class OnPlayerInteractEvent implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (event.getClickedBlock().getType()
|
||||
.equals(Material.ENCHANTMENT_TABLE)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.WORKBENCH)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.FURNACE)
|
||||
|| event.getClickedBlock().getType().equals(Material.CHEST)
|
||||
|| event.getClickedBlock().getType().equals(Material.ANVIL)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.ENDER_CHEST)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.JUKEBOX)) {
|
||||
for (Arena arena : W.arenaList) {
|
||||
if (arena.playersInArena.contains(player)) {
|
||||
event.setCancelled(true);
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK
|
||||
|| event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
if (event.getClickedBlock().getType() != Material.AIR) {
|
||||
if (event.getClickedBlock().getType()
|
||||
.equals(Material.ENCHANTMENT_TABLE)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.WORKBENCH)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.FURNACE)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.CHEST)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.ANVIL)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.ENDER_CHEST)
|
||||
|| event.getClickedBlock().getType()
|
||||
.equals(Material.JUKEBOX)
|
||||
|| block.getFace(block).equals(Material.FIRE)) {
|
||||
for (Arena arena : W.arenaList) {
|
||||
if (arena.playersInArena.contains(player)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getAction() == Action.LEFT_CLICK_BLOCK
|
||||
|| event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
for (Arena arena : W.arenaList) {
|
||||
@ -246,5 +254,6 @@ public class OnPlayerInteractEvent implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user