Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Toolkit;
- import com.nueb.ModLoader;
- import com.nueb.mod.Location;
- import com.nueb.mod.Mod;
- import com.nueb.wrapper.Client;
- import com.nueb.wrapper.Player;
- import com.nueb.wrapper.World;
- public class Beeper extends Mod
- {
- public Beeper(ModLoader loader)
- {
- super(loader);
- }
- public void run()
- {
- while(true)
- {
- Client client = this.getLoader().getClient();
- World world = client.getWorld();
- Player me = client.getMyPlayer();
- Location closest = null;
- for (int x = 0; x < 16; x++)
- {
- for (int y = 0; y < 128; y++)
- {
- for (int z = 0; z < 16; z++)
- {
- if (world.getBlockId(x, y, z) == 56)
- {
- Location loc = new Location(x, y, z);
- if (closest == null)
- {
- closest = loc;
- }
- else if (me.getLocation().distanceTo(closest) > me.getLocation().distanceTo(loc))
- {
- {
- closest = loc;
- }
- }
- }
- }
- }
- }
- Toolkit.getDefaultToolkit().beep();
- try
- {
- Thread.sleep((long) (me.getLocation().distanceTo(closest) * 100));
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
- }
- public boolean isThreaded()
- {
- return true;
- }
- public void stop()
- {
- this.setRunning(false);
- this.shouldRun(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement