Simple Fix

This commit is contained in:
Brianna O'Keefe 2018-09-13 15:54:06 -04:00
parent 0dc4558a45
commit b8887c5d74
1 changed files with 3 additions and 2 deletions

View File

@ -27,14 +27,15 @@ public class InteractListeners implements Listener {
@EventHandler(ignoreCancelled = true)
public void onBlockInteract(PlayerInteractEvent e) {
if (e.getClickedBlock() == null) return;
if (instance.getAnchorManager().getAnchor(e.getClickedBlock().getLocation()) == null) return;
if (e.getAction() != Action.RIGHT_CLICK_BLOCK) {
instance.bust(e.getClickedBlock().getLocation());
e.setCancelled(true);
return;
}
if (instance.getAnchorManager().getAnchor(e.getClickedBlock().getLocation()) == null) return;
if (!instance.canBuild(e.getPlayer(), e.getClickedBlock().getLocation())) {
e.setCancelled(true);
return;