Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
BenchMarkCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
pan4ur committed Jul 31, 2024
1 parent eaa00b2 commit d1adc46
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/main/java/thunder/hack/cmd/impl/BenchMarkCommand.java
Original file line number Diff line number Diff line change
@@ -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<CommandSource> 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;
});
}
}
1 change: 1 addition & 0 deletions src/main/java/thunder/hack/core/impl/CommandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions src/main/java/thunder/hack/modules/combat/AutoCrystal.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d1adc46

Please sign in to comment.