This repository has been archived by the owner on Nov 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pan4ur
committed
Jul 31, 2024
1 parent
eaa00b2
commit d1adc46
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters