Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- import java.util.List;
- import net.minecraft.client.Minecraft;
- import net.minecraft.src.Achievement;
- import net.minecraft.src.BaseMod;
- import net.minecraft.src.Entity;
- import net.minecraft.src.EntityPlayer;
- import net.minecraft.src.Item;
- import net.minecraft.src.MLProp;
- import net.minecraft.src.MathHelper;
- import net.minecraft.src.ModLoader;
- import net.minecraft.src.PlayerControllerSP;
- import net.minecraft.src.ScaledResolution;
- import net.minecraft.src.TileEntityMobSpawner;
- import net.minecraft.src.World;
- import org.lwjgl.input.Keyboard;
- import java.util.ArrayList;
- import java.util.Collection;
- import java.util.HashSet;
- import java.util.Iterator;
- import java.util.Random;
- import java.util.Set;
- import java.util.TreeSet;
- import java.util.Map;
- import java.util.HashMap;
- public class mod_MovePlus extends BaseMod implements Runnable {
- public static int spriteIndex;
- public static String modName = "MovePlus";
- public static World worldRef;
- public static EntityPlayer theplayer;
- public static Minecraft mc;
- public static int timeout;
- public static String msg;
- public static int color;
- public static int defaultColor = 16777215;
- public static int lastKey = 0;
- public static int[] keys;
- public static long[] keyTimes = new long[] {0L, 0L, 0L, 0L, 0L};
- public static boolean[] secondPress = new boolean[] {false, false, false, false, false};
- public static boolean dodged;
- public static boolean doubleJumped;
- public static boolean speedJumped;
- public static long landTime;
- public static boolean lastTickLanded;
- public static long tickCount = 0L;
- public static long timeCount = 0L;
- public static long prevTimeCount = 0L;
- public static boolean toggleKeyPressed = false;
- public static boolean dodgeToggle = true;
- @MLProp public static String toggleKey = "Z";
- @MLProp
- public static boolean useDoubleJump = true;
- @MLProp
- public static boolean useGroundDodge = true;
- @MLProp
- public static boolean useWallDodge = true;
- @MLProp
- public static boolean useBoostDodge = true;
- @MLProp
- public static boolean useSpeedJump = true;
- @MLProp
- public static boolean useAirControl = true;
- @MLProp
- public static float dodgeUpForce = 0.4F;
- @MLProp
- public static float doubleJumpForce = 0.5F;
- @MLProp
- public static float dodgeForce = 1.6F;
- public static float fwForce = 0.8F;
- @MLProp
- public static int dodgeMinDelayTime = 7;
- public static Achievement boostdodged;
- @MLProp
- public static boolean speedMining = false;
- @MLProp
- public static boolean dolphinSkills = false;
- @MLProp
- public static float dolphinSpeed = 0.2F;
- @MLProp
- public static float dolphinSpeedMax = 15.0F;
- @MLProp
- public static float airControlSpeed = 0.1F;
- @MLProp
- public static float airControlSpeedMax = 0.15F;
- @MLProp
- public static float speedJumpMax = 0.9F;
- public static boolean superMagicProperty = true;
- public static boolean ingui = false;
- public static int camIndex = 0;
- public static int deathX = -1;
- public static int deathY = -1;
- public static int deathZ = -1;
- public static int targX = 0;
- public static int targY = 0;
- public static int targZ = 0;
- public static int savedX[];
- public static int savedY[];
- public static int savedZ[];
- public static PathEntity path;
- public static boolean pathFollowing = false;
- public static long lastWorldTime;
- public static boolean coordToggle = false;
- //keep at bottom of var list
- public static boolean devFeatures = true;
- public static boolean useStamina = true;
- public static int exaustCounter;
- //public static boolean dev = true;
- public void run() {
- try {
- while(true) {
- if(mc == null) {
- mc = ModLoader.getMinecraftInstance();
- }
- if(mc == null) {
- Thread.sleep(50L);
- } else if(mc.thePlayer == null) {
- Thread.sleep(50L);
- } else {
- if (theplayer != null) {
- if (theplayer.isDead) {
- deathX = (int)theplayer.posX;
- deathY = (int)theplayer.posY;
- deathZ = (int)theplayer.posZ;
- }
- }
- worldRef = mc.theWorld;
- theplayer = mc.thePlayer;
- keys = new int[] {mc.gameSettings.keyBindForward.keyCode, mc.gameSettings.keyBindLeft.keyCode, mc.gameSettings.keyBindBack.keyCode, mc.gameSettings.keyBindRight.keyCode, mc.gameSettings.keyBindJump.keyCode};
- Thread.sleep(100L);
- }
- }
- } catch (Throwable var6) {
- var6.printStackTrace();
- }
- }
- public mod_MovePlus() {
- ingui = false;
- ModLoader.SetInGameHook(this, true, false);
- ModLoader.SetInGUIHook(this, true, false);
- theplayer = null;
- (new Thread(this)).start();
- boostdodged = (new Achievement(456, "boostdodged", 0, 0, Item.feather, (Achievement)null)).registerAchievement();
- ModLoader.AddAchievementDesc(boostdodged, "Boost Dodge", "Perform a Boost Dodge.");
- //Block.blocksList[8] = (new BlockFlowing(8, Material.water)).setHardness(100.0F).setLightOpacity(3).setBlockName("water").disableStats().disableNeighborNotifyOnMetadataChange();
- }
- public static void forceInit() {
- mc = ModLoader.getMinecraftInstance();
- worldRef = mc.theWorld;
- theplayer = mc.thePlayer;
- keys = new int[] {mc.gameSettings.keyBindForward.keyCode, mc.gameSettings.keyBindLeft.keyCode, mc.gameSettings.keyBindBack.keyCode, mc.gameSettings.keyBindRight.keyCode, mc.gameSettings.keyBindJump.keyCode};
- }
- public static void displayMessage(String var0, int var1) {
- msg = var0;
- timeout = 85;
- color = var1;
- }
- public static void displayMessage(String var0) {
- displayMessage(var0, defaultColor);
- }
- public static void checkKey(int var0) {
- if(useSpeedJump && var0 == 4 && Keyboard.isKeyDown(keys[var0]) && !speedJumped && tickCount - landTime < 3L) {
- double var1 = theplayer.motionY;
- double var3 = Math.sqrt(theplayer.motionX * theplayer.motionX + theplayer.motionZ * theplayer.motionZ);
- if(var3 < (double)speedJumpMax) {
- if (!useStamina || theplayer.getFoodStats().getFoodLevel() > 3) {
- performMove(keys[var0], false, false, true);
- tryExaust(1);
- }
- }
- theplayer.motionY = var1;
- speedJumped = true;
- keyTimes[var0] = tickCount - 500L;
- }
- if(useDoubleJump && var0 == 4 && secondPress[var0] && Keyboard.isKeyDown(keys[var0])) {
- if(!theplayer.onGround && !doubleJumped) {
- if(!doubleJumped) {
- if (!useStamina || theplayer.getFoodStats().getFoodLevel() > 3) {
- performMove(keys[var0], false, false);
- tryExaust(5);
- }
- }
- if (!devFeatures) doubleJumped = true;
- }
- secondPress[var0] = false;
- keyTimes[var0] = tickCount - 500L;
- }
- if(tickCount - keyTimes[var0] < (long)dodgeMinDelayTime && secondPress[var0] && Keyboard.isKeyDown(keys[var0])) {
- if(useBoostDodge && Keyboard.isKeyDown(Keyboard.getKeyIndex("SPACE")) && keyTimes[var0] - keyTimes[4] - 500L < 5L && nearWall(theplayer)) {
- if (!useStamina || theplayer.getFoodStats().getFoodLevel() > 3) {
- theplayer.triggerAchievement(boostdodged);
- performMove(keys[var0], true, false);
- tryExaust(5);
- }
- } else if(dodgeToggle && useWallDodge && (theplayer.onGround || nearWall(theplayer))) {
- if (!useStamina || theplayer.getFoodStats().getFoodLevel() > 3) {
- performMove(keys[var0], false, false);
- tryExaust(5);
- }
- } else if(dodgeToggle && useGroundDodge && !dodged && !doubleJumped) {
- if (!useStamina || theplayer.getFoodStats().getFoodLevel() > 3) {
- performMove(keys[var0], false, true);
- tryExaust(5);
- }
- }
- if (!devFeatures) dodged = true;
- secondPress[var0] = false;
- keyTimes[var0] = tickCount - 500L;
- }
- if(!Keyboard.isKeyDown(keys[var0]) && !secondPress[var0]) {
- secondPress[var0] = true;
- }
- if(Keyboard.isKeyDown(keys[var0]) && secondPress[var0]) {
- secondPress[var0] = false;
- lastKey = keys[var0];
- keyTimes[var0] = tickCount;
- }
- }
- public static void tryExaust(int inc) {
- if (useStamina && !worldRef.multiplayerWorld) {
- exaustCounter+=inc;
- if (exaustCounter >= 5) {
- exaustCounter = 0;
- theplayer.addExhaustion(1F);
- }
- }
- }
- public static boolean nearWall(Entity var0) {
- return var0.worldObj.getCollidingBoundingBoxes(var0, var0.boundingBox.expand(0.2D, 0.0D, 0.2D)).size() > 0;
- }
- public boolean OnTickInGame(float f, Minecraft var1) {
- //System.out.println("sdsda");
- //mc.fontRenderer.drawString(var1.thePlayer.health+"/20",4,20,0xFFFFF);
- if(!ingui) {
- this.OSDHook(var1, false);
- }
- ingui = false;
- return true;
- }
- public boolean OnTickInGUI(float f, Minecraft var1, GuiScreen gui) {
- if (ModLoader.getMinecraftInstance().thePlayer != null) {
- //long ticksRan = System.currentTimeMillis();
- if (!(gui instanceof GuiContainer) && gui != null) {
- ingui = true;
- //lastTickRun = 0;
- }
- if (pathFollowing && path != null && lastWorldTime != worldRef.worldInfo.getWorldTime()) {
- this.displayMessage("Pathfinding");
- pathFollow();
- lastWorldTime = worldRef.worldInfo.getWorldTime();
- }
- //OnTickInGame(f, var1);
- //System.out.println(gui);
- //playerTick(mc.thePlayer);
- }
- return true;
- }
- public static void airControl(Entity var0) {
- if(useAirControl && timeCount != worldRef.worldInfo.getWorldTime()) {
- float var1 = 0.0F;
- float var2 = 0.0F;
- if(Keyboard.isKeyDown(mc.gameSettings.keyBindForward.keyCode)) {
- ++var1;
- } else if(Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.keyCode)) {
- --var2;
- } else if(Keyboard.isKeyDown(mc.gameSettings.keyBindBack.keyCode)) {
- --var1;
- } else if(Keyboard.isKeyDown(mc.gameSettings.keyBindRight.keyCode)) {
- ++var2;
- }
- double var3 = Math.sqrt(var0.motionX * var0.motionX + var0.motionZ * var0.motionZ);
- if(dolphinSkills && theplayer.isInWater()) {
- if(var3 < (double)dolphinSpeedMax && var3 > 0.009999999776482582D && (var1 != 0.0F || var2 != 0.0F)) {
- setRelVel2(theplayer, var2, (float)var0.motionY, var1, dolphinSpeed);
- }
- } else if(useAirControl && !theplayer.onGround && var3 < (double)airControlSpeedMax && var3 > 0.009999999776482582D && (var1 != 0.0F || var2 != 0.0F)) {
- setRelVel(theplayer, var2, (float)var0.motionY, var1, airControlSpeed);
- }
- }
- }
- public void pathFollow2() {
- Entity ent1 = theplayer;
- if(path != null/* && this.rand.nextInt(100) != 0*/) {
- Vec3D var5 = path.getPosition(ent1);
- double var6 = (double)(ent1.width * 1.2); //override on path track distance
- while(var5 != null && var5.squareDistanceTo(ent1.posX, var5.yCoord, ent1.posZ) < var6 * var6) {
- path.incrementPathIndex();
- if(path.isFinished()) {
- var5 = null;
- path = null;
- //remove pf delay!
- //this.pathfindDelay = 50;
- } else {
- var5 = path.getPosition(ent1);
- }
- }
- }
- }
- public void pathFollow() {
- Vec3D var5 = path.getPosition(theplayer);
- double var6 = (double)(theplayer.width * 1.2F);
- while(var5 != null && var5.squareDistanceTo(theplayer.posX, var5.yCoord, theplayer.posZ) < var6 * var6) {
- path.incrementPathIndex();
- if(path.isFinished()) {
- var5 = null;
- path = null;
- } else {
- var5 = path.getPosition(theplayer);
- }
- }
- int var21 = MathHelper.floor_double(theplayer.boundingBox.minY + 0.5D);
- float angle = 0F;
- if(var5 != null) {
- double var8 = var5.xCoord - theplayer.posX;
- double var10 = var5.zCoord - theplayer.posZ;
- double var12 = var5.yCoord - (double)var21;
- float var14 = (float)(Math.atan2(var10, var8) * 180.0D / 3.1415927410125732D) - 90.0F;
- float var15 = var14 - theplayer.rotationYaw;
- for(angle = theplayer.moveSpeed; var15 < -180.0F; var15 += 360.0F) {
- ;
- }
- while(var15 >= 180.0F) {
- var15 -= 360.0F;
- }
- if(var15 > 30.0F) {
- var15 = 30.0F;
- }
- if(var15 < -30.0F) {
- var15 = -30.0F;
- }
- theplayer.rotationYaw += var15;
- if(var12 > 0.0D || theplayer.handleWaterMovement() || theplayer.handleLavaMovement()) {
- theplayer.isJumping = true;
- }
- if (theplayer.isJumping) {
- //this.A
- if (theplayer.onGround) {
- performMove(keys[4], false, false);
- }
- }
- }
- //float speed = theplayer.cg;
- //theplayer.cg = 0.1F;
- theplayer.moveEntityWithHeading(0F,angle);
- //theplayer.moveEntityWithHeading(0F,angle);
- //theplayer.cg = speed;
- }
- public void listEntities() {
- System.out.println("---------------");
- Map itemStrToCount = new HashMap();
- for(int var33 = 0; var33 < worldRef.playerEntities.size(); ++var33) {
- Entity var4 = (Entity)worldRef.playerEntities.get(var33);
- String str;// = ((EntityItem)var4).item.getItemName();
- str = (var4).getClass().toString();
- if (itemStrToCount.containsKey(str)) {
- itemStrToCount.put(str, (((Integer)itemStrToCount.get(str)).intValue()+1));
- } else {
- itemStrToCount.put(str, 1);
- }
- /*if (var4 instanceof bg) {
- worldRef.g.remove(var4);
- }*/
- }
- Set entries = itemStrToCount.entrySet();
- Iterator it = entries.iterator();
- while (it.hasNext()) {
- Map.Entry entry = (Map.Entry) it.next();
- System.out.println(entry.getKey() + " --> " + entry.getValue());
- }
- }
- //FALLDAMAGE NEGATING!
- //sendQueue.addToSendQueue(new Packet11PlayerPosition(motionX, -999D, -999D, motionZ, field_fall_hack ? true : onGround));
- //also set onGround = true?
- //increase digspeed x10 for 30 seconds
- //mc.h.a(new add(ud.e.H, 30*20, 10));
- //mc.h.a(new ade(ud.l.H, 30*20, 10));
- //mc.h.a(new ade(ud.p.H, 30*20, 10));
- public void OSDHook(Minecraft var1, boolean var2) {
- int var4;
- devFeatures = false;
- if (theplayer == null) {
- forceInit();
- }
- //if (true) return;
- //dolphinSkills = false;
- if(theplayer != null && !var2 && ((worldRef != null && !worldRef.multiplayerWorld) || superMagicProperty)) {
- boolean var3 = nearWall(theplayer);
- if(Keyboard.isKeyDown(Keyboard.getKeyIndex(toggleKey))) {
- if(!toggleKeyPressed) {
- dodgeToggle = !dodgeToggle;
- toggleKeyPressed = true;
- displayMessage("Dodging: " + (dodgeToggle?"enabled":"disabled"));
- }
- } else if(Keyboard.isKeyDown(Keyboard.getKeyIndex("M"))) {
- if(!toggleKeyPressed) {
- //mc.h.a(new ade(ud.l.H, 30*20, 10));
- //mc.h.a(new ade(ud.p.H, 30*20, 10));
- coordToggle = !coordToggle;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD0)) {
- if(!toggleKeyPressed) {
- try {
- mc.renderViewEntity = theplayer;
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- camIndex = 0;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD1)) {
- if(!toggleKeyPressed) {
- System.out.println(worldRef.playerEntities.size());
- //int tryIndex = camIndex;
- if (camIndex >= worldRef.playerEntities.size()) {
- camIndex = 0;
- }
- System.out.println("index: " + camIndex);
- System.out.println("name: " + ((EntityPlayer)worldRef.playerEntities.get(camIndex)).username);
- try {
- if (worldRef.playerEntities.get(camIndex) instanceof EntityPlayer) {
- mc.renderViewEntity = (EntityLiving)worldRef.playerEntities.get(camIndex);
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- camIndex++;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD2)) {
- if(!toggleKeyPressed) {
- System.out.println(worldRef.playerEntities.size());
- if (camIndex < 0) {
- camIndex = worldRef.playerEntities.size()-1;
- }
- try {
- if (worldRef.playerEntities.get(camIndex) instanceof EntityPlayer) {
- mc.renderViewEntity = (EntityPlayer)worldRef.playerEntities.get(camIndex);
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- camIndex--;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD4)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- targX = (int)theplayer.posX;
- targY = (int)theplayer.posY;
- targZ = (int)theplayer.posZ;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD5)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- targX = (int)theplayer.posX;
- targY = (int)theplayer.posY;
- targZ = (int)theplayer.posZ;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD6)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- targX = (int)theplayer.posX;
- targY = (int)theplayer.posY;
- targZ = (int)theplayer.posZ;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD7)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- targX = (int)theplayer.posX;
- targY = (int)theplayer.posY;
- targZ = (int)theplayer.posZ;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD8)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- targX = (int)theplayer.posX;
- targY = (int)theplayer.posY;
- targZ = (int)theplayer.posZ;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_NUMPAD9)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- targX = (int)theplayer.posX;
- targY = (int)theplayer.posY;
- targZ = (int)theplayer.posZ;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_HOME)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- targX = 574;
- targY = 62;
- targZ = 103;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_END)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- targX = deathX;
- targY = deathY;
- targZ = deathZ;
- //path = worldRef.a(theplayer, targX, targY, targZ, 512.0F);
- //System.out.println(path.b.length);
- //pathFollowing = true;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_INSERT)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- path = worldRef.getEntityPathToXYZ(theplayer, targX, targY, targZ, 256.0F);
- pathFollowing = true;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_DELETE)) {
- if(!toggleKeyPressed) {
- //System.out.println(worldRef.playerEntities.size());
- pathFollowing = false;
- toggleKeyPressed = true;
- }
- } else if (devFeatures && Keyboard.isKeyDown(Keyboard.KEY_PERIOD)) {
- if(!toggleKeyPressed) {
- int xx = (int)theplayer.posX+40;
- int yy = (int)theplayer.posY;
- int zz = (int)theplayer.posZ+40;
- int size = 20;
- for (int xxx = xx-size; xxx < xx+size; xxx++) {
- for (int yyy = yy; yyy < 128; yyy++) {
- for (int zzz = zz-size; zzz < zz+size; zzz++) {
- worldRef.setBlockWithNotify(xxx, yyy, zzz, 3);
- }
- }
- }
- toggleKeyPressed = true;
- }
- } else {
- toggleKeyPressed = false;
- }
- if (pathFollowing && path != null && lastWorldTime != worldRef.worldInfo.getWorldTime()) {
- this.displayMessage("Pathfinding");
- pathFollow();
- lastWorldTime = worldRef.worldInfo.getWorldTime();
- }
- if (coordToggle) {
- //displayMessage((new StringBuilder()).append("X: ").append((int)mc.renderViewEntity.o).append(" Y: ").append((int)mc.renderViewEntity.p).append(" Z: ").append((int)mc.renderViewEntity.q).toString());
- String coordmsg = (new StringBuilder()).append("X: ").append((int)mc.thePlayer.posX).append(" Y: ").append((int)mc.thePlayer.posY).append(" Z: ").append((int)mc.thePlayer.posZ).toString();
- String deathmsg = "";
- if (deathX != -1) {
- deathmsg = new StringBuilder().append("Last Death, X: " + deathX + " Y: " + deathY + " Z: " + deathZ).toString();
- }
- mc.fontRenderer.drawStringWithShadow(coordmsg, 3, 25, 0xffffff);
- mc.fontRenderer.drawStringWithShadow(deathmsg, 3, 45, 0xffffff);
- }
- for(var4 = 0; var4 < keys.length; ++var4) {
- checkKey(var4);
- }
- if(!theplayer.onGround || theplayer.isInWater() && false && theplayer.ridingEntity == null) {
- airControl(theplayer);
- }
- if (!theplayer.onGround && Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.keyCode)) {
- theplayer.motionY = 0.0F;
- }
- //if (true) return;
- if ((theplayer.motionY < -0.5F && theplayer.motionY > -1.1F) && theplayer.ridingEntity == null && !theplayer.isInWater() && !theplayer.isInsideOfMaterial(Material.lava) && !theplayer.isInsideOfMaterial(Material.cactus) && !theplayer.isInsideOfMaterial(Material.water)) {
- //this.displayMessage("hmm?");
- theplayer.fallDistance = 0.0F;
- if (theplayer instanceof EntityClientPlayerMP) {
- //theplayer.onGround = true;
- ((EntityClientPlayerMP)theplayer).sendQueue.addToSendQueue(new Packet11PlayerPosition(theplayer.motionX, -999D, -999D, theplayer.motionZ, true));
- }
- }
- //this.displayMessage(new StringBuilder().append(theplayer.fallDistance + " - " + theplayer.motionY).toString());
- //if (true) return;
- /*List list = worldRef.getEntitiesWithinAABBExcludingEntity(theplayer, theplayer.boundingBox.expand(5.0D, 5.0D, 5.0D));
- for(int count = 0; count < list.size(); ++count) {
- Entity var5 = (Entity)list.get(count);
- if(var5 instanceof EntityLiving && !(var5 instanceof EntityPlayer)) {
- //System.out.println(var5);
- mc.playerController.attackEntity(theplayer, var5);
- }
- }
- for (int i = 0; i < this.worldRef.playerEntities.size(); i++) {
- EntityPlayer ent = (EntityPlayer)this.worldRef.playerEntities.get(i);
- if(!ent.username.equals("Corosus")) {
- //theplayer.attackTargetEntityWithCurrentItem(theplayer);
- mc.playerController.attackEntity(theplayer, ent);
- }
- }*/
- /*if (theplayer.distanceWalkedModified > 15F && !theplayer.onGround) {
- theplayer.distanceWalkedModified = 0F;
- }*/
- /*float stepdist = 0F;
- try {
- stepdist = (float)Float.valueOf(ModLoader.getPrivateValue(Entity.class, theplayer, "b").toString()).floatValue();
- ModLoader.setPrivateValue(Entity.class, theplayer, "nextStepDistance", (int)theplayer.distanceWalkedModified+1);
- } catch (Exception ex) {
- try {
- stepdist = (float)Float.valueOf(ModLoader.getPrivateValue(Entity.class, theplayer, "nextStepDistance").toString()).floatValue();
- ModLoader.setPrivateValue(Entity.class, theplayer, "nextStepDistance", (int)theplayer.distanceWalkedModified+1);
- } catch (Exception ex2) {
- }
- }*/
- //System.out.println(stepdist);
- if(theplayer.onGround) {
- speedJumped = false;
- doubleJumped = false;
- dodged = false;
- if(!lastTickLanded) {
- lastTickLanded = true;
- landTime = tickCount;
- }
- } else {
- lastTickLanded = false;
- }
- prevTimeCount = timeCount;
- timeCount = worldRef.worldInfo.getWorldTime();
- if(timeCount > prevTimeCount) {
- tickCount += timeCount - prevTimeCount;
- }
- if(speedMining) {
- if(!worldRef.multiplayerWorld) {
- try {
- Object var9 = ModLoader.getPrivateValue(PlayerControllerSP.class, (PlayerControllerSP)ModLoader.getMinecraftInstance().playerController, "f");
- float var5 = Float.valueOf(var9.toString()).floatValue();
- if(var5 > 0.01F) {
- var5 += 0.05F;
- if(var5 > 1.0F) {
- var5 = 1.0F;
- }
- ModLoader.setPrivateValue(PlayerControllerSP.class, (PlayerControllerSP)ModLoader.getMinecraftInstance().playerController, "f", Float.valueOf(var5));
- }
- ModLoader.setPrivateValue(PlayerControllerSP.class, (PlayerControllerSP)ModLoader.getMinecraftInstance().playerController, "i", Integer.valueOf(0));
- } catch (Exception var7) {
- ;
- }
- } else if(!superMagicProperty) {
- ;
- }
- }
- }
- if(timeout > 0 && msg != null) {
- ScaledResolution var8 = new ScaledResolution(var1.gameSettings, var1.displayWidth, var1.displayHeight);
- var4 = var8.getScaledWidth();
- int var10 = var8.getScaledHeight();
- int var6 = var1.fontRenderer.getStringWidth(msg);
- var1.fontRenderer.drawStringWithShadow(msg, 3, 105, 16777215);
- --timeout;
- }
- }
- public String getVersion() {
- return "Version 2.1 for MC "+ModLoader.VERSION.substring(ModLoader.VERSION.indexOf(" ")+1);
- }
- public void load() {
- }
- public static void performMove(int var0, boolean var1, boolean var2) {
- performMove(var0, var1, var2, false);
- }
- public static void performMove(int var0, boolean var1, boolean var2, boolean var3) {
- float var4 = dodgeUpForce;
- float var5 = dodgeForce;
- if(var1) {
- var4 += 0.4F;
- }
- if(var2) {
- var5 /= 2.0F;
- }
- float var6 = 0.0F;
- float var7 = 0.0F;
- if(var3) {
- if(Keyboard.isKeyDown(mc.gameSettings.keyBindForward.keyCode)) {
- ++var6;
- } else if(Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.keyCode)) {
- --var7;
- } else if(Keyboard.isKeyDown(mc.gameSettings.keyBindBack.keyCode)) {
- --var6;
- } else {
- if(!Keyboard.isKeyDown(mc.gameSettings.keyBindRight.keyCode)) {
- return;
- }
- ++var7;
- }
- double var8 = Math.sqrt(theplayer.motionX * theplayer.motionX + theplayer.motionZ * theplayer.motionZ);
- setRelVel(theplayer, var7, 0.0F, var6, (float)var8 / 2.0F);
- } else {
- if(mc.gameSettings.keyBindForward.keyCode == var0) {
- setRelVel(theplayer, 0.0F, var4, 1.0F, var5);
- } else if(mc.gameSettings.keyBindLeft.keyCode == var0) {
- setRelVel(theplayer, -1.0F, var4, 0.0F + fwForce, var5);
- } else if(mc.gameSettings.keyBindBack.keyCode == var0) {
- setRelVel(theplayer, 0.0F, var4, -1.0F, var5);
- } else if(mc.gameSettings.keyBindRight.keyCode == var0) {
- setRelVel(theplayer, 1.0F, var4, 0.0F + fwForce, var5);
- } else if(mc.gameSettings.keyBindJump.keyCode == var0) {
- setRelVel(theplayer, var7, doubleJumpForce, var6, 0.0F);
- }
- }
- }
- public static void setRelVel(Entity var0, float var1, float var2, float var3, float var4) {
- float var5 = 10.0F;
- float var6 = 0.0F;
- float var7 = var0.prevRotationYaw + (var0.rotationYaw - var0.prevRotationYaw) * var5;
- int var8 = (int)Math.floor((double)(var7 / 360.0F) + 0.5D);
- var7 = var7 - (float)var8 * 360.0F + 270.0F;
- if(var3 <= 0.0F && var3 < 0.0F) {
- var7 += 180.0F;
- }
- if(var1 > 0.0F) {
- var7 += 90.0F - var3 * 10.0F;
- } else if(var1 < 0.0F) {
- var7 += 270.0F + var3 * 10.0F;
- }
- float var9 = MathHelper.cos(-var7 * 0.01745329F - 3.141593F);
- float var10 = MathHelper.sin(-var7 * 0.01745329F - 3.141593F);
- float var11 = -MathHelper.cos(-var6 * 0.01745329F - 0.7853982F);
- float var12 = MathHelper.sin(-var6 * 0.01745329F - 0.7853982F);
- float var13 = var9 * var11;
- float var15 = var10 * var11;
- if(var1 == 0.0F && var3 == 0.0F) {
- setVel(var0, (float)var0.motionX / 2.0F, var2, (float)var0.motionZ / 2.0F);
- } else {
- setVel(var0, var13 * var4 * -1.0F, var2, var15 * var4);
- }
- }
- public static void setRelVel2(Entity var0, float var1, float var2, float var3, float var4) {
- float var5 = 10.0F;
- float var6 = var0.prevRotationPitch + (var0.rotationPitch - var0.prevRotationPitch) * var5;
- float var7 = var0.prevRotationYaw + (var0.rotationYaw - var0.prevRotationYaw) * var5;
- int var8 = (int)Math.floor((double)(var7 / 360.0F) + 0.5D);
- var7 = var7 - (float)var8 * 360.0F + 270.0F;
- var6 = var6 - (float)var8 * 360.0F + 315.0F;
- if(var3 <= 0.0F && var3 < 0.0F) {
- var7 += 180.0F;
- }
- if(var1 > 0.0F) {
- var7 += 90.0F - var3 * 10.0F;
- } else if(var1 < 0.0F) {
- var7 += 270.0F + var3 * 10.0F;
- }
- float var9 = MathHelper.cos(-var7 * 0.01745329F - 3.141593F);
- float var10 = MathHelper.sin(-var7 * 0.01745329F - 3.141593F);
- float var11 = -MathHelper.cos(-var6 * 0.01745329F - 0.7853982F);
- float var12 = MathHelper.sin(-var6 * 0.01745329F - 0.7853982F);
- float var13 = var9 * var11;
- float var15 = var10 * var11;
- if(var1 == 0.0F && var3 == 0.0F) {
- setVel(var0, (float)var0.motionX / 2.0F, var2, (float)var0.motionZ / 2.0F);
- } else {
- setVel(var0, var13 * var4 * -1.0F, var12 * var4 * 5.0F, var15 * var4);
- }
- }
- public static void setVel(Entity var0, float var1, float var2, float var3) {
- var0.motionX += (double)var1;
- var0.motionY = (double)var2;
- var0.motionZ += (double)var3;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment