Skip to content

Commit

Permalink
Check against air, not null
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed May 7, 2019
1 parent a35b840 commit 38acda8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -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()) {

Expand Down
Expand Up @@ -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")) {
Expand Down

0 comments on commit 38acda8

Please sign in to comment.