Skip to content

Commit

Permalink
Use isOccluding instead of isSolid to check chest access (#1)
Browse files Browse the repository at this point in the history
Apecengo authored and RoboMWM committed Apr 25, 2019
1 parent bc258e8 commit abae26d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -418,8 +418,13 @@ public FakePlayerInteractEvent(Player player, Action rightClickBlock, ItemStack
}
}

/**
* Function to check if a chest would open based only on its block above
* @param aboveBlockID the block above the ctest
* @return whether or not the chest would not open
*/
static boolean preventsChestOpen(Material aboveBlockID)
{
return aboveBlockID != Material.CHEST && aboveBlockID.isSolid();
return aboveBlockID.isOccluding();
}
}

0 comments on commit abae26d

Please sign in to comment.