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

Commit

Permalink
clientbase cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
06ED committed Jan 28, 2024
1 parent 55c2ee9 commit ebf38fa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/main/java/thunder/hack/core/impl/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public class ModuleManager implements IManager {
public static FakePlayer fakePlayer = new FakePlayer();
public static ElytraSwap elytraSwap = new ElytraSwap();
public static ElytraPlus elytraPlus = new ElytraPlus();
public static CevBreaker cevBreaker = new CevBreaker();
public static AutoSprint autoSprint = new AutoSprint();
public static AutoGApple autoGApple = new AutoGApple();
public static AntiHunger antiHunger = new AntiHunger();
Expand Down Expand Up @@ -298,9 +297,9 @@ public void onUpdate() {
public void onRender2D(DrawContext context) {
HudElement.anyHovered = false;
modules.stream().filter(Module::isEnabled).forEach(module -> module.onRender2D(context));
if(!HudElement.anyHovered && !ClickUI.anyHovered)
if (!HudElement.anyHovered && !ClickUI.anyHovered)
GLFW.glfwSetCursor(mc.getWindow().getHandle(), GLFW.glfwCreateStandardCursor(GLFW.GLFW_CURSOR_NORMAL));
ThunderHack.core.onRender2D(context);
ThunderHack.CORE.onRender2D(context);
}

public void onRenderShaders(DrawContext context) {
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/thunder/hack/gui/hud/HudElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ChatScreen;
import org.jetbrains.annotations.NotNull;
import thunder.hack.events.impl.EventMouse;
import org.lwjgl.glfw.GLFW;
import thunder.hack.events.impl.client.EventMouse;
import thunder.hack.modules.Module;
import thunder.hack.setting.Setting;
import thunder.hack.setting.impl.PositionSetting;
import thunder.hack.utility.render.Render3DEngine;

public class HudElement extends Module {
private final Setting<PositionSetting> pos = new Setting<>("Position", new PositionSetting(0.5f, 0.5f));

private boolean mouseState = false, mouseButton = false;
private float x, y, dragX, dragY;
private int height, width;
public static boolean anyHovered = false;

public HudElement(String name, int width, int height) {
super(name, Category.HUD);
Expand All @@ -33,6 +36,7 @@ public void onRender2D(DrawContext context) {
pos.getValue().setY((normaliseY() - dragY) / mc.getWindow().getScaledHeight());
}
}

if (mouseButton) {
if (!mouseState && isHovering()) {
dragX = (int) (normaliseX() - (pos.getValue().getX() * mc.getWindow().getScaledWidth()));
Expand All @@ -42,6 +46,11 @@ public void onRender2D(DrawContext context) {
} else {
mouseState = false;
}

if(isHovering()) {
GLFW.glfwSetCursor(mc.getWindow().getHandle(), mouseState ? GLFW.glfwCreateStandardCursor(GLFW.GLFW_CROSSHAIR_CURSOR) : GLFW.glfwCreateStandardCursor(GLFW.GLFW_HAND_CURSOR));
anyHovered = true;
}
}

@EventHandler
Expand Down Expand Up @@ -97,4 +106,4 @@ public float getX() {
public float getY() {
return pos.getValue().y;
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/thunder/hack/modules/player/Regen.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import meteordevelopment.orbit.EventHandler;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import thunder.hack.events.impl.EventSync;
import thunder.hack.events.impl.world.EventSync;
import thunder.hack.modules.Module;
import thunder.hack.setting.Setting;

Expand Down

0 comments on commit ebf38fa

Please sign in to comment.