Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class ReliantTorchAnnihilator implements Runnable
  2. {
  3.     private boolean running = true;
  4.    
  5.     private boolean smash = false;
  6.     private int lpX;
  7.     private int lpY;
  8.     private int lpZ;
  9.  
  10.     public void run()
  11.     {
  12.         lpX = (int)(Math.floor(ReliantWrapper.GetPlayerX()));
  13.         lpY = (int)(Math.floor(ReliantWrapper.GetPlayerY()));
  14.         lpZ = (int)(Math.floor(ReliantWrapper.GetPlayerZ()));
  15.    
  16.         while(running)
  17.         {
  18.             if(smash == false)
  19.             {
  20.                 this.Smash();
  21.                 smash = true;
  22.             } else {
  23.                 int posX = (int)(Math.floor(ReliantWrapper.GetPlayerX()));
  24.                 int posY = (int)(Math.floor(ReliantWrapper.GetPlayerY()));
  25.                 int posZ = (int)(Math.floor(ReliantWrapper.GetPlayerZ()));
  26.            
  27.                 if (ReliantMath.Distance(posX, posY, posZ, lpX, lpY, lpZ) >= 4)
  28.                 {
  29.                     this.Smash();
  30.                     smash = true;
  31.                 }
  32.             }
  33.            
  34.             try
  35.             {
  36.                 Thread.sleep(150);
  37.             }
  38.             catch (java.lang.InterruptedException ex)
  39.             {
  40.                 throw new RuntimeException(ex);
  41.             }
  42.         }
  43.     }
  44.    
  45.     public void Stop()
  46.     {
  47.         running = false;
  48.     }
  49.    
  50.     public void Smash()
  51.     {
  52.         int posX = (int)(Math.floor(ReliantWrapper.GetPlayerX()));
  53.         int posY = (int)(Math.floor(ReliantWrapper.GetPlayerY()));
  54.         int posZ = (int)(Math.floor(ReliantWrapper.GetPlayerZ()));
  55.         int maxX = posX + GetBlockReachDistance();
  56.         int maxY = posY + GetBlockReachDistance();
  57.         int maxZ = posZ + GetBlockReachDistance();
  58.         int minX = posX - GetBlockReachDistance();
  59.         int minY = posY - GetBlockReachDistance();
  60.         int minZ = posZ - GetBlockReachDistance();
  61.        
  62.         for(int i = minX; i < maxX; i++)
  63.         {
  64.             for(int j = minY; j < maxY; j++)
  65.             {
  66.                 for(int k = minZ; k < maxZ; k++)
  67.                 {
  68.                     if(ReliantMath.Distance(posX, posY, posZ, i, j, k) <= GetBlockReachDistance())
  69.                     {
  70.                         // mcref.world.getBlockId
  71.                         int blockid = ReliantWrapper.mcref.e.a(i, j, k);
  72.                         qk block = blockid <= 0 ? null : qk.m[blockid];
  73.                        
  74.                         if(block != null && block == qk.aq)
  75.                         {
  76.                             ReliantWrapper.GetNetClientHandler().a(((hz) (new hp(0, i, j, k, 0))));
  77.                            
  78.                             try
  79.                             {
  80.                                 Thread.sleep(35);
  81.                             }
  82.                             catch (java.lang.InterruptedException ex)
  83.                             {
  84.                                 throw new RuntimeException(ex);
  85.                             }
  86.                         }
  87.                     }
  88.                 }
  89.             }
  90.         }
  91.     }
  92.    
  93.     public static int GetBlockReachDistance()
  94.     {
  95.         return 6;
  96.     }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement