From ec185b324c2cf856a4d84f0e7281891621385a03 Mon Sep 17 00:00:00 2001 From: tanishisherewithhh <120117618+tanishisherewithhh@users.noreply.github.com> Date: Sat, 11 Mar 2023 12:00:29 +0530 Subject: [PATCH] 2.4.1 (#5) * Delete src/main directory * Autoclicker --- build.gradle | 7 - gradle.properties | 2 +- .../java/net/fabricmc/smphack/HUDoverlay.java | 197 +++--------- .../smphack/Hacks/AntiHunger/AntiHunger.java | 79 +++++ .../smphack/Hacks/AutoSprint/AutoSprint.java | 21 ++ .../Hacks/Autoclicker/Autoclicker.java | 119 ++++++++ .../Hacks/CrystalAura/EndCrystalBreaker.java | 1 + .../net/fabricmc/smphack/Hacks/Fly/Fly.java | 3 + .../fabricmc/smphack/Hacks/Jesus/Jesusm.java | 1 + .../fabricmc/smphack/Hacks/Jesus/jesus.java | 3 +- .../smphack/Hacks/Killaura/KillAura.java | 1 + .../smphack/Hacks/NoWeather/NoWeather.java | 1 + .../fabricmc/smphack/Hacks/Nofall/Nofall.java | 2 + .../fabricmc/smphack/Hacks/Reach/Reach.java | 4 +- .../fabricmc/smphack/Hacks/Speed/Speed.java | 1 + .../smphack/Hacks/SpeedMine/SpeedMine.java | 1 + .../smphack/Hacks/fullbright/Fullbright.java | 1 + .../java/net/fabricmc/smphack/MainGui.java | 5 +- .../java/net/fabricmc/smphack/MainHack.java | 2 +- .../smphack/RGBtext/CharacterMode.java | 86 ++++-- .../smphack/config/ControllersConfig.java | 67 +++++ .../smphack/config/ModMenuIntegration.java | 56 +++- .../java/net/fabricmc/smphack/rendertext.java | 284 ++++++++++++++++++ 23 files changed, 745 insertions(+), 199 deletions(-) create mode 100644 src/main/java/net/fabricmc/smphack/Hacks/AntiHunger/AntiHunger.java create mode 100644 src/main/java/net/fabricmc/smphack/Hacks/AutoSprint/AutoSprint.java create mode 100644 src/main/java/net/fabricmc/smphack/Hacks/Autoclicker/Autoclicker.java create mode 100644 src/main/java/net/fabricmc/smphack/rendertext.java diff --git a/build.gradle b/build.gradle index 5c05269..f725350 100644 --- a/build.gradle +++ b/build.gradle @@ -14,12 +14,6 @@ repositories { // You should only use this when depending on other mods because // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. // See https://docs.gradle.org/current/userguide/declaring_repositories.html - maven { - url "https://maven.jamieswhiteshirt.com/libs-release" - content { - includeGroup "com.jamieswhiteshirt" - } - } maven { url "https://maven.shedaniel.me/" } maven { url "https://maven.terraformersmc.com/releases/" } } @@ -35,7 +29,6 @@ dependencies { // Mod Menu modApi "com.terraformersmc:modmenu:5.0.2" - include modImplementation("com.jamieswhiteshirt:reach-entity-attributes:2.3.1") // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" diff --git a/gradle.properties b/gradle.properties index 404b2c7..9081b19 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ org.gradle.parallel=true loader_version=0.14.13 # Mod Properties - mod_version = 2.4.0 + mod_version = 2.4.1 maven_group = net.smphack archives_base_name = smp-hack diff --git a/src/main/java/net/fabricmc/smphack/HUDoverlay.java b/src/main/java/net/fabricmc/smphack/HUDoverlay.java index 4c39ff4..0e664f8 100644 --- a/src/main/java/net/fabricmc/smphack/HUDoverlay.java +++ b/src/main/java/net/fabricmc/smphack/HUDoverlay.java @@ -4,32 +4,26 @@ import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; +import net.fabricmc.smphack.Hacks.AntiHunger.AntiHunger; +import net.fabricmc.smphack.Hacks.AutoSprint.AutoSprint; +import net.fabricmc.smphack.Hacks.Autoclicker.Autoclicker; import net.fabricmc.smphack.Hacks.CrystalAura.EndCrystalBreaker; import net.fabricmc.smphack.Hacks.Fly.Fly; -import net.fabricmc.smphack.Hacks.Fly.Flymodes; -import net.fabricmc.smphack.Hacks.Jesus.Jesusm; import net.fabricmc.smphack.Hacks.Jesus.jesus; import net.fabricmc.smphack.Hacks.Killaura.KillAura; -import net.fabricmc.smphack.Hacks.NoWeather.NoWeather; import net.fabricmc.smphack.Hacks.Nofall.Nofall; import net.fabricmc.smphack.Hacks.Reach.Reach; import net.fabricmc.smphack.Hacks.Speed.Speed; -import net.fabricmc.smphack.Hacks.SpeedMine.SpeedMine; -import net.fabricmc.smphack.Hacks.fullbright.Fullbright; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; -import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.text.Text; import net.minecraft.util.Formatting; import org.lwjgl.glfw.GLFW; - // I know no one is gonna check the source code but for the few people who do and might need help, I am glad for you; // This shit took me much time. I didnt know How the fuck do you even use keybinds and what onHudRender was. Heck I didnt even know what is the main class of fabric is. Bruh. // This is not supposed to be a full on hack client @@ -37,25 +31,22 @@ @Environment(EnvType.CLIENT) public class HUDoverlay implements HudRenderCallback { - - //new object from ___ class Fly fly = new Fly(); Nofall noFall = new Nofall(); - Jesusm jesus = new Jesusm(); Speed speed = new Speed(); - jesus jes = new jesus(); - Fullbright fullbright = new Fullbright(); - SpeedMine speedmine= new SpeedMine(); - NoWeather noWeather=new NoWeather(); + public static jesus jes = new jesus(); + Autoclicker autoclicker=new Autoclicker(); EndCrystalBreaker endCrystalBreaker = new EndCrystalBreaker(); KillAura killAura = new KillAura(); Reach reach= new Reach(); + AutoSprint autoSprint = new AutoSprint(); + AntiHunger antiHunger=new AntiHunger(); + rendertext text = new rendertext(); + + float prevRainGradient; int tw = 10; int th = 10; - boolean Fullbright; - boolean NoWeather; - public static final KeyBinding FlyKey = KeyBindingHelper.registerKeyBinding(new KeyBinding( "Fly toggle", InputUtil.Type.KEYSYM, @@ -104,7 +95,15 @@ public class HUDoverlay implements HudRenderCallback { "Imperials" )); + public static final KeyBinding AutoClickerKey = KeyBindingHelper.registerKeyBinding(new KeyBinding( + "AutoClicker for autocrystal", + InputUtil.Type.KEYSYM, + GLFW.GLFW_KEY_UNKNOWN, + "Imperials" + )); + MinecraftClient mc = MinecraftClient.getInstance(); + @Override public void onHudRender(MatrixStack matrices, float tickDelta) { //To avoid stupid crashes @@ -125,147 +124,27 @@ public void onHudRender(MatrixStack matrices, float tickDelta) { TextRenderer font = mc.textRenderer; ClientPlayerEntity player= MinecraftClient.getInstance().player; if(font==null || player==null){return;} - - int alpha = 127; - int blue = 0; - - int color = (alpha << 24) | (0) | blue; - - Screen.fill(matrices,5,76,20,76, color); - - - //To Check if Flykey is pressed - //Useless brackets in order to seperate the different mods - if (FlyKey.wasPressed()) { - fly.toggled(); - } - - //To get fly mode - Flymodes flymode = Flymodes.values()[fly.flybindcounter % Flymodes.values().length]; - String flymodeText = flymode.name().toUpperCase(); - Text text = Text.of("Fly [" + flymodeText + "]"); - - //To check if enabled or disabled - if (fly.enabled) { - fly.update(); - flymode.fly(); - //render [on] - font.draw(matrices, text, tw+2, th + 12, Formatting.GREEN.getColorValue()); - } else { - //render [off] - font.draw(matrices, text, tw+2, th + 12, Formatting.RED.getColorValue()); - //player.sendMessage(Text.of("Fly Off")); - } - - // - { - if (Nofallkey.wasPressed()) { - noFall.toggled(); - } - if (noFall.enabled) { - noFall.update(); - //render [on] - font.draw(matrices, "Nofall", tw, th + 48, Formatting.GREEN.getColorValue()); - } else { - //render [off] - font.draw(matrices, "Nofall", tw, th + 48, Formatting.RED.getColorValue()); - //player.sendMessage(Text.of("Nofall Off")); - } - } - // - { - if(Jesuskey.wasPressed()) { - jesus.toggled(); - } - if (jesus.enabled) { - jes.update(); - font.draw(matrices, "Jesus", tw, th + 36, Formatting.GREEN.getColorValue()); - } else { - font.draw(matrices, "Jesus", tw, th + 36, Formatting.RED.getColorValue()); - } - } - - if(SpeedKey.wasPressed()) - { - speed.toggled(); - } - if(speed.enabled) - { - speed.update(); - font.draw(matrices, "Speed", tw+1, th + 24, Formatting.GREEN.getColorValue()); - } - else - { - font.draw(matrices, "Speed", tw+1, th + 24, Formatting.RED.getColorValue()); - assert mc.player != null; - mc.player.getAbilities().setWalkSpeed(speed.walkspeed); - } - Fullbright= GeneralConfig.getConfig().Fullbright; - if(Fullbright) - {fullbright.update();} - else - {mc.player.removeStatusEffect(StatusEffects.NIGHT_VISION);} - - if (GeneralConfig.enabled) - { - font.draw(matrices, "Freecam", tw , th + 60, Formatting.GREEN.getColorValue()); - } - if (!GeneralConfig.enabled) - { - font.draw(matrices, "Freecam", tw , th + 60, Formatting.RED.getColorValue()); - } - - speedmine.toggled(); - - NoWeather= GeneralConfig.getConfig().NoWeather; - if (NoWeather) - { - noWeather.update(); - } - else - { - if(MinecraftClient.getInstance().world.isRaining()) { - MinecraftClient.getInstance().world.setRainGradient(0); - } - } - - if (AutoCrystalBreakerKey.wasPressed()) - { - endCrystalBreaker.toggled(); - } - if (endCrystalBreaker.enabled) { - font.draw(matrices, "AutoCrystal", tw , th + 72, Formatting.GREEN.getColorValue()); - } - else { - font.draw(matrices, "AutoCrystal", tw , th + 72, Formatting.RED.getColorValue()); - } - - if (KillauraKey.wasPressed()) - { - killAura.toggled(); - } - if (killAura.enabled) { - font.draw(matrices, "KillAura", tw , th + 84, Formatting.GREEN.getColorValue()); - } - else { - font.draw(matrices, "KillAura", tw , th + 84, Formatting.RED.getColorValue()); - } - - if (ReachKey.wasPressed()) - { - reach.toggled(); - } - if (reach.enabled) - { - font.draw(matrices, "Reach", tw , th + 96, Formatting.GREEN.getColorValue()); - } - else - { - font.draw(matrices, "Reach", tw , th + 96, Formatting.RED.getColorValue()); - } - - + text.run(); + + text.renderFreecam(matrices,tw,th,font); + text.renderFlyMode(matrices,tw,th,font,fly); + text.renderJesus(matrices,tw,th,font,jes); + text.renderNofall(matrices,tw,th,font,noFall); + text.renderReach(matrices,tw,th,reach,font); + text.renderAutoCrystalBreaker(matrices,tw,th,font,endCrystalBreaker); + text.renderKillAura(matrices,tw,th,font,killAura); + text.renderSpeed(matrices,tw,th,font,speed); + text.renderAutoClicker(matrices,tw,th,font); + + + text.AutoSprint(autoSprint); + text.AntiHunger(antiHunger); + text.AutoClicker(autoclicker); + text.NoWeather(); + text.Fullbright(); } } + + } diff --git a/src/main/java/net/fabricmc/smphack/Hacks/AntiHunger/AntiHunger.java b/src/main/java/net/fabricmc/smphack/Hacks/AntiHunger/AntiHunger.java new file mode 100644 index 0000000..e86b82b --- /dev/null +++ b/src/main/java/net/fabricmc/smphack/Hacks/AntiHunger/AntiHunger.java @@ -0,0 +1,79 @@ +package net.fabricmc.smphack.Hacks.AntiHunger; + +import net.fabricmc.smphack.GeneralConfig; +import net.fabricmc.smphack.MainGui; +import net.minecraft.client.MinecraftClient; +import net.minecraft.network.Packet; +import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; + +import java.util.Objects; + +public class AntiHunger extends MainGui { + + private MinecraftClient mc = MinecraftClient.getInstance(); + private int sprintTick = 0; + private boolean isSprinting = false; + private int walkTick = 0; + private boolean isWalking = false; + boolean AntiHunger; + + @Override + public void toggled() + { + AntiHunger= GeneralConfig.getConfig().getAntiHunger(); + if (AntiHunger) + { + update(); + } + + } + + + @Override + public void update() { + if (mc.player == null) return; + + // check if the player is sprinting + if (mc.options.forwardKey.isPressed() && !mc.player.isSprinting() && mc.player.getHungerManager().getFoodLevel() > 6) { + // send player start sprinting packet + sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING)); + sprintTick = 0; + isSprinting = true; + } else if (mc.player.isSprinting()) { + sprintTick++; + if (sprintTick >= 10) { + // slow down hunger every 10 ticks while sprinting + mc.player.getHungerManager().addExhaustion(0.06f); + sprintTick = 0; + } + if (!mc.options.forwardKey.isPressed() || mc.player.getHungerManager().getFoodLevel() <= 6) { + // send player stop sprinting packet + sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.STOP_SPRINTING)); + isSprinting = false; + } + } + + // check if the player is walking + if ((mc.options.forwardKey.isPressed() || mc.options.leftKey.isPressed() || mc.options.rightKey.isPressed() || mc.options.backKey.isPressed()) + && !mc.player.isSprinting() && mc.player.getHungerManager().getFoodLevel() > 6) { + walkTick = 0; + isWalking = true; + } else if (isWalking) { + walkTick++; + if (walkTick >= 40) { + // slow down hunger every 40 ticks while walking + mc.player.getHungerManager().addExhaustion(0.06f); + walkTick = 0; + } + if (!mc.options.forwardKey.isPressed() && !mc.options.leftKey.isPressed() && !mc.options.rightKey.isPressed() && !mc.options.backKey.isPressed() + || mc.player.getHungerManager().getFoodLevel() <= 6) { + isWalking = false; + } + } + } + + private void sendPacket(Packet packet) { + Objects.requireNonNull(mc.getNetworkHandler()).sendPacket(packet); + } +} + diff --git a/src/main/java/net/fabricmc/smphack/Hacks/AutoSprint/AutoSprint.java b/src/main/java/net/fabricmc/smphack/Hacks/AutoSprint/AutoSprint.java new file mode 100644 index 0000000..9569c91 --- /dev/null +++ b/src/main/java/net/fabricmc/smphack/Hacks/AutoSprint/AutoSprint.java @@ -0,0 +1,21 @@ +package net.fabricmc.smphack.Hacks.AutoSprint; + +import net.fabricmc.smphack.GeneralConfig; +import net.fabricmc.smphack.MainGui; +import net.minecraft.client.MinecraftClient; +import net.minecraft.entity.Entity; + +public class AutoSprint extends MainGui { + + MinecraftClient mc = MinecraftClient.getInstance(); + boolean AutoSprint; + + + @Override + public void update() { + AutoSprint= GeneralConfig.getConfig().getAutoSprint(); + assert mc.player != null; + Entity e = mc.player.getRootVehicle(); + e.setSprinting(AutoSprint); + } +} diff --git a/src/main/java/net/fabricmc/smphack/Hacks/Autoclicker/Autoclicker.java b/src/main/java/net/fabricmc/smphack/Hacks/Autoclicker/Autoclicker.java new file mode 100644 index 0000000..1d214ad --- /dev/null +++ b/src/main/java/net/fabricmc/smphack/Hacks/Autoclicker/Autoclicker.java @@ -0,0 +1,119 @@ +package net.fabricmc.smphack.Hacks.Autoclicker; + +import net.fabricmc.smphack.GeneralConfig; +import net.fabricmc.smphack.MainGui; +import net.fabricmc.smphack.config.ConfigUtil; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.option.KeyBinding; +import net.minecraft.client.util.InputUtil; +import org.lwjgl.glfw.GLFW; + +import java.util.Objects; + +import static net.fabricmc.smphack.HUDoverlay.AutoClickerKey; + +public class Autoclicker extends MainGui { + + +String Button; +String MouseButton; +boolean mouse; +public static int delay; +public static boolean isAutoclickerOn=false; +public static boolean Autoclicker; + +private static int i = 0; + + @Override + public void toggled() { + super.toggled(); + } + + @Override + public void update() { + Button = String.valueOf(ConfigUtil.config.ButtonAuto); + MouseButton = String.valueOf(ConfigUtil.config.MouseKeybindButton); + mouse = GeneralConfig.getConfig().getMouseButton(); + Autoclicker=GeneralConfig.getConfig().getAutoClicker(); + isAutoclickerOn=false; + assert GeneralConfig.getConfig() != null; + delay = GeneralConfig.getConfig().getDelayAC(); + if (Autoclicker) { + if (mouse) { + if (Objects.equals(MouseButton, "RightButton")) { + if (MinecraftClient.getInstance().options.useKey.isPressed()) { + assert MinecraftClient.getInstance().player != null; + isAutoclickerOn = true; + { + if (i < delay) i++; + else { + if (Objects.equals(Button, "LeftMButton")) { + KeyBinding.onKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_1)); + //KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_1),false); + //KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_1),true); + + } + if (Objects.equals(Button, "RightMButton")) { + KeyBinding.onKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_2)); + // KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_2),false); + //KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_2),true); + + } + i = 0; + } + } + } + } + if (Objects.equals(MouseButton, "LeftButton")) { + if (MinecraftClient.getInstance().options.attackKey.isPressed()) { + assert MinecraftClient.getInstance().player != null; + isAutoclickerOn = true; + { + if (i < delay) i++; + else { + if (Objects.equals(Button, "LeftMButton")) { + KeyBinding.onKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_1)); + //KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_1),false); + //KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_1),true); + + } + if (Objects.equals(Button, "RightMButton")) { + KeyBinding.onKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_2)); + // KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_2),false); + //KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_2),true); + + } + i = 0; + } + } + } + } + + } else { + if (AutoClickerKey.isPressed()) { + assert MinecraftClient.getInstance().player != null; + { + isAutoclickerOn = true; + if (i < delay) i++; + else { + if (Objects.equals(Button, "LeftMButton")) { + KeyBinding.onKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_1)); + //KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_1),false); + //KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_1),true); + + } + if (Objects.equals(Button, "RightMButton")) { + KeyBinding.onKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_2)); + // KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_2),false); + //KeyBinding.setKeyPressed(InputUtil.Type.MOUSE.createFromCode(GLFW.GLFW_MOUSE_BUTTON_2),true); + + } + i = 0; + } + } + } + } + + } + } +} diff --git a/src/main/java/net/fabricmc/smphack/Hacks/CrystalAura/EndCrystalBreaker.java b/src/main/java/net/fabricmc/smphack/Hacks/CrystalAura/EndCrystalBreaker.java index 4aa6af6..e6cf921 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/CrystalAura/EndCrystalBreaker.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/CrystalAura/EndCrystalBreaker.java @@ -17,6 +17,7 @@ public class EndCrystalBreaker extends MainGui { private double distance; + @Override public void toggled() { diff --git a/src/main/java/net/fabricmc/smphack/Hacks/Fly/Fly.java b/src/main/java/net/fabricmc/smphack/Hacks/Fly/Fly.java index 13ffd60..cc12b9e 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/Fly/Fly.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/Fly/Fly.java @@ -7,6 +7,8 @@ import net.minecraft.client.util.InputUtil; import org.lwjgl.glfw.GLFW; +import java.util.List; + public class Fly extends MainGui { public int flybindcounter = 0; @@ -17,6 +19,7 @@ public class Fly extends MainGui { "Imperials" )); + @Override public void toggled() { diff --git a/src/main/java/net/fabricmc/smphack/Hacks/Jesus/Jesusm.java b/src/main/java/net/fabricmc/smphack/Hacks/Jesus/Jesusm.java index 45e255d..98ff13f 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/Jesus/Jesusm.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/Jesus/Jesusm.java @@ -4,6 +4,7 @@ public class Jesusm extends MainGui { + @Override public void toggled() { diff --git a/src/main/java/net/fabricmc/smphack/Hacks/Jesus/jesus.java b/src/main/java/net/fabricmc/smphack/Hacks/Jesus/jesus.java index 4defacf..4e2951d 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/Jesus/jesus.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/Jesus/jesus.java @@ -43,8 +43,7 @@ public void onTick() { e.setVelocity(e.getVelocity().x, -0.005, e.getVelocity().z); e.setOnGround(true); if (mc.options.forwardKey.wasPressed()) { - movePlayerForward(player, (float) (speed/1)); - e.setSprinting(true); + movePlayerForward(player, (speed/3F)); } } } diff --git a/src/main/java/net/fabricmc/smphack/Hacks/Killaura/KillAura.java b/src/main/java/net/fabricmc/smphack/Hacks/Killaura/KillAura.java index 60f6533..fc6bb6f 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/Killaura/KillAura.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/Killaura/KillAura.java @@ -21,6 +21,7 @@ public class KillAura extends MainGui { private int delay; private double range; + @Override public void toggled() { super.toggled(); diff --git a/src/main/java/net/fabricmc/smphack/Hacks/NoWeather/NoWeather.java b/src/main/java/net/fabricmc/smphack/Hacks/NoWeather/NoWeather.java index aa2190d..7a3557e 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/NoWeather/NoWeather.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/NoWeather/NoWeather.java @@ -22,6 +22,7 @@ public class NoWeather extends MainGui { boolean NoWeather; + @Override public void update() { diff --git a/src/main/java/net/fabricmc/smphack/Hacks/Nofall/Nofall.java b/src/main/java/net/fabricmc/smphack/Hacks/Nofall/Nofall.java index adbfb30..b7fdeaf 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/Nofall/Nofall.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/Nofall/Nofall.java @@ -9,6 +9,8 @@ public class Nofall extends MainGui { private final MinecraftClient mc = MinecraftClient.getInstance(); private final NoFallHack noFall = new NoFallHack(); + + @Override public void toggled() { diff --git a/src/main/java/net/fabricmc/smphack/Hacks/Reach/Reach.java b/src/main/java/net/fabricmc/smphack/Hacks/Reach/Reach.java index 7e499ce..b20dfea 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/Reach/Reach.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/Reach/Reach.java @@ -6,7 +6,9 @@ public class Reach extends MainGui { public static boolean enabled=false; - @Override + + + @Override public void toggled() { enabled=!enabled; diff --git a/src/main/java/net/fabricmc/smphack/Hacks/Speed/Speed.java b/src/main/java/net/fabricmc/smphack/Hacks/Speed/Speed.java index 344edad..a476436 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/Speed/Speed.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/Speed/Speed.java @@ -18,6 +18,7 @@ public class Speed extends MainGui { private boolean jumping; + @Override public void toggled() { enabled = !enabled; diff --git a/src/main/java/net/fabricmc/smphack/Hacks/SpeedMine/SpeedMine.java b/src/main/java/net/fabricmc/smphack/Hacks/SpeedMine/SpeedMine.java index 972631c..48cd7f3 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/SpeedMine/SpeedMine.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/SpeedMine/SpeedMine.java @@ -13,6 +13,7 @@ public class SpeedMine extends MainGui { String Speedminemode; boolean Speedmine; + @Override public void toggled() { diff --git a/src/main/java/net/fabricmc/smphack/Hacks/fullbright/Fullbright.java b/src/main/java/net/fabricmc/smphack/Hacks/fullbright/Fullbright.java index 239fef1..5ce31ec 100644 --- a/src/main/java/net/fabricmc/smphack/Hacks/fullbright/Fullbright.java +++ b/src/main/java/net/fabricmc/smphack/Hacks/fullbright/Fullbright.java @@ -8,6 +8,7 @@ public class Fullbright extends MainGui { MinecraftClient mc = MinecraftClient.getInstance(); + @Override public void update() { diff --git a/src/main/java/net/fabricmc/smphack/MainGui.java b/src/main/java/net/fabricmc/smphack/MainGui.java index 8e8f5e4..3282159 100644 --- a/src/main/java/net/fabricmc/smphack/MainGui.java +++ b/src/main/java/net/fabricmc/smphack/MainGui.java @@ -6,10 +6,9 @@ public void toggled(){ enabled=!enabled; } - public void update() {} - - + public void update() { + } } diff --git a/src/main/java/net/fabricmc/smphack/MainHack.java b/src/main/java/net/fabricmc/smphack/MainHack.java index 1756295..385c193 100644 --- a/src/main/java/net/fabricmc/smphack/MainHack.java +++ b/src/main/java/net/fabricmc/smphack/MainHack.java @@ -21,7 +21,7 @@ public void onInitialize() { HudRenderCallback.EVENT.register(new HUDoverlay()); instance = this; CharacterMode.init(); - LOGGER.info("Client Initialised"); + LOGGER.info("Client Initialised"); } } diff --git a/src/main/java/net/fabricmc/smphack/RGBtext/CharacterMode.java b/src/main/java/net/fabricmc/smphack/RGBtext/CharacterMode.java index 81e20b5..8d9a332 100644 --- a/src/main/java/net/fabricmc/smphack/RGBtext/CharacterMode.java +++ b/src/main/java/net/fabricmc/smphack/RGBtext/CharacterMode.java @@ -38,8 +38,10 @@ public class CharacterMode { static int tsw=10; // Text width or X position for displaying and for changing postition of the text static int tsh= windowHeight+1; // Text width or Y position for displaying and for changing postition of the text static String bps; - static String biomeName; static float hue; + + static boolean TextShadow; + public static void coordinates(PlayerEntity player) { assert mc.player != null; @@ -77,7 +79,7 @@ public static String getBiome() { Biome = String.format("%s Biome", capitalize(biomeName)); } } - return Biome; + return biomes; } public static void displayposandcolour(TextRenderer font) { @@ -103,14 +105,15 @@ public static void init() { //end of stupid checks //Start of variables + TextShadow=GeneralConfig.getConfig().getTextshadow(); String TextSide = String.valueOf(config.Textside); String CoordSide = String.valueOf(config.Coordside); coordinates(player); displayposandcolour(font); int x_offset = 0; //End of initializing variables; - String text = "X " + xp + " Y " + yp + " Z " + zp; - String LOGO = "SMP-Hack v2-4-0"; + String text = "XYZ " + xp + " " + yp + " " + zp; + String LOGO = "SMP-Hack v2-4-1"; int stringWidth = font.getWidth(LOGO); for (int i = 0; i < LOGO.length(); i++) { @@ -119,7 +122,13 @@ public static void init() { int charWidth = font.getWidth(String.valueOf(e)); //tsw + ((float) (stringWidth - charWidth) / 2) tsw=10; - font.draw(matrices, String.valueOf(e), -29+((float) (stringWidth - charWidth) / 2)+x_offset, th, color.getRGB()); + if (TextShadow) { + font.drawWithShadow(matrices, String.valueOf(e), -29 + ((float) (stringWidth - charWidth) / 2) + x_offset, th, color.getRGB(), false); + } + else + { + font.draw(matrices, String.valueOf(e), -29 + ((float) (stringWidth - charWidth) / 2) + x_offset, th, color.getRGB()); + } x_offset += charWidth; } @@ -131,7 +140,7 @@ public static void init() { colors[i] = Color.getHSBColor(hue + hueOffset, 1, 1); } -// Draw coordinate text + // Draw coordinate text for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); int width = font.getWidth(String.valueOf(c)); @@ -154,7 +163,14 @@ public static void init() { } } - font.draw(matrices, String.valueOf(c), tsw, y, colors[i].getRGB()); + if (TextShadow) { + font.drawWithShadow(matrices, String.valueOf(c), tsw, y, colors[i].getRGB(), false); + } + else + { + font.draw(matrices, String.valueOf(c), tsw, y, colors[i].getRGB()); + + } } // Draw FPS and BPS text @@ -166,7 +182,6 @@ public static void init() { int SpeedWidth = font.getWidth(Speed); int pingX = screenWidth - PingWidth - 10; int biomeX = pingX - font.getWidth(Biome)+30; - int biome2X =screenWidth-470; switch (TextSide) { case "TopRight" -> { FPS = fps + " FPS"; @@ -174,11 +189,19 @@ public static void init() { Ping= ping +" Ping"; int pingY = tsh+27; int biomeY = tsh+39; - font.draw(matrices, FPS, screenWidth - FPSWidth - 10, tsh+3, colors[0].getRGB()); - font.draw(matrices, Speed, screenWidth - SpeedWidth - 10, tsh+15, colors[0].getRGB()); - font.draw(matrices, Ping, pingX, pingY, colors[0].getRGB()); - font.draw(matrices, Biome, biomeX, biomeY, colors[0].getRGB()); - + if (TextShadow) { + font.drawWithShadow(matrices, FPS, screenWidth - FPSWidth - 10, tsh + 3, colors[0].getRGB(), false); + font.drawWithShadow(matrices, Speed, screenWidth - SpeedWidth - 10, tsh + 15, colors[0].getRGB(), false); + font.drawWithShadow(matrices, Ping, pingX, pingY, colors[0].getRGB(), false); + font.drawWithShadow(matrices, Biome, biomeX, biomeY, colors[0].getRGB(), false); + } + else + { + font.draw(matrices, FPS, screenWidth - FPSWidth - 10, tsh + 3, colors[0].getRGB()); + font.draw(matrices, Speed, screenWidth - SpeedWidth - 10, tsh + 15, colors[0].getRGB()); + font.draw(matrices, Ping, pingX, pingY, colors[0].getRGB()); + font.draw(matrices, Biome, biomeX, biomeY, colors[0].getRGB()); + } } case "BottomRight" -> { @@ -187,21 +210,38 @@ public static void init() { Ping= ping+" Ping"; tsw = screenWidth - SpeedWidth - 10; y = windowHeight - 24; - int pingY = windowHeight - 48; - int biomeY = windowHeight-36; - font.draw(matrices, FPS, screenWidth - FPSWidth - 10, tsh=windowHeight-12, colors[0].getRGB()); - font.draw(matrices, Speed, tsw, y, colors[0].getRGB()); - font.draw(matrices, Ping, pingX, pingY, colors[0].getRGB()); - font.draw(matrices, Biome, biomeX, biomeY, colors[0].getRGB()); + int pingY = windowHeight -36; + int biomeY = windowHeight-48; + if (TextShadow) { + font.drawWithShadow(matrices, FPS, screenWidth - FPSWidth - 10, tsh = windowHeight - 12, colors[0].getRGB(), false); + font.drawWithShadow(matrices, Speed, tsw, y, colors[0].getRGB(), false); + font.drawWithShadow(matrices, Ping, pingX, pingY, colors[0].getRGB(), false); + font.drawWithShadow(matrices, Biome, biomeX, biomeY, colors[0].getRGB(), false); + } + else + { + font.draw(matrices, FPS, screenWidth - FPSWidth - 10, tsh = windowHeight - 12, colors[0].getRGB()); + font.draw(matrices, Speed, tsw, y, colors[0].getRGB()); + font.draw(matrices, Ping, pingX, pingY, colors[0].getRGB()); + font.draw(matrices, Biome, biomeX, biomeY, colors[0].getRGB()); + } } case "Left" -> { tsh=10; tsw=10; - font.draw(matrices, FPS, tsw, tsh+108, colors[0].getRGB()); - font.draw(matrices, Speed, tsw, tsh+120, colors[0].getRGB()); - font.draw(matrices, Ping, tsw, tsh+132, colors[0].getRGB()); - font.draw(matrices, Biome, tsw, tsh+144, colors[0].getRGB()); + if (TextShadow) { + font.drawWithShadow(matrices, FPS, tsw, tsh + 120, colors[0].getRGB(), false); + font.drawWithShadow(matrices, Speed, tsw, tsh + 132, colors[0].getRGB(), false); + font.drawWithShadow(matrices, Ping, tsw, tsh + 144, colors[0].getRGB(), false); + font.drawWithShadow(matrices, Biome, tsw-4, tsh + 156, colors[0].getRGB(), false); + } + else { + font.draw(matrices, FPS, tsw, tsh + 120, colors[0].getRGB() ); + font.draw(matrices, Speed, tsw, tsh + 132, colors[0].getRGB() ); + font.draw(matrices, Ping, tsw, tsh + 144, colors[0].getRGB() ); + font.draw(matrices, Biome, tsw-4, tsh + 156, colors[0].getRGB()); + } } } } diff --git a/src/main/java/net/fabricmc/smphack/config/ControllersConfig.java b/src/main/java/net/fabricmc/smphack/config/ControllersConfig.java index 8a1c592..d7e5ecc 100644 --- a/src/main/java/net/fabricmc/smphack/config/ControllersConfig.java +++ b/src/main/java/net/fabricmc/smphack/config/ControllersConfig.java @@ -37,11 +37,25 @@ public enum SpeedMode Strafe, Bhop } + public enum Buttons + { + RightMButton, + LeftMButton + } + public enum MouseKeybind + { + RightButton, + LeftButton + } + public SpeedMinemodes SpeedmMineModes = SpeedMinemodes.HasteMode; public TextSide Textside = TextSide.Left; public CoordsSide Coordside = CoordsSide.BottomLeft; public SpeedMode Speedmode = SpeedMode.onGround; + public Buttons ButtonAuto = Buttons.RightMButton; + public MouseKeybind MouseKeybindButton = MouseKeybind.RightButton; + public int NobreakHaste = 1; @@ -52,6 +66,7 @@ public enum SpeedMode private int range = 6;//for auto crystal and killaura private int reach = 4;// for player private int speedforjesus = 1; + private int DelayAC = 0; public boolean Antikick = true; @@ -60,6 +75,11 @@ public enum SpeedMode private boolean enableSpeedmine = false; private boolean NoHurtCam = false; private boolean actionBar = true; + private boolean AutoSprint = false; + private boolean AntiHunger = false; + private boolean MouseButton = true; + private boolean AutoClicker = false; + private boolean TextShadow = false; @@ -95,6 +115,15 @@ public void setAntikick(boolean Anitkick) { this.Antikick = Anitkick; } + public boolean getMouseButton() { + return MouseButton; + } + + public void setMouseButton(boolean Mousebutton) { + this.MouseButton = Mousebutton; + } + + public boolean getFullbright() { return Fullbright; } @@ -111,6 +140,23 @@ public void setNoHurtCam(boolean noHurtCam) { this.NoHurtCam = noHurtCam; } + public boolean getAutoSprint() { + return AutoSprint; + } + + public void setAutoSprint(boolean AutoSprint) { + this.AutoSprint = AutoSprint; + } + + public boolean getAntiHunger() { + return AntiHunger; + } + + public void setAntiHunger(boolean AntiHunger) { + this.AntiHunger = AntiHunger; + } + + public boolean getNoWeather() { return NoWeather; } @@ -118,6 +164,13 @@ public boolean getNoWeather() { public void setNoWeather(boolean NoWeather) { this.NoWeather = NoWeather; } + public boolean getTextshadow() { + return TextShadow; + } + + public void setTextShadow(boolean textShadow) { + this.TextShadow = textShadow; + } public void setNobreakHaste(int haste) { this.NobreakHaste = haste; @@ -135,6 +188,16 @@ public int getSpeedforjesus() { return speedforjesus; } + + public void setDelayAC(int delay) { + this.DelayAC = delay; + } + + public int getDelayAC() { + return DelayAC; + } + + public void setRange(int range) { this.range = range; } @@ -177,6 +240,10 @@ public boolean isEnableSpeedmine() { } public void setEnableSpeedmine(boolean SpeedMine) {this.enableSpeedmine = SpeedMine;} + public boolean getAutoClicker() { + return AutoClicker; + } + public void setAutoClicker(boolean Autoclicker) {this.AutoClicker = Autoclicker;} public int getFlySpeed() { return flySpeed; diff --git a/src/main/java/net/fabricmc/smphack/config/ModMenuIntegration.java b/src/main/java/net/fabricmc/smphack/config/ModMenuIntegration.java index e3ee53c..5773108 100644 --- a/src/main/java/net/fabricmc/smphack/config/ModMenuIntegration.java +++ b/src/main/java/net/fabricmc/smphack/config/ModMenuIntegration.java @@ -27,14 +27,15 @@ public ConfigScreenFactory getModConfigScreenFactory() { ConfigEntryBuilder entryBuilder = builder.entryBuilder(); - ConfigCategory settings = builder.getOrCreateCategory(Text.of("General Settings")); ConfigCategory Speed = builder.getOrCreateCategory(Text.of("Speed")); ConfigCategory Freecam = builder.getOrCreateCategory(Text.of("Freecam")); ConfigCategory Speedmine = builder.getOrCreateCategory(Text.of("SpeedMine")); ConfigCategory Fly = builder.getOrCreateCategory(Text.of("Fly")); + ConfigCategory AutoClicker = builder.getOrCreateCategory(Text.of("AutoClicker")); ConfigCategory Combat = builder.getOrCreateCategory(Text.of("Combat hack")); + Combat.addEntry(entryBuilder.startIntSlider(Text.of("Crystal Break delay (0 = ~10 ms)"), GeneralConfig.getConfig().getCrystalBreakDelay_in_seconds(), 0, 1000) .setDefaultValue(1) .setSaveConsumer(newValue -> GeneralConfig.getConfig().setCrystalBreakDelay_in_seconds(newValue)) @@ -49,8 +50,14 @@ public ConfigScreenFactory getModConfigScreenFactory() { .setDefaultValue(1) .setSaveConsumer(newValue -> GeneralConfig.getConfig().setRange(newValue)) .build()); + + SubCategoryBuilder Display = entryBuilder.startSubCategory(Text.of("Display HUD text")); + Display.add(entryBuilder.startBooleanToggle(Text.of("Text Shadow"), GeneralConfig.getConfig().getTextshadow()) + .setDefaultValue(false) + .setSaveConsumer(newValue -> GeneralConfig.getConfig().setTextShadow(newValue)) + .build()); Display.add(entryBuilder.startEnumSelector(Text.of("Text Side"), ControllersConfig.TextSide.class, ConfigUtil.config.Textside) .setDefaultValue(ControllersConfig.TextSide.Left) .setEnumNameProvider(x -> Text.of(" " + x.name().replace("_", ""))) @@ -69,6 +76,16 @@ public ConfigScreenFactory getModConfigScreenFactory() { .setSaveConsumer(newValue -> GeneralConfig.getConfig().setFullbright(newValue)) .build()); + settings.addEntry(entryBuilder.startBooleanToggle(Text.of("AutoSprint"), GeneralConfig.getConfig().getAutoSprint()) + .setDefaultValue(false) + .setSaveConsumer(newValue -> GeneralConfig.getConfig().setAutoSprint(newValue)) + .build()); + + settings.addEntry(entryBuilder.startBooleanToggle(Text.of("AntiHunger"), GeneralConfig.getConfig().getAntiHunger()) + .setDefaultValue(false) + .setSaveConsumer(newValue -> GeneralConfig.getConfig().setAntiHunger(newValue)) + .build()); + settings.addEntry(entryBuilder.startBooleanToggle(Text.of("NoWeather"), GeneralConfig.getConfig().getNoWeather()) .setDefaultValue(false) .setSaveConsumer(newValue -> GeneralConfig.getConfig().setNoWeather(newValue)) @@ -77,6 +94,7 @@ public ConfigScreenFactory getModConfigScreenFactory() { .setDefaultValue(false) .setSaveConsumer(newValue -> GeneralConfig.getConfig().setNoHurtCam(newValue)) .build()); + settings.addEntry(entryBuilder.startIntSlider(Text.of("Player Reach"), GeneralConfig.getConfig().getReach(), 1, 10) .setDefaultValue(4) .setSaveConsumer(newValue -> GeneralConfig.getConfig().setReach(newValue)) @@ -85,7 +103,10 @@ public ConfigScreenFactory getModConfigScreenFactory() { .setDefaultValue(4) .setSaveConsumer(newValue -> GeneralConfig.getConfig().setSpeedforjesus(newValue)) .build()); - + settings.addEntry(entryBuilder.startIntSlider(Text.of("AutoClicker delay"), GeneralConfig.getConfig().getDelayAC(), 0, 100) + .setDefaultValue(1) + .setSaveConsumer(newValue -> GeneralConfig.getConfig().setDelayAC(newValue)) + .build()); settings.addEntry(entryBuilder.startFloatField(Text.of("Fire Opacity"), GeneralConfig.getConfig().getFireOpacity()) .setDefaultValue(1f) @@ -159,8 +180,39 @@ Create subCategory using this (just for reference) .setDefaultValue((int) 1f) .setSaveConsumer(newValue -> GeneralConfig.getConfig().setJETPACK_MAX_SPEED(newValue)) .build()); + + AutoClicker.addEntry(entryBuilder.startBooleanToggle(Text.of("AutoClicker"), GeneralConfig.getConfig().getAutoClicker()) + .setDefaultValue(false) + .setSaveConsumer(newValue -> GeneralConfig.getConfig().setAutoClicker(newValue)) + .setTooltip(Text.of("Turn AutoClicker on/off")) + .build()); + SubCategoryBuilder clickermousesubcategory = entryBuilder.startSubCategory(Text.of("Mouse settings")); + clickermousesubcategory.add(entryBuilder.startBooleanToggle(Text.of("Mouse button for Autoclicker keybind"), GeneralConfig.getConfig().getMouseButton()) + .setDefaultValue(true) + .setSaveConsumer(newValue -> GeneralConfig.getConfig().setMouseButton(newValue)) + .build()); + clickermousesubcategory.add(entryBuilder.startEnumSelector(Text.of("Mouse Keybind Button for autoclicker"), ControllersConfig.MouseKeybind.class, ConfigUtil.config.MouseKeybindButton) + .setDefaultValue(ControllersConfig.MouseKeybind.RightButton) + .setEnumNameProvider(x -> Text.of(" " + x.name().replace("_", ""))) + .setTooltip(Text.of("This will select the keybind as a mouse button")) + .setSaveConsumer(newValue -> ConfigUtil.config.MouseKeybindButton = newValue).build()); + + AutoClicker.addEntry(clickermousesubcategory.build()); + + AutoClicker.addEntry(entryBuilder.startEnumSelector(Text.of("Auto click button"), ControllersConfig.Buttons.class, ConfigUtil.config.ButtonAuto) + .setDefaultValue(ControllersConfig.Buttons.RightMButton) + .setEnumNameProvider(x -> Text.of(" " + x.name().replace("_", ""))) + .setTooltip(Text.of("Mouse button which will be auto clicked")) + .setSaveConsumer(newValue -> ConfigUtil.config.ButtonAuto = newValue).build()); + + AutoClicker.addEntry(entryBuilder.startIntSlider(Text.of("AutoClicker delay"), GeneralConfig.getConfig().getDelayAC(), 0, 100) + .setDefaultValue(1) + .setSaveConsumer(newValue -> GeneralConfig.getConfig().setDelayAC(newValue)) + .build()); + + Freecam.addEntry(entryBuilder.startIntSlider(Text.of("Freecam fly Speed"), GeneralConfig.getConfig().getFlySpeed(), 1, 30) .setDefaultValue(10) .setSaveConsumer(newValue -> GeneralConfig.getConfig().setFlySpeed(newValue)) diff --git a/src/main/java/net/fabricmc/smphack/rendertext.java b/src/main/java/net/fabricmc/smphack/rendertext.java new file mode 100644 index 0000000..b392e40 --- /dev/null +++ b/src/main/java/net/fabricmc/smphack/rendertext.java @@ -0,0 +1,284 @@ +package net.fabricmc.smphack; + +import net.fabricmc.smphack.Hacks.AntiHunger.AntiHunger; +import net.fabricmc.smphack.Hacks.AutoSprint.AutoSprint; +import net.fabricmc.smphack.Hacks.Autoclicker.Autoclicker; +import net.fabricmc.smphack.Hacks.CrystalAura.EndCrystalBreaker; +import net.fabricmc.smphack.Hacks.Fly.Fly; +import net.fabricmc.smphack.Hacks.Fly.Flymodes; +import net.fabricmc.smphack.Hacks.Jesus.jesus; +import net.fabricmc.smphack.Hacks.Killaura.KillAura; +import net.fabricmc.smphack.Hacks.NoWeather.NoWeather; +import net.fabricmc.smphack.Hacks.Nofall.Nofall; +import net.fabricmc.smphack.Hacks.Reach.Reach; +import net.fabricmc.smphack.Hacks.Speed.Speed; +import net.fabricmc.smphack.Hacks.fullbright.Fullbright; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.util.Formatting; + +import static net.fabricmc.smphack.HUDoverlay.*; +import static net.fabricmc.smphack.Hacks.Autoclicker.Autoclicker.isAutoclickerOn; + +public class rendertext { + MinecraftClient mc=MinecraftClient.getInstance(); + boolean textshadow; + public void run() + { + textshadow=GeneralConfig.getConfig().getTextshadow(); + } + public void renderFlyMode(MatrixStack matrices, int tw, int th, TextRenderer font, Fly fly) { + if (FlyKey.wasPressed()) { + fly.toggled(); + } + + Flymodes flymode = Flymodes.values()[fly.flybindcounter % Flymodes.values().length]; + String flymodeText = flymode.name().toUpperCase(); + String text = "Fly [" + flymodeText + "]"; + + if (fly.enabled) { + fly.update(); + flymode.fly(); + if (textshadow) { + font.drawWithShadow(matrices, text, tw + 2, th + 12, Formatting.GREEN.getColorValue(),false); + } + else + { + font.draw(matrices, text, tw + 2, th + 12, Formatting.GREEN.getColorValue()); + } + } else { + if (textshadow) { + font.drawWithShadow(matrices, String.valueOf(text), tw + 2, th + 12, Formatting.RED.getColorValue(),false); + } + else + { + font.draw(matrices, text, tw + 2, th + 12, Formatting.RED.getColorValue()); + } + } + } + + public void renderNofall(MatrixStack matrices, int tw, int th, TextRenderer font, Nofall noFall) { + if (Nofallkey.wasPressed()) { + noFall.toggled(); + } + + if (noFall.enabled) { + noFall.update(); + if (textshadow) { + font.drawWithShadow(matrices, "Nofall", tw, th + 48, Formatting.GREEN.getColorValue(),false); + } + else + { + font.draw(matrices, "Nofall", tw, th + 48, Formatting.GREEN.getColorValue()); + } + } else { + if (textshadow) { + font.drawWithShadow(matrices, "Nofall", tw, th + 48, Formatting.RED.getColorValue(),false); + } + else + { + font.draw(matrices, "Nofall", tw, th + 48, Formatting.RED.getColorValue()); + + } + } + } + + public void renderJesus(MatrixStack matrices, int tw, int th, TextRenderer font, jesus jesus) { + if (Jesuskey.wasPressed()) { + jesus.toggled(); + } + + if (jesus.enabled) { + jes.update(); + if (textshadow) { + font.drawWithShadow(matrices, "Jesus", tw, th + 36, Formatting.GREEN.getColorValue(),false); + } + else + { + font.draw(matrices, "Jesus", tw, th + 36, Formatting.GREEN.getColorValue()); + + } + } else { + if (textshadow) { + font.drawWithShadow(matrices, "Jesus", tw, th + 36, Formatting.RED.getColorValue(),false); + } + else + { + font.draw(matrices, "Jesus", tw, th + 36, Formatting.RED.getColorValue()); + } + } + } + + public void renderSpeed(MatrixStack matrices, int tw, int th, TextRenderer font, Speed speed) { + if (SpeedKey.wasPressed()) { + speed.toggled(); + } + if (speed.enabled) { + speed.update(); + if (textshadow) { + font.drawWithShadow(matrices, "Speed", tw + 1, th + 24, Formatting.GREEN.getColorValue(),false); + } + else + { + font.draw(matrices, "Speed", tw + 1, th + 24, Formatting.GREEN.getColorValue()); + } + } else { + if (textshadow) { + font.drawWithShadow(matrices, "Speed", tw + 1, th + 24, Formatting.RED.getColorValue(),false); + } + else + { + font.draw(matrices, "Speed", tw + 1, th + 24, Formatting.RED.getColorValue()); + } + assert mc.player != null; + mc.player.getAbilities().setWalkSpeed(speed.walkspeed); + } + } + + public void Fullbright() { + boolean fullbright = GeneralConfig.getConfig().getFullbright(); + if (fullbright) { + Fullbright fullbright1 = new Fullbright(); + fullbright1.update(); + } else { + assert mc.player != null; + mc.player.removeStatusEffect(StatusEffects.NIGHT_VISION); + } + } + + public void renderFreecam(MatrixStack matrices, int tw, int th, TextRenderer font) { + boolean enabled = GeneralConfig.enabled; + if (enabled) { + if (textshadow) { + font.drawWithShadow(matrices, "Freecam", tw, th + 60, Formatting.GREEN.getColorValue(),false); + } + else{ + font.draw(matrices, "Freecam", tw, th + 60, Formatting.GREEN.getColorValue()); + } + } else { + if (textshadow) { + font.drawWithShadow(matrices, "Freecam", tw, th + 60, Formatting.RED.getColorValue(),false); + } + else + { + font.draw(matrices, "Freecam", tw, th + 60, Formatting.RED.getColorValue()); + } + } + } + + public void NoWeather() { + boolean noWeather = GeneralConfig.getConfig().getNoWeather(); + if (noWeather) { + NoWeather Noweather = new NoWeather(); + Noweather.update(); + } else { + assert MinecraftClient.getInstance().world != null; + if (MinecraftClient.getInstance().world.isRaining()) { + MinecraftClient.getInstance().world.setRainGradient(0); + } + } + } + + public void renderAutoCrystalBreaker(MatrixStack matrices, int tw, int th, TextRenderer font, EndCrystalBreaker endCrystalBreaker) { + if (AutoCrystalBreakerKey.wasPressed()) { + endCrystalBreaker.toggled(); + } + if (endCrystalBreaker.enabled) { + if (textshadow) { + font.drawWithShadow(matrices, "AutoCrystal", tw, th + 72, Formatting.GREEN.getColorValue(),false); + } + else + { + font.draw(matrices, "AutoCrystal", tw, th + 72, Formatting.GREEN.getColorValue()); + } + } else { + if (textshadow) { + font.drawWithShadow(matrices, "AutoCrystal", tw, th + 72, Formatting.RED.getColorValue(),false); + } + else + { + font.draw(matrices, "AutoCrystal", tw, th + 72, Formatting.RED.getColorValue()); + } + } + } + + public void renderKillAura(MatrixStack matrices, int tw, int th, TextRenderer font, KillAura killAura) { + if (KillauraKey.wasPressed()) { + killAura.toggled(); + } + if (killAura.enabled) { + if (textshadow) { + font.drawWithShadow(matrices, "KillAura", tw, th + 84, Formatting.GREEN.getColorValue(),false); + } + else + { + font.draw(matrices, "KillAura", tw, th + 84, Formatting.GREEN.getColorValue()); + } + } else { + if (textshadow) { + font.drawWithShadow(matrices, "KillAura", tw, th + 84, Formatting.RED.getColorValue(),false); + } + else + { + font.draw(matrices, "KillAura", tw, th + 84, Formatting.RED.getColorValue()); + } + } + } + + public void renderReach(MatrixStack matrices, int tw, int th, Reach reach, TextRenderer font) { + if (ReachKey.wasPressed()) { + reach.toggled(); + } + if (reach.enabled) { + if (textshadow) { + font.drawWithShadow(matrices, "Reach", tw, th + 108, Formatting.GREEN.getColorValue(),false); + } + else + { + font.draw(matrices, "Reach", tw, th + 108, Formatting.GREEN.getColorValue()); + } + } else { + if (textshadow) { + font.drawWithShadow(matrices, "Reach", tw, th + 108, Formatting.RED.getColorValue(),false); + } + else + { + font.draw(matrices, "Reach", tw, th + 108, Formatting.RED.getColorValue()); + } + } + } + + public void AutoSprint(AutoSprint autoSprint) { + autoSprint.update(); + } + public void AntiHunger(AntiHunger antiHunger) { + antiHunger.toggled(); + } + + public void AutoClicker(Autoclicker Autoclicker) { + Autoclicker.update(); + } + public void renderAutoClicker(MatrixStack matrices, int tw, int th,TextRenderer font) { + if (isAutoclickerOn) { + if (textshadow) { + font.drawWithShadow(matrices, "AutoClicker", tw, th + 96, Formatting.GREEN.getColorValue(),false); + } + else + { + font.draw(matrices, "AutoClicker", tw, th + 96, Formatting.GREEN.getColorValue()); + } + } else { + if (textshadow) { + font.drawWithShadow(matrices, "AutoClicker", tw, th + 96, Formatting.RED.getColorValue(),false); + } + else + { + font.draw(matrices, "AutoClicker", tw, th + 96, Formatting.RED.getColorValue()); + } + } + } + + +}