Guest User

Untitled

a guest
Sep 9th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. double distance = 6.0D;
  2. Block eye = player.getTargetBlock(null, (int)distance + 1);        
  3. if (!StopCheckUtils.compare(eye, block)) {
  4.     event.setCancelled(true);
  5. }
  6.  
  7. public static boolean compare(Block b, Block b2) {
  8.     int x = b.getX(); int x2 = b2.getX();
  9.     int y = b.getY(); int y2 = b2.getY();
  10.     int z = b.getZ(); int z2 = b2.getZ();
  11.  
  12.     if ((x == x2) && (y == y2) && (z == z2)) {
  13.         return true;
  14.     } else {
  15.         return false;
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment