Skip to content
Permalink
Browse files

Check against air, not null

  • Loading branch information...
me4502 committed May 7, 2019
1 parent a35b840 commit 38acda8c91199d6f76e9a2d57ae22ca2185ee45c
@@ -115,7 +115,7 @@ public void onRightClick(SignClickEvent event) {
ChangedSign sign = event.getSign();

if (CraftBookPlugin.inst().getConfiguration().safeDestruction && sign != null && !sign.getLine(0).equalsIgnoreCase("infinite"))
if (event.getPlayer().getItemInHand() != null) {
if (event.getPlayer().getItemInHand().getType() != Material.AIR) {
BlockData bridgeType = getBlockType(event.getClickedBlock());
if (bridgeType.getMaterial() == event.getPlayer().getItemInHand().getType()) {

@@ -116,7 +116,7 @@ public void onRightClick(SignClickEvent event) {
ChangedSign sign = event.getSign();

if (CraftBookPlugin.inst().getConfiguration().safeDestruction && sign != null && !sign.getLine(0).equalsIgnoreCase("infinite"))
if (event.getPlayer().getItemInHand() != null)
if (event.getPlayer().getItemInHand().getType() != Material.AIR)
if (getBlockBase(event.getClickedBlock()).getType() == event.getPlayer().getItemInHand().getType() && getBlockBase(event.getClickedBlock()).getData() == event.getPlayer().getItemInHand().getData().getData()) {

if (!player.hasPermission("craftbook.mech.door.restock")) {

0 comments on commit 38acda8

Please sign in to comment.
You can’t perform that action at this time.