Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean isBlockTouching(Block block, Material material) {
- Material east = block.getRelative(BlockFace.EAST).getType();
- Material west = block.getRelative(BlockFace.WEST).getType();
- Material north = block.getRelative(BlockFace.NORTH).getType();
- Material south = block.getRelative(BlockFace.SOUTH).getType();
- if (south.equals(material) || east.equals(material) || west.equals(material) || north.equals(material)) {
- return true;
- } else {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement