Skip to content
This repository has been archived by the owner on Oct 9, 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 May 2, 2024
1 parent 85e9773 commit 2e61092
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/main/java/thunder/hack/core/impl/PlayerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class PlayerManager implements IManager {
// Юзать везде!
public boolean inInventory;

@EventHandler
@EventHandler(priority = EventPriority.HIGHEST)
public void onSync(EventSync event) {
if (Module.fullNullCheck()) return;

Expand Down
32 changes: 17 additions & 15 deletions src/main/java/thunder/hack/gui/hud/HudEditorGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.text.Text;
import org.lwjgl.glfw.GLFW;
import thunder.hack.ThunderHack;
import thunder.hack.core.impl.ModuleManager;
import thunder.hack.gui.clickui.AbstractWindow;
import thunder.hack.gui.clickui.ClickGUI;
import thunder.hack.gui.clickui.ModuleWindow;
Expand Down Expand Up @@ -47,22 +48,23 @@ protected void init() {
@Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
ClickGUI.anyHovered = false;
for (AbstractWindow window : windows) {
if (InputUtil.isKeyPressed(mc.getWindow().getHandle(), InputUtil.GLFW_KEY_DOWN)) {
window.setY(window.getY() + 2);
}
if (InputUtil.isKeyPressed(mc.getWindow().getHandle(), InputUtil.GLFW_KEY_UP)) {
window.setY(window.getY() - 2);
}
if (InputUtil.isKeyPressed(mc.getWindow().getHandle(), InputUtil.GLFW_KEY_RIGHT)) {
window.setX(window.getX() + 2);
}
if (InputUtil.isKeyPressed(mc.getWindow().getHandle(), InputUtil.GLFW_KEY_LEFT)) {
window.setX(window.getX() - 2);
}

if (dWheel != 0) window.setY((float) (window.getY() + dWheel));
}
if (ModuleManager.clickGui.scrollMode.getValue() == ClickGui.scrollModeEn.Old) {
for (AbstractWindow window : windows) {
if (InputUtil.isKeyPressed(mc.getWindow().getHandle(), 264))
window.setY(window.getY() + 2);
if (InputUtil.isKeyPressed(mc.getWindow().getHandle(), 265))
window.setY(window.getY() - 2);
if (InputUtil.isKeyPressed(mc.getWindow().getHandle(), 262))
window.setX(window.getX() + 2);
if (InputUtil.isKeyPressed(mc.getWindow().getHandle(), 263))
window.setX(window.getX() - 2);
if (dWheel != 0)
window.setY((float) (window.getY() + dWheel));
}
} else for (AbstractWindow window : windows)
if (dWheel != 0)
window.setModuleOffset((float) dWheel, mouseX, mouseY);

dWheel = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class MixinBlockCollisionSpliterator {
// я надеюсь это никто не будет редиректить
@Redirect(method = "computeNext", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/BlockView;getBlockState(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/block/BlockState;"))
private BlockState computeNextHook(BlockView instance, BlockPos blockPos) {
if(!ModuleManager.antiWeb.isEnabled() && !ModuleManager.phase.isEnabled())
if(!ModuleManager.antiWeb.isEnabled() && !ModuleManager.phase.isEnabled() && !ModuleManager.jesus.isEnabled())
return instance.getBlockState(blockPos);
EventCollision event = new EventCollision(instance.getBlockState(blockPos), blockPos);
ThunderHack.EVENT_BUS.post(event);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/thunder/hack/modules/player/AntiAim.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public enum Mode {None, RandomAngle, Spin, Sinus, Fixed, Static}

private float rotationYaw, rotationPitch, pitch_sinus_step, yaw_sinus_step;

@EventHandler(priority = EventPriority.HIGH)
@EventHandler(priority = 99)
public void onSync(EventSync e) {
if(allowInteract.getValue() && (mc.options.attackKey.isPressed() || mc.options.attackKey.isPressed())) return;
double gcdFix = (Math.pow(mc.options.getMouseSensitivity().getValue() * 0.6 + 0.2, 3.0)) * 1.2;
Expand Down
43 changes: 30 additions & 13 deletions src/main/java/thunder/hack/modules/render/HitParticles.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import thunder.hack.setting.Setting;
import thunder.hack.setting.impl.ColorSetting;
import thunder.hack.utility.math.MathUtility;
import thunder.hack.utility.render.Render2DEngine;
import thunder.hack.utility.render.animation.AnimationUtility;

import java.awt.*;
Expand Down Expand Up @@ -47,7 +48,7 @@ public HitParticles() {

@Override
public void onUpdate() {
particles.removeIf(particle -> System.currentTimeMillis() - particle.getTime() > lifeTime.getValue() * 1000);
particles.removeIf(Particle::update);

if (mode.is(Mode.Text)) {
for (Entity entity : mc.world.getEntities()) {
Expand Down Expand Up @@ -92,6 +93,11 @@ public class Particle {
float x;
float y;
float z;

float px;
float py;
float pz;

float motionX;
float motionY;
float motionZ;
Expand All @@ -107,6 +113,9 @@ public Particle(float x, float y, float z, Color color, float rotationAngle, flo
this.x = x;
this.y = y;
this.z = z;
px = x;
py = y;
pz = z;
motionX = MathUtility.random(-(float) speed.getValue() / 100f, (float) speed.getValue() / 100f);
motionY = MathUtility.random(-(float) speed.getValue() / 100f, (float) speed.getValue() / 100f);
motionZ = MathUtility.random(-(float) speed.getValue() / 100f, (float) speed.getValue() / 100f);
Expand All @@ -121,14 +130,20 @@ public long getTime() {
return time;
}

public void update() {
public boolean update() {
double sp = Math.sqrt(motionX * motionX + motionZ * motionZ);
px = x;
py = y;
pz = z;

x += motionX;
y += motionY;
z += motionZ;

if (posBlock(x, y - starsScale.getValue() / 10f, z)) {
motionY = -motionY / 1.1f;
motionX = motionX / 1.1f;
motionZ = motionZ / 1.1f;
} else {
if (posBlock(x - sp, y, z - sp)
|| posBlock(x + sp, y, z + sp)
Expand All @@ -142,24 +157,25 @@ public void update() {
motionX = -motionX;
motionZ = -motionZ;
}
motionY = 0;
}

if (physics.getValue() == Physics.Fall) motionY -= 0.0005f;
if (physics.getValue() == Physics.Fall)
motionY -= 0.035f;

motionX /= 1.005f;
motionZ /= 1.005f;
motionY /= 1.005f;

return System.currentTimeMillis() - getTime() > lifeTime.getValue() * 1000;
}

public void render(MatrixStack matrixStack) {
update();

float size = starsScale.getValue();
float scale = mode.is(Mode.Text) ? 0.025f * size : 0.07f;

final double posX = x - mc.getEntityRenderDispatcher().camera.getPos().getX();
final double posY = y + 0.1 - mc.getEntityRenderDispatcher().camera.getPos().getY();
final double posZ = z - mc.getEntityRenderDispatcher().camera.getPos().getZ();
final double posX = Render2DEngine.interpolate(px, x, mc.getTickDelta()) - mc.getEntityRenderDispatcher().camera.getPos().getX();
final double posY = Render2DEngine.interpolate(py, y, mc.getTickDelta()) + 0.1 - mc.getEntityRenderDispatcher().camera.getPos().getY();
final double posZ = Render2DEngine.interpolate(pz, z, mc.getTickDelta()) - mc.getEntityRenderDispatcher().camera.getPos().getZ();

matrixStack.push();
matrixStack.translate(posX, posY, posZ);
Expand All @@ -179,12 +195,13 @@ public void render(MatrixStack matrixStack) {

switch (mode.getValue()) {
case Orbiz -> {
drawOrbiz(matrixStack, 0.0f, 0.7, color);
drawOrbiz(matrixStack, 0.1f, 1.4, color);
drawOrbiz(matrixStack, 0.2f, 2.3, color);
drawOrbiz(matrixStack, 0.0f, 0.5, color);
drawOrbiz(matrixStack, -0.1f, 1.1, color);
drawOrbiz(matrixStack, -0.2f, 1.5, color);
}
case Stars -> drawStar(matrixStack, color, size);
case Hearts -> drawHeart(matrixStack, color, size);
case Bloom -> drawBloom(matrixStack, color, size);
case Text ->
FontRenderers.sf_medium.drawCenteredString(matrixStack, MathUtility.round2(health) + " ", 0, 0, (health > 0 ? colorH.getValue() : colorD.getValue()).getColorObject());
}
Expand All @@ -204,7 +221,7 @@ public enum Physics {
}

public enum Mode {
Orbiz, Stars, Hearts, Text
Orbiz, Stars, Hearts, Bloom, Text
}

public enum ColorMode {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/thunder/hack/utility/render/Render2DEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,16 @@ public static void drawHeart(MatrixStack matrices, Color c, float scale) {
endRender();
}

public static void drawBloom(MatrixStack matrices, Color c, float scale) {
setupRender();
RenderSystem.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE);
RenderSystem.setShaderTexture(0, firefly);
RenderSystem.setShaderColor(c.getRed() / 255f, c.getGreen() / 255f, c.getBlue() / 255f, c.getAlpha() / 255f);
Render2DEngine.renderGradientTexture(matrices, 0, 0, scale, scale, 0, 0, 128, 128, 128, 128,
HudEditor.getColor(270), HudEditor.getColor(0), HudEditor.getColor(180), HudEditor.getColor(90));
endRender();
}

public static void drawBubble(MatrixStack matrices, float angle, float factor) {
setupRender();
RenderSystem.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE);
Expand Down

0 comments on commit 2e61092

Please sign in to comment.