From fbd84cbeee543e8889bef64db38375157269f2ea Mon Sep 17 00:00:00 2001 From: dmccoystephenson Date: Wed, 8 Jul 2020 21:48:31 -0600 Subject: [PATCH] block place check now only does its thing if its a chest --- .../EventHandlers/BlockPlaceEventHandler.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/factionsystem/EventHandlers/BlockPlaceEventHandler.java b/src/main/java/factionsystem/EventHandlers/BlockPlaceEventHandler.java index f057c0936..561bc7891 100644 --- a/src/main/java/factionsystem/EventHandlers/BlockPlaceEventHandler.java +++ b/src/main/java/factionsystem/EventHandlers/BlockPlaceEventHandler.java @@ -43,11 +43,14 @@ public void handle(BlockPlaceEvent event) { return; } - // if next to non-owned locked block - if (isNextToNonOwnedLockedBlock(event.getPlayer(), event.getBlock())) { - event.setCancelled(true); - player.sendMessage(ChatColor.RED + "You can't place chests/doors next to blocks you don't own."); - return; + // if chest + if (main.isChest(event.getBlock())) { + // if next to non-owned locked block + if (isNextToNonOwnedLockedBlock(event.getPlayer(), event.getBlock())) { + event.setCancelled(true); + player.sendMessage(ChatColor.RED + "You can't place chests/doors next to blocks you don't own."); + return; + } } } }