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

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pan4ur committed Aug 3, 2024
1 parent aac4421 commit a260539
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
33 changes: 21 additions & 12 deletions src/main/java/thunder/hack/modules/combat/AutoCrystal.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public class AutoCrystal extends Module {
private PlaceData currentData;
private BlockHitResult bestPosition;
private EndCrystalEntity bestCrystal;
private EndCrystalEntity secondaryCrystal;

private final TickTimer placeTimer = new TickTimer();
private final TickTimer breakTimer = new TickTimer();
Expand Down Expand Up @@ -870,6 +871,15 @@ public void getCrystalToExplode() {
return;
}

if (secondaryCrystal != null) {
if (canAttackCrystal(secondaryCrystal)) {
bestCrystal = secondaryCrystal;
debug("secondary crystal accepted");
} else debug("secondary crystal declined");
secondaryCrystal = null;
return;
}

List<CrystalData> list = getPossibleCrystals(target).stream().filter(data -> isSafe(data.damage, data.selfDamage, data.overrideDamage)).toList();
bestCrystal = list.isEmpty() ? null : filterCrystals(list);
}
Expand Down Expand Up @@ -1047,8 +1057,9 @@ public boolean checkEntities(@NotNull BlockPos base) {
if (ent instanceof ItemEntity && ent.age < 3)
continue;

if (ent instanceof EndCrystalEntity cr && canAttackCrystal(cr))
if (ent instanceof EndCrystalEntity cr && (canAttackCrystal(cr) || deadManager.isDead(cr.getId())))
continue;

return true;
}
}
Expand All @@ -1066,21 +1077,19 @@ private boolean checkOtherEntities(Box posBoundingBox) {
if (ent instanceof ExperienceOrbEntity)
continue;

if (ent instanceof EndCrystalEntity cr && deadManager.isDead(cr.getId()))
continue;
if (ent instanceof EndCrystalEntity cr) {
if (deadManager.isDead(cr.getId()))
continue;

if (cr.getPos().squaredDistanceTo(posBoundingBox.getCenter()) > 0.3) {
secondaryCrystal = cr;
debug("secondary crystal created");
}
}

if (ent instanceof ItemEntity && ent.age < 3)
continue;
/*
if (breakTimer.passedTicks(facePlacing ? lowBreakDelay.getValue() : breakDelay.getValue()) && ent instanceof EndCrystalEntity cr
&& canAttackCrystal(cr, true)
&& cr.getPos().squaredDistanceTo(posBoundingBox.getCenter()) > 0.3) {
//attackCrystal(cr);
debug("attack stuck crystal");
return true;
}

*/
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/thunder/hack/modules/render/ESP.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void onRender3D(MatrixStack stack) {

if (burrow.getValue()) {
for (PlayerEntity pl : mc.world.getPlayers()) {
BlockPos blockPos = BlockPos.ofFloored(pl.getPos());
BlockPos blockPos = BlockPos.ofFloored(pl.getPos().add(0,0.15f,0));
Block block = mc.world.getBlockState(blockPos).getBlock();

double x = blockPos.getX() - mc.getEntityRenderDispatcher().camera.getPos().getX();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public void use() {
GL30.glBlitFramebuffer(0, 0, buffer.textureWidth, buffer.textureHeight, 0, 0, buffer.textureWidth, buffer.textureHeight, GL30.GL_COLOR_BUFFER_BIT, GL30.GL_LINEAR);
buffer.beginWrite(false);

if (input != null && (input.textureWidth != mc.getWindow().getFramebufferWidth() || input.textureHeight != mc.getWindow().getFramebufferHeight()))
input.resize(mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight(), MinecraftClient.IS_SYSTEM_MAC);

inputResolution.set((float) buffer.textureWidth, (float) buffer.textureHeight);
sampler.set(input.getColorAttachment());

Expand Down

0 comments on commit a260539

Please sign in to comment.