fixed bugs, memory leaks, etc

This commit is contained in:
bbldrizzy committed 2026-10-23 08:36:42 +01:00
1 parent aa4f6b6ddc
commit c3f8f23c1d
124 files changed
+1060 -420

No files matched your search

@@ -25,6 +25,10 @@ public class AutoJumpReset extends Module {
@Subscribe
public void onClientTick(ClientTickEvent event) {
if (mc.player == null) {
return;
}
DamageSource damageSource = mc.player.getRecentDamageSource();
if (mc.currentScreen == null
&& !mc.player.isBlocking()
@@ -28,7 +28,7 @@ public class AutoShortPearl extends Module implements RotationProvider {
@Subscribe
public void onPacketReceive(PacketReceiveEvent event) {
if (event.getPacket() instanceof EntityDamageS2CPacket damagePacket) {
if (mc.world != null && mc.player != null && event.getPacket() instanceof EntityDamageS2CPacket damagePacket) {
Entity damagedEntity = mc.world.getEntityById(damagePacket.entityId());
if (damagedEntity == null || damagedEntity != mc.player) {
return;
@@ -45,6 +45,10 @@ public class AutoShortPearl extends Module implements RotationProvider {
@Override
public Rotation provideRotation() {
if (mc.player == null) {
return null;
}
if (this.throwPending) {
if (this.hitTimer.hasElapsed(this.delay.getValue()) && mc.isWindowFocused() && mc.currentScreen == null) {
float throwPitch = 89.0F + RandomUtil.RANDOM.nextFloat() * 2.0F;
@@ -69,6 +73,7 @@ public class AutoShortPearl extends Module implements RotationProvider {
@Override
public void onDisable() {
this.throwPending = false;
Prestige.silentRotationManager.removeRotationProvider(this);
}
}
@@ -11,6 +11,7 @@ import dev.zprestige.prestige.combat.TargetSelector;
import dev.zprestige.prestige.event.PacketReceiveEvent;
import dev.zprestige.prestige.event.PacketSendEvent;
import dev.zprestige.prestige.event.FrameEvent;
import dev.zprestige.prestige.event.GameJoinEvent;
import dev.zprestige.prestige.event.Render3DEvent;
import dev.zprestige.prestige.math.UiMath;
import dev.zprestige.prestige.module.combat.AutoElytra;
@@ -137,6 +138,10 @@ public class FakeLag extends Module {
@Subscribe
public void onFrame(FrameEvent event) {
this.rangeFlushed = false;
if (mc.player == null || mc.world == null) {
return;
}
if (this.mode.getValue().equals("Knockback") && this.knockbackTimer.hasElapsedRandom(this.choke)) {
this.knockbackActive = false;
this.flushPackets();
@@ -173,7 +178,7 @@ public class FakeLag extends Module {
if (this.render.getValue()) {
StopWatch activeTimer = this.knockbackActive ? this.knockbackTimer : this.chokeTimer;
float chokeDuration = this.mode.getValue().equals("Manual") ? 1000.0F : (this.rangeFlushed ? this.rangeChoke.getRolled() : this.choke.getRolled());
if (!(activeTimer.getElapsed() / chokeDuration / 2.0F < 0.1F)) {
if (chokeDuration > 0.0F && !(activeTimer.getElapsed() / chokeDuration / 2.0F < 0.1F)) {
ShapeRenderer.drawGlowRing(event.context, event.renderer, (float)this.lastFlushPos.x, (float)this.lastFlushPos.y, (float)this.lastFlushPos.z, Math.min(0.5F, activeTimer.getElapsed() / chokeDuration / 2.0F), 0.005F, 0.1F, UiMath.withAlpha(UiMath.getAccentColor().brighter(), Math.min(1.0F, activeTimer.getElapsed() / chokeDuration)), UiMath.getAccentColor());
}
}
@@ -188,17 +193,28 @@ public class FakeLag extends Module {
@Override
public void onDisable() {
this.flushPackets();
// packets of an old world must never be replayed into a new one
this.heldPackets.clear();
}
@Subscribe
public void onGameJoin(GameJoinEvent event) {
this.heldPackets.clear();
this.knockbackActive = false;
}
private void flushPackets() {
if (mc.player != null && mc.world != null) {
this.flushing = true;
while (mc.getNetworkHandler() != null && !this.heldPackets.isEmpty()) {
PacketSender.sendPacket((Packet)this.heldPackets.poll());
try {
while (mc.getNetworkHandler() != null && !this.heldPackets.isEmpty()) {
PacketSender.sendPacket((Packet)this.heldPackets.poll());
}
} finally {
this.flushing = false;
}
this.flushing = false;
this.chokeTimer.reset();
this.choke.reroll();
this.lastFlushPos = PositionUtil.getPlayerPos();
@@ -16,6 +16,10 @@ public class FastBridge extends Module {
@Subscribe
public void onClientTick(ClientTickEvent event) {
if (mc.player == null || mc.world == null) {
return;
}
boolean releaseSneak = !(mc.player.getMainHandStack().getItem() instanceof BlockItem) && !(mc.player.getOffHandStack().getItem() instanceof BlockItem);
if (mc.player.getPitch() < 70.0F) {
releaseSneak = true;
@@ -38,4 +42,12 @@ public class FastBridge extends Module {
this.sneakForced = true;
}
}
@Override
public void onDisable() {
if (this.sneakForced) {
mc.options.sneakKey.setPressed(false);
this.sneakForced = false;
}
}
}
@@ -64,7 +64,7 @@ public class Freecam extends Module {
@Subscribe
public void onClientTick(ClientTickEvent event) {
if (mc.currentScreen == null) {
if (mc.player != null && mc.currentScreen == null) {
mc.options.forwardKey.setPressed(false);
mc.options.backKey.setPressed(false);
mc.options.leftKey.setPressed(false);
@@ -153,7 +153,7 @@ public class Freecam extends Module {
@Subscribe
public void onRender3D(Render3DEvent event) {
if (this.renderPrevious.getValue()) {
if (this.renderPrevious.getValue() && mc.player != null) {
float bodyX = (float)this.frozenPos.x;
float bodyY = (float)this.frozenPos.y;
float bodyZ = (float)this.frozenPos.z;
@@ -19,6 +19,10 @@ public class NoJumpDelay extends Module {
@Subscribe
public void onClientTick(ClientTickEvent event) {
if (mc.player == null) {
return;
}
new JumpCooldownAccessor(mc.player).setJumpingCooldown(0);
}
}
@@ -16,7 +16,7 @@ public class Parkour extends Module {
@Subscribe
public void onClientTick(ClientTickEvent event) {
if (mc.player.isOnGround() && !mc.options.jumpKey.isPressed()) {
if (mc.player != null && mc.world != null && mc.player.isOnGround() && !mc.options.jumpKey.isPressed()) {
if (!mc.player.isSneaking() && !mc.options.sneakKey.isPressed()) {
Box edgeBox = mc.player.getBoundingBox().offset(0.0, -0.5, 0.0)
.expand(-this.distance.randomInRange() / 100.0, 0.0, -this.distance.randomInRange() / 100.0);
@@ -44,6 +44,10 @@ public class ShortPearl extends Module implements RotationProvider {
@Override
public Rotation provideRotation() {
if (mc.player == null) {
return null;
}
if (!this.mode.getValue().equals("Silent")) {
return null;
} else if (this.silentThrowAge != -1) {
@@ -73,7 +77,7 @@ public class ShortPearl extends Module implements RotationProvider {
@Subscribe
public void onFrame(FrameEvent event) {
if (this.mode.getValue().equals("Legit")) {
if (mc.player != null && this.mode.getValue().equals("Legit")) {
if (this.stageTimer.hasElapsed(this.minDelay.getValue())) {
switch (this.stage) {
case 0:
@@ -11,7 +11,7 @@ import dev.zprestige.prestige.event.PacketReceiveEvent;
import dev.zprestige.prestige.event.ClientTickEvent;
import dev.zprestige.prestige.event.GameJoinEvent;
import dev.zprestige.prestige.render.RandomUtil;
import java.util.ArrayList;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.Set;
import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket;
@@ -24,7 +24,7 @@ public class Velocity extends Module {
private BoolSetting ignoreExplosions;
private RangeSetting vertical;
private RangeSetting horizontal;
private ArrayList recentExplosions = new ArrayList();
private CopyOnWriteArrayList recentExplosions = new CopyOnWriteArrayList();
@Override
public Set getGamemodes() {
@@ -33,11 +33,9 @@ public class Velocity extends Module {
@Subscribe
public void onClientTick(ClientTickEvent event) {
new ArrayList<>(this.recentExplosions).forEach(explosion -> {
if (mc.player != null && mc.player.isOnGround()) {
this.recentExplosions.remove(((net.minecraft.network.packet.s2c.play.ExplosionS2CPacket)explosion));
}
});
if (mc.player != null && mc.player.isOnGround()) {
this.recentExplosions.clear();
}
}
@Subscribe
@@ -57,6 +55,10 @@ public class Velocity extends Module {
if (event.getPacket() instanceof ExplosionS2CPacket explosionPacket
&& explosionPacket.playerKnockback().isPresent()
&& explosionPacket.playerKnockback().get().lengthSquared() > 0.0) {
if (this.recentExplosions.size() >= 16) {
this.recentExplosions.remove(0);
}
this.recentExplosions.add(explosionPacket);
}
}
@@ -37,7 +37,7 @@ public class WTap extends Module {
public void onAttackEntity(AttackEntityEvent event) {
if (!this.tapPending && !this.forwardReleased) {
Entity target = event.getTarget();
if (target != null) {
if (target != null && mc.player != null) {
if (target instanceof PlayerEntity) {
if (mc.options.forwardKey.isPressed() && mc.player.isSprinting() && RandomUtil.RANDOM.nextFloat() * 100.0F <= this.chance.getValue()) {
this.reaction.reroll();
@@ -77,6 +77,12 @@ public class WTap extends Module {
}
}
@Override
public void onDisable() {
this.tapPending = false;
this.forwardReleased = false;
}
public boolean isTapPending() {
return this.tapPending;
}