Advertisement
TheReturningVoid

Untitled

Sep 15th, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public static boolean isBlockTouching(Block block, Material material) {
  2.    Material east = block.getRelative(BlockFace.EAST).getType();
  3.    Material west = block.getRelative(BlockFace.WEST).getType();
  4.    Material north = block.getRelative(BlockFace.NORTH).getType();
  5.    Material south = block.getRelative(BlockFace.SOUTH).getType();
  6.  
  7.    if (south.equals(material) || east.equals(material) || west.equals(material) || north.equals(material)) {
  8.       return true;
  9.    } else {
  10.       return false;
  11.    }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement