SHARE
TWEET

Untitled

a guest Jul 15th, 2019 225 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package client.hacks;
  2.  
  3. import java.util.HashMap;
  4.  
  5. import client.Category;
  6. import client.Client;
  7. import client.hack.Hack;
  8. import net.minecraft.client.multiplayer.WorldClient;
  9. import net.minecraft.entity.Entity;
  10. import net.minecraft.entity.passive.EntitySheep;
  11. import net.minecraft.entity.player.EntityPlayer;
  12. import net.minecraft.util.math.Vec3d;
  13.  
  14. public class CoordTpExploit extends Hack
  15. {
  16.     // Map of each known player and their last known position
  17.     private HashMap<Entity, Vec3d> knownPlayers = new HashMap<Entity, Vec3d>();
  18.    
  19.     private HashMap<String, Vec3d> tpdPlayers = new HashMap<String, Vec3d>();
  20.    
  21.     // Number of ticks since we last calculated if any players had teleported
  22.     private int numTicks = 0;
  23.    
  24.     private int numForgetTicks = 0;
  25.  
  26.     public CoordTpExploit()
  27.     {
  28.         super("Coord Tp Exploit", "Will show you the new coords of any players within your render distance that tp", 0, Category.EXPLOIT);
  29.         Client.addChatMessage("Loaded coord exploit");
  30.     }
  31.    
  32.     public void dump()
  33.     {
  34.         for(Entity entity: mc.world.entityList)
  35.         {
  36.             if(entity instanceof EntityPlayer)
  37.             {
  38.                 System.out.println(entity.getName() + ": " + entity.getPositionVector().toString());
  39.                 Client.addChatMessage(entity.getName() + ": " + entity.getPositionVector().toString());
  40.             }
  41.         }
  42.     }
  43.    
  44.     public void clear()
  45.     {
  46.         knownPlayers.clear();
  47.     }
  48.    
  49.     @Override
  50.     public void onUpdate()
  51.     {
  52.         if(!this.isToggled())
  53.         {
  54.             return;
  55.         }
  56.         if(numTicks >= 50)
  57.         {
  58.             numTicks = 0;
  59.             for(Entity entity: mc.world.entityList)
  60.             {
  61.                 if(entity instanceof EntityPlayer && entity.getName() != mc.player.getName())
  62.                 {
  63.  
  64.                     Vec3d playerPos = new Vec3d(entity.posX, entity.posY, entity.posZ);
  65.                     if(knownPlayers.containsKey(entity))
  66.                     {
  67.                         if(Math.abs(knownPlayers.get(entity).distanceTo(playerPos)) > 50 && Math.abs(mc.player.getPositionVector().distanceTo(playerPos)) > 100 && !(tpdPlayers.containsKey(entity.getName()) && tpdPlayers.get(entity.getName()) == playerPos))
  68.                         {
  69.                             // This player teleported, alert the user
  70.                             Client.addChatMessage("Player \"" + entity.getName() + "\" teleported to " + playerPos.toString());
  71.                             knownPlayers.remove(entity);
  72.                             tpdPlayers.put(entity.getName(), playerPos);
  73.                         }
  74.                         //if(Math.abs(knownPlayers.get(entity).distanceTo(playerPos)) > 2)
  75.                             //Client.addChatMessage("Player \"" + entity.getName() + "\" moved: " + Math.abs(knownPlayers.get(entity).distanceTo(playerPos)));
  76.                        
  77.                         // Update the stored location of the player
  78.                         knownPlayers.put(entity, playerPos);
  79.                     }
  80.                     else
  81.                     {
  82.                         knownPlayers.put(entity, playerPos);
  83.                         //Client.addChatMessage("Added new player: \"" + entity.getName() + "\" with position: " + playerPos.toString());
  84.                     }
  85.                 }
  86.             }
  87.         }
  88.         if(numForgetTicks >= 9000000)
  89.         {
  90.             tpdPlayers.clear();
  91.         }
  92.         numTicks++;
  93.         numForgetTicks++;
  94.     }
  95.    
  96.     /*@Override
  97.     public boolean shouldDisplay()
  98.     {
  99.         return false;
  100.     }*/
  101.    
  102. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top