diff --git a/src/main/java/thunder/hack/cmd/impl/BenchMarkCommand.java b/src/main/java/thunder/hack/cmd/impl/BenchMarkCommand.java new file mode 100644 index 00000000..aeca6790 --- /dev/null +++ b/src/main/java/thunder/hack/cmd/impl/BenchMarkCommand.java @@ -0,0 +1,45 @@ +package thunder.hack.cmd.impl; + +import com.mojang.brigadier.builder.LiteralArgumentBuilder; +import net.minecraft.command.CommandSource; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.PotionContentsComponent; +import net.minecraft.util.Formatting; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import thunder.hack.cmd.Command; +import thunder.hack.utility.math.ExplosionUtility; + +import static com.mojang.brigadier.Command.SINGLE_SUCCESS; +import static thunder.hack.modules.client.ClientSettings.isRu; + +public class BenchMarkCommand extends Command { + public BenchMarkCommand() { + super("benchmark"); + } + + @Override + public void executeBuild(LiteralArgumentBuilder builder) { + builder.executes(context -> { + + new Thread(() -> { + long time = System.currentTimeMillis(); + + BlockPos playerPos = BlockPos.ofFloored(mc.player.getPos()); + int r = 6; + + for (int x = playerPos.getX() - r; x <= playerPos.getX() + r; x++) + for (int y = playerPos.getY() - r; y <= playerPos.getY() + r; y++) + for (int z = playerPos.getZ() - r; z <= playerPos.getZ() + r; z++) { + float dmg = ExplosionUtility.getExplosionDamage(new Vec3d(x, y, z), mc.player, false); + } + + time = System.currentTimeMillis() - time; + int score = (int) ((216f / (float) time) * 10000); + sendMessage((isRu() ? "Твой CPU набрал: " : "Your CPU score: ") + Formatting.GRAY + score); + }).start(); + + return SINGLE_SUCCESS; + }); + } +} diff --git a/src/main/java/thunder/hack/core/impl/CommandManager.java b/src/main/java/thunder/hack/core/impl/CommandManager.java index 0d8249ce..40eed74b 100644 --- a/src/main/java/thunder/hack/core/impl/CommandManager.java +++ b/src/main/java/thunder/hack/core/impl/CommandManager.java @@ -48,6 +48,7 @@ public CommandManager() { add(new WayPointCommand()); add(new TabParseCommand()); add(new BlockESPCommand()); + add(new BenchMarkCommand()); add(new HorseSpeedCommand()); add(new OpenFolderCommand()); add(new ResetBindsCommand()); diff --git a/src/main/java/thunder/hack/modules/combat/AutoCrystal.java b/src/main/java/thunder/hack/modules/combat/AutoCrystal.java index 8458f86a..3920df15 100644 --- a/src/main/java/thunder/hack/modules/combat/AutoCrystal.java +++ b/src/main/java/thunder/hack/modules/combat/AutoCrystal.java @@ -348,6 +348,7 @@ public void onPacketReceive(PacketEvent.Receive e) { for (BlockPos bp : cache.keySet()) if (cr.squaredDistanceTo(bp.toCenterPos()) < 0.3) { confirmTime = System.currentTimeMillis() - cache.get(bp); + ModuleManager.autoCrystalInfo.addSpeed((int) (1000f / (float) confirmTime)); placedCrystals.remove(bp); if (breakTimer.passedTicks(facePlacing ? lowBreakDelay.getValue() : breakDelay.getValue())) handleSpawn(cr);