This commit is contained in:
rockyhawk64 2022-07-07 15:32:16 +10:00
parent 17168ef241
commit 39b3e5917a

View File

@ -20,10 +20,10 @@ public class PanelBlockOnClick implements Listener {
@EventHandler @EventHandler
public void onInteract(PlayerInteractEvent e){ public void onInteract(PlayerInteractEvent e){
boolean isPanelBlock = blockClickEventTrigger(e.getClickedBlock().getLocation(), e.getPlayer(),true); if (e.getAction() == Action.RIGHT_CLICK_BLOCK && e.getClickedBlock() != null) {
if(isPanelBlock) { boolean isPanelBlock = blockClickEventTrigger(e.getClickedBlock().getLocation(), e.getPlayer(), true);
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && e.getClickedBlock() != null) { if (isPanelBlock) {
blockClickEventTrigger(e.getClickedBlock().getLocation(), e.getPlayer(),false); blockClickEventTrigger(e.getClickedBlock().getLocation(), e.getPlayer(), false);
e.setCancelled(true); e.setCancelled(true);
} }
} }