Skip to content

Commit

Permalink
fix font problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvrwed committed Jan 1, 2025
1 parent 20856c0 commit 529e582
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 127 deletions.
2 changes: 1 addition & 1 deletion src/main/java/cc/unknown/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public ModuleManager() {
new Stealer(),
new FastPlace(),
new LegitScaffold(),
new FastBreak(),
new Sprint(),
new Blink(),
new NoSlow(),
Expand All @@ -69,7 +70,6 @@ public ModuleManager() {
new Ambience(),
new Fullbright(),
new FreeLook(),
new Keystrokes(),
new ClickGui(),
new HUD(),
new CpsDisplay(),
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/cc/unknown/module/impl/combat/AutoClick.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
public class AutoClick extends Module {

private final ModeValue clickMode = new ModeValue("Click Mode", "Left", "Left", "Right", "Both");
private final ModeValue clickStyle = new ModeValue("Click Style", "Normal", "Normal", "Double Click");

private final DoubleSliderValue leftCPS = new DoubleSliderValue("Left Click Speed", 16, 19, 1, 40, 1);
private final BooleanValue weaponOnly = new BooleanValue("Only Use Weapons", false);
Expand All @@ -37,7 +36,7 @@ public class AutoClick extends Module {
private final BooleanValue allowBow = new BooleanValue("Allow Using Bow", true);

public AutoClick() {
this.registerSetting(clickMode, clickStyle, leftCPS, weaponOnly, breakBlocks, hitSelect, hitSelectDistance,
this.registerSetting(clickMode, leftCPS, weaponOnly, breakBlocks, hitSelect, hitSelectDistance,
invClicker, invDelay, rightCPS, onlyBlocks, allowEat, allowBow);
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/cc/unknown/module/impl/exploit/BackTrack.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import net.minecraft.util.Vec3;
import net.minecraftforge.event.world.WorldEvent;

@SuppressWarnings("all")
@ModuleInfo(name = "BackTrack", category = Category.Exploit)
public class BackTrack extends Module {

Expand Down Expand Up @@ -85,7 +86,7 @@ public void onDisable() {
return;

for (TimedPacket packet : packetQueue) {
mc.getNetHandler().getNetworkManager().outboundPacketsQueue.add(new InboundHandlerTuplePacketListener(packet.getPacket(), (GenericFutureListener) null));
mc.getNetHandler().getNetworkManager().outboundPacketsQueue.add(new InboundHandlerTuplePacketListener(packet.getPacket(), null));
}
packetQueue.clear();

Expand Down Expand Up @@ -230,6 +231,7 @@ public void onDisconnect(DisconnectionEvent e) {
}
}

@SuppressWarnings("unchecked")
private void releaseAll() {
if (!packetQueue.isEmpty()) {
packetQueue.forEach(timedPacket -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void onPacket(PacketEvent e) {
C01PacketChatMessage wrapper = (C01PacketChatMessage) e.getPacket();
String message = wrapper.getMessage();
if (!Arrays.stream(new String[]{"/", "!"}).anyMatch(message::startsWith)) {
String m = Arrays.stream(message.split(" ")).map(word -> "y" + word).collect(Collectors.joining(" "));
String m = Arrays.stream(message.split(" ")).map(word -> "i" + word).collect(Collectors.joining(" "));
((IC01PacketChatMessage) wrapper).setMessage(m);
e.setPacket(wrapper);
}
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/cc/unknown/module/impl/other/Tweaks.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package cc.unknown.module.impl.other;

import cc.unknown.event.impl.EventLink;
import cc.unknown.event.impl.other.GameEvent;
import cc.unknown.event.impl.player.TickEvent;
import cc.unknown.module.impl.Module;
import cc.unknown.module.impl.api.Category;
import cc.unknown.module.impl.api.ModuleInfo;
import cc.unknown.module.setting.impl.BooleanValue;
import net.minecraft.util.MovingObjectPosition;

@ModuleInfo(name = "Tweaks", category = Category.Other)
public class Tweaks extends Module {
Expand All @@ -19,9 +21,11 @@ public Tweaks() {
}

@EventLink
public void onClick(TickEvent e) {
public void onClick(GameEvent e) {
if (noClickDelay.isToggled() && this.isEnabled()) {
mc.leftClickCounter = 0;
if (mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
mc.leftClickCounter = 0;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cc/unknown/module/impl/visuals/ClickGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@ModuleInfo(name = "ClickGui", category = Category.Visuals, key = Keyboard.KEY_RSHIFT)
public class ClickGui extends Module {

public ModeValue waifuMode = new ModeValue("Waifu", "Megumin", "Megumin", "Kurumi");
//public ModeValue waifuMode = new ModeValue("Waifu", "Megumin", "Megumin", "Kurumi");
public ModeValue clientTheme = new ModeValue("Color", "Static", "Rainbow", "Pastel", "Memories", "Lilith", "Static", "Cantina");
public ModeValue backGroundMode = new ModeValue("BackGround", "None", "Gradient", "Normal", "None");
public SliderValue clickGuiColor = new SliderValue("ClickGui Color [H/S/B]", 0, 0, 350, 10);
Expand Down
71 changes: 0 additions & 71 deletions src/main/java/cc/unknown/module/impl/visuals/Keystrokes.java

This file was deleted.

8 changes: 2 additions & 6 deletions src/main/java/cc/unknown/ui/clickgui/raven/ClickGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {

ScaledResolution sr = new ScaledResolution(mc);
ClickGui cg = (ClickGui) Haru.instance.getModuleManager().getModule(ClickGui.class);
ResourceLocation waifuImage = waifuMap.get(cg.waifuMode.getMode().toLowerCase());
//ResourceLocation waifuImage = waifuMap.get(cg.waifuMode.getMode().toLowerCase());

if (cg.backGroundMode.is("Gradient")) {
this.drawGradientRect(0, 0, sr.getScaledWidth(), sr.getScaledHeight(),
Expand All @@ -84,11 +84,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
c.updatePosition(mouseX, mouseY);
c.getModules().forEach(comp -> comp.updateComponent(mouseX, mouseY));
});

if (waifuImage != null) {
RenderUtil.drawImage(waifuImage, sr.getScaledWidth() / 2, sr.getScaledHeight() / 2,
sr.getScaledWidth() / 5.2f, sr.getScaledHeight() / 2f);
}

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import cc.unknown.ui.clickgui.raven.impl.api.Component;
import cc.unknown.ui.clickgui.raven.impl.api.Theme;
import cc.unknown.utils.client.RenderUtil;
import cc.unknown.utils.font.FontUtil;

public class ModuleComp extends Component {
public Module mod;
Expand Down Expand Up @@ -73,10 +72,10 @@ public void renderComponent() {
new Color(102, 102, 102).getRGB();

String moduleName = mod.getModuleInfo().name();
float textX = (float) (x + width / 2 - FontUtil.roboto.getStringWidth(moduleName) / 2);
float textX = (float) (x + width / 2 - mc.fontRendererObj.getStringWidth(moduleName) / 2);
float textY = y + 4;

FontUtil.roboto.drawStringWithShadow(moduleName, textX, textY, buttonColor);
mc.fontRendererObj.drawStringWithShadow(moduleName, textX, textY, buttonColor);

GL11.glPopMatrix();

Expand Down
61 changes: 24 additions & 37 deletions src/main/java/cc/unknown/utils/misc/ClickUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,17 @@ public class ClickUtil implements Loona {
public int getClickDelay() {
AutoClick clicker = (AutoClick) Haru.instance.getModuleManager().getModule(AutoClick.class);

switch (clicker.getClickStyle().getMode()) {
case "Normal":
switch (clicker.getClickMode().getMode()) {
case "Left":
setClickType(clicker.getLeftCPS().getInputMinToInt(), clicker.getLeftCPS().getInputMaxToInt());
break;
case "Right":
setClickType(clicker.getRightCPS().getInputMinToInt(), clicker.getRightCPS().getInputMaxToInt());
break;
case "Both":
setClickType(clicker.getLeftCPS().getInputMinToInt(), clicker.getLeftCPS().getInputMaxToInt());
setClickType(clicker.getRightCPS().getInputMinToInt(), clicker.getRightCPS().getInputMaxToInt());
break;
}
switch (clicker.getClickMode().getMode()) {
case "Left":
setClickType(clicker.getLeftCPS().getInputMinToInt(), clicker.getLeftCPS().getInputMaxToInt());
break;
case "Right":
setClickType(clicker.getRightCPS().getInputMinToInt(), clicker.getRightCPS().getInputMaxToInt());
break;
case "Both":
setClickType(clicker.getLeftCPS().getInputMinToInt(), clicker.getLeftCPS().getInputMaxToInt());
setClickType(clicker.getRightCPS().getInputMinToInt(), clicker.getRightCPS().getInputMaxToInt());
break;

}
return clickDelay;
}
Expand Down Expand Up @@ -92,48 +87,40 @@ public void getLeftClick() {
return;
}

final int doubleClick = clicker.getClickStyle().is("Double Click") ? 1 : 0;

if (Mouse.isButtonDown(0)) {
if (breakBlockLogic() || (clicker.getWeaponOnly().isToggled() && !PlayerUtil.isHoldingWeapon())) {
return;
}

for (int i = 0; i < 1 + doubleClick; i++) {
if (System.currentTimeMillis() - leftLastSwing >= leftDelay) {
leftLastSwing = System.currentTimeMillis();
leftDelay = getClickDelay();
KeyBinding.setKeyBindState(mc.gameSettings.keyBindAttack.getKeyCode(), true);
KeyBinding.onTick(mc.gameSettings.keyBindAttack.getKeyCode());
} else if (leftLastSwing > leftDelay * 1000) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindAttack.getKeyCode(), false);
}
if (System.currentTimeMillis() - leftLastSwing >= leftDelay) {
leftLastSwing = System.currentTimeMillis();
leftDelay = getClickDelay();
KeyBinding.setKeyBindState(mc.gameSettings.keyBindAttack.getKeyCode(), true);
KeyBinding.onTick(mc.gameSettings.keyBindAttack.getKeyCode());
} else if (leftLastSwing > leftDelay * 1000) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindAttack.getKeyCode(), false);
}
}
}

public void getRightClick() {
AutoClick clicker = (AutoClick) Haru.instance.getModuleManager().getModule(AutoClick.class);
Mouse.poll();

if (checkScreen() || !mc.inGameHasFocus)
return;

final int doubleClick = clicker.getClickStyle().is("Double Click") ? 1 : 0;

if (Mouse.isButtonDown(1)) {
if (!rightClickAllowed())
return;

for (int i = 0; i < 1 + doubleClick; i++) {
if (System.currentTimeMillis() - rightLastSwing >= rightDelay) {
rightLastSwing = System.currentTimeMillis();
rightDelay = getClickDelay();
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), true);
KeyBinding.onTick(mc.gameSettings.keyBindUseItem.getKeyCode());
} else if (System.currentTimeMillis() - rightLastSwing > rightDelay * 1000) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false);
}
if (System.currentTimeMillis() - rightLastSwing >= rightDelay) {
rightLastSwing = System.currentTimeMillis();
rightDelay = getClickDelay();
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), true);
KeyBinding.onTick(mc.gameSettings.keyBindUseItem.getKeyCode());
} else if (System.currentTimeMillis() - rightLastSwing > rightDelay * 1000) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false);
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/cc/unknown/utils/misc/HiddenUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import cc.unknown.module.impl.visuals.FreeLook;
import cc.unknown.module.impl.visuals.Fullbright;
import cc.unknown.module.impl.visuals.HUD;
import cc.unknown.module.impl.visuals.Keystrokes;
import cc.unknown.module.impl.visuals.Nametags;
import cc.unknown.module.impl.visuals.Trajectories;

Expand All @@ -45,7 +44,6 @@ public static void setVisible(boolean visible) {
AutoLeave.class,
Autoplay.class,
Inventory.class,
Keystrokes.class,
MidClick.class

);
Expand Down

0 comments on commit 529e582

Please sign in to comment.