Skip to content

Commit

Permalink
block place check now only does its thing if its a chest
Browse files Browse the repository at this point in the history
  • Loading branch information
dmccoystephenson committed Jul 9, 2020
1 parent b1ae916 commit fbd84cb
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down

0 comments on commit fbd84cb

Please sign in to comment.