Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.32 KB | None | 0 0
  1. import java.awt.Toolkit;
  2.  
  3. import com.nueb.ModLoader;
  4. import com.nueb.mod.Location;
  5. import com.nueb.mod.Mod;
  6. import com.nueb.wrapper.Client;
  7. import com.nueb.wrapper.Player;
  8. import com.nueb.wrapper.World;
  9.  
  10. public class Beeper extends Mod
  11. {
  12.  
  13.     public Beeper(ModLoader loader)
  14.     {
  15.         super(loader);
  16.     }
  17.  
  18.     public void run()
  19.     {
  20.         while(true)
  21.         {
  22.             Client client = this.getLoader().getClient();
  23.             World world = client.getWorld();
  24.             Player me = client.getMyPlayer();
  25.    
  26.             Location closest = null;
  27.    
  28.             for (int x = 0; x < 16; x++)
  29.             {
  30.                 for (int y = 0; y < 128; y++)
  31.                 {
  32.                     for (int z = 0; z < 16; z++)
  33.                     {
  34.                         if (world.getBlockId(x, y, z) == 56)
  35.                         {
  36.                             Location loc = new Location(x, y, z);
  37.    
  38.                             if (closest == null)
  39.                             {
  40.                                 closest = loc;
  41.                             }
  42.                             else if (me.getLocation().distanceTo(closest) > me.getLocation().distanceTo(loc))
  43.                             {
  44.                                 {
  45.                                     closest = loc;
  46.                                 }
  47.                             }
  48.                         }
  49.                     }
  50.                 }
  51.             }
  52.            
  53.             Toolkit.getDefaultToolkit().beep();
  54.            
  55.             try
  56.             {
  57.                 Thread.sleep((long) (me.getLocation().distanceTo(closest) * 100));
  58.             }
  59.             catch(Exception e)
  60.             {
  61.                 e.printStackTrace();
  62.             }
  63.         }
  64.     }
  65.  
  66.     public boolean isThreaded()
  67.     {
  68.         return true;
  69.     }
  70.  
  71.     public void stop()
  72.     {
  73.         this.setRunning(false);
  74.         this.shouldRun(false);
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement