Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double distance = 6.0D;
- Block eye = player.getTargetBlock(null, (int)distance + 1);
- if (!StopCheckUtils.compare(eye, block)) {
- event.setCancelled(true);
- }
- public static boolean compare(Block b, Block b2) {
- int x = b.getX(); int x2 = b2.getX();
- int y = b.getY(); int y2 = b2.getY();
- int z = b.getZ(); int z2 = b2.getZ();
- if ((x == x2) && (y == y2) && (z == z2)) {
- return true;
- } else {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment