1
0
mirror of https://github.com/kami-blue/client synced 2025-02-20 23:27:14 +00:00

Deleted teleport command

This commit is contained in:
Dominika 2020-05-22 12:27:32 -04:00
parent 96099df463
commit 6e5ddda8b3
No known key found for this signature in database
GPG Key ID: B4A5A6DCA70F861F

View File

@ -1,99 +0,0 @@
package me.zeroeightsix.kami.command.commands;
import me.zeroeightsix.kami.command.Command;
import me.zeroeightsix.kami.command.syntax.ChunkBuilder;
import me.zeroeightsix.kami.command.syntax.parsers.ModuleParser;
import me.zeroeightsix.kami.util.Wrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.math.Vec3d;
import java.text.DecimalFormat;
import static me.zeroeightsix.kami.util.MessageSendHelper.sendChatMessage;
import static me.zeroeightsix.kami.util.MessageSendHelper.sendErrorMessage;
/**
* Robeart is cool and made potentia
* Updated by d1gress/Qther on 8/12/2019.
*/
public class TeleportCommand extends Command {
private DecimalFormat df = new DecimalFormat("#.###");
private long lastTp;
private Vec3d lastPos;
public static Vec3d finalPos;
public static double blocksPerTeleport;
boolean disable = false;
public TeleportCommand() {
super("teleport", new ChunkBuilder()
.append("x/stop", true, new ModuleParser())
.append("y", true)
.append("z", true)
.append("blocks per tp", false)
.build(), "tp", "clip");
setDescription("Potentia teleport exploit");
}
private void teleport(Minecraft mc) {
Vec3d tpDirectionVec = finalPos.subtract(mc.player.posX, mc.player.posY, mc.player.posZ).normalize();
if (mc.world.isBlockLoaded(mc.player.getPosition())) {
lastPos = new Vec3d(mc.player.posX, mc.player.posY, mc.player.posZ);
if (finalPos.distanceTo(new Vec3d(mc.player.posX, mc.player.posY, mc.player.posZ)) < 0.3 || blocksPerTeleport == 0) {
sendChatMessage("Teleport Finished!");
disable = true;
return;
} else {
mc.player.setVelocity(0, 0, 0);
}
if (disable) return;
if (finalPos.distanceTo(new Vec3d(mc.player.posX, mc.player.posY, mc.player.posZ)) >= blocksPerTeleport) {
final Vec3d vec = tpDirectionVec.scale(blocksPerTeleport);
mc.player.setPosition(mc.player.posX + vec.x, mc.player.posY + vec.y, mc.player.posZ + vec.z);
} else {
final Vec3d vec = tpDirectionVec.scale(finalPos.distanceTo(new Vec3d(mc.player.posX, mc.player.posY, mc.player.posZ)));
mc.player.setPosition(mc.player.posX + vec.x, mc.player.posY + vec.y, mc.player.posZ + vec.z);
disable = true;
}
if (disable) return;
lastTp = System.currentTimeMillis();
} else if (lastTp + 2000L > System.currentTimeMillis()) {
mc.player.setPosition(lastPos.x, lastPos.y, lastPos.z);
}
}
@Override
public void call(String[] args) {
if (args[0].equalsIgnoreCase("stop")) {
sendChatMessage("Teleport Cancelled!");
disable = true;
return;
}
if (args.length >= 4 && args[3] != null) {
blocksPerTeleport = Double.parseDouble(args[3]);
} else {
blocksPerTeleport = 10000.0d;
}
if (args.length >= 3) {
try {
final double x = args[0].equals("~") ? mc.player.posX : args[0].charAt(0) == '~' ? Double.parseDouble(args[0].substring(1)) + mc.player.posX : Double.parseDouble(args[0]);
final double y = args[1].equals("~") ? mc.player.posY : args[1].charAt(0) == '~' ? Double.parseDouble(args[1].substring(1)) + mc.player.posY : Double.parseDouble(args[1]);
final double z = args[2].equals("~") ? mc.player.posZ : args[2].charAt(0) == '~' ? Double.parseDouble(args[2].substring(1)) + mc.player.posZ : Double.parseDouble(args[2]);
finalPos = new Vec3d(x, y, z);
disable = false;
teleport(Wrapper.getMinecraft());
sendChatMessage("\n&aTeleporting to \n&cX: &b" + df.format(x) + "&a, \n&cY: &b" + df.format(y) + "&a, \n&cZ: &b" + df.format(z) + "\n&aat &b" + df.format(blocksPerTeleport) + "&c blocks per teleport.");
} catch (NullPointerException e) {
sendErrorMessage("Null Pointer Exception Caught!");
}
}
}
}