From b2ab0ac13a53e971ed481373bd7c1927f3a70354 Mon Sep 17 00:00:00 2001 From: Jess Date: Sat, 15 Jun 2024 19:52:12 +0100 Subject: [PATCH] i am going to bed now fml --- .../java/de/com/baseband/client/Setup.java | 3 +- .../client/feature/commands/Credit.java | 14 +- .../modules/player/AntiLevitation.java | 2 +- .../{world => player}/AutoRespawn.java | 6 +- .../modules/player/InteractionTweaks.java | 130 ++++++++++++++++++ .../feature/modules/world/FastBreak.java | 72 ---------- .../client/feature/modules/world/FastUse.java | 22 --- .../client/mixin/mixins/IMinecraft.java | 3 + 8 files changed, 151 insertions(+), 101 deletions(-) rename Client/src/main/java/de/com/baseband/client/feature/modules/{world => player}/AutoRespawn.java (83%) create mode 100644 Client/src/main/java/de/com/baseband/client/feature/modules/player/InteractionTweaks.java delete mode 100644 Client/src/main/java/de/com/baseband/client/feature/modules/world/FastBreak.java delete mode 100644 Client/src/main/java/de/com/baseband/client/feature/modules/world/FastUse.java diff --git a/Client/src/main/java/de/com/baseband/client/Setup.java b/Client/src/main/java/de/com/baseband/client/Setup.java index ca75f35..0913d37 100644 --- a/Client/src/main/java/de/com/baseband/client/Setup.java +++ b/Client/src/main/java/de/com/baseband/client/Setup.java @@ -10,6 +10,7 @@ import de.com.baseband.client.feature.modules.movement.ElytraFly; import de.com.baseband.client.feature.modules.movement.NoSlowDown; import de.com.baseband.client.feature.modules.movement.Velocity; import de.com.baseband.client.feature.modules.player.AntiLevitation; +import de.com.baseband.client.feature.modules.player.AutoRespawn; import de.com.baseband.client.feature.modules.render.*; import de.com.baseband.client.feature.modules.world.*; @@ -51,8 +52,6 @@ public class Setup { new ElytraFly(), new ElytraBot(), new ESP(), - new FastBreak(), - new FastUse(), new Freecam(), new Help(), new HUD(), diff --git a/Client/src/main/java/de/com/baseband/client/feature/commands/Credit.java b/Client/src/main/java/de/com/baseband/client/feature/commands/Credit.java index fb8be88..805030f 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/commands/Credit.java +++ b/Client/src/main/java/de/com/baseband/client/feature/commands/Credit.java @@ -2,9 +2,21 @@ package de.com.baseband.client.feature.commands; import de.com.baseband.client.feature.Feature; import de.com.baseband.client.feature.category.Command; +import de.com.baseband.client.util.interact.Chat; @Command public class Credit extends Feature { - publi + @Override + public String toString() { + return "Credit"; + } + + @Override + public void onCommand(String[] args) { + Chat.print("Credits:"); + Chat.print("Jess H - Insanity."); + Chat.print("TudbuT - Client Base, Settings System, Loader."); + Chat.print("John200410 - Telling me to increase the BCrypt rounds."); + } } diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/player/AntiLevitation.java b/Client/src/main/java/de/com/baseband/client/feature/modules/player/AntiLevitation.java index 20e48a3..985ee50 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/player/AntiLevitation.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/player/AntiLevitation.java @@ -29,7 +29,7 @@ public class AntiLevitation extends Feature { } public void motion(MoveEvent event) { - if(mode == Mode.Motion) { + if(mode == Mode.Motion && mc.player.isPotionActive(MobEffects.LEVITATION)) { if(event.y > 0) { event.y = 0; } diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/world/AutoRespawn.java b/Client/src/main/java/de/com/baseband/client/feature/modules/player/AutoRespawn.java similarity index 83% rename from Client/src/main/java/de/com/baseband/client/feature/modules/world/AutoRespawn.java rename to Client/src/main/java/de/com/baseband/client/feature/modules/player/AutoRespawn.java index 569d0f1..8711b13 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/world/AutoRespawn.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/player/AutoRespawn.java @@ -1,12 +1,12 @@ -package de.com.baseband.client.feature.modules.world; +package de.com.baseband.client.feature.modules.player; import de.com.baseband.client.BaseBand; import de.com.baseband.client.feature.Feature; -import de.com.baseband.client.feature.category.World; +import de.com.baseband.client.feature.category.Player; import de.tudbut.tools.Lock; import net.minecraft.client.gui.GuiGameOver; -@World +@Player public class AutoRespawn extends Feature { @Override public String toString() { diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/player/InteractionTweaks.java b/Client/src/main/java/de/com/baseband/client/feature/modules/player/InteractionTweaks.java new file mode 100644 index 0000000..49d666e --- /dev/null +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/player/InteractionTweaks.java @@ -0,0 +1,130 @@ +package de.com.baseband.client.feature.modules.player; + +import de.com.baseband.client.event.events.DamageBlockEvent; +import de.com.baseband.client.feature.Feature; +import de.com.baseband.client.feature.category.Player; +import de.com.baseband.client.mixin.mixins.IMinecraft; +import de.com.baseband.client.mixin.mixins.IPlayerControllerMP; +import de.com.baseband.client.registry.annotation.Config; +import de.com.baseband.client.registry.annotation.Range; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.client.CPacketPlayerDigging; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; + +@Player +public class InteractionTweaks extends Feature { + @Override + public String toString() { + return "InteractionTweaks"; + } + + public final FastBreak fastBreak = new FastBreak(); + public final FastUse fastUse = new FastUse(); + + @Override + protected void setup() { + subComponents.add(fastBreak); + subComponents.add(fastUse); + } + + @Player + public class FastUse extends Feature { + @Override + public String toString() { + return "FastUse"; + } + + @Config("Show On HUD") + public boolean showOnHUD; + + @Config("Delay") + @Range("0..10") + public int delay; + + @Override + public void onTick() { + ((IMinecraft) Minecraft.getMinecraft()).setRightClickDelayTimer(delay); + } + + @Override + public boolean displayOnClickGUI() { + return false; + } + + @Override + public boolean renderInHUD() { + return showOnHUD; + } + } + + + public enum Mode { + Damage, + Packet + } + + @Player + public class FastBreak extends Feature { + + @Override + public String toString() { + return "FastBreak"; + } + + @Config("Show On HUD") + public boolean showOnHUD; + + @Config("Mode") + public Mode mode = Mode.Damage; + + @Config("NoBreakDelay") + public boolean noBreakDelay; + + @Override + public void onEveryTick() { + //Hot + if (enabled && !notIngame()) { + if(noBreakDelay) { + ((IPlayerControllerMP) (mc.playerController)).setBlockHitDelay(0); + } + text = this + "§7 [" + mode.toString() + "]"; + } else { + text = toString(); + } + } + + + public void damageBlock(DamageBlockEvent event) { + if(isNotUnbreakable(event.getBlockPos())) { + if (noBreakDelay) { + ((IPlayerControllerMP) (mc.playerController)).setBlockHitDelay(0); + } + if (mode == Mode.Packet) { + mc.player.swingArm(EnumHand.MAIN_HAND); + mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.START_DESTROY_BLOCK, event.getBlockPos(), event.getEnumFacing())); + mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, event.getBlockPos(), event.getEnumFacing())); + event.setCancelled(true); + } + + if (mode == Mode.Damage && ((IPlayerControllerMP) mc.playerController).getDamage() >= 0.7f) { + ((IPlayerControllerMP) mc.playerController).setDamage(1.0f); + } + } + } + + private boolean isNotUnbreakable(BlockPos pos) { + return mc.world.getBlockState(pos).getBlock().getBlockHardness(mc.world.getBlockState(pos), Minecraft.getMinecraft().world, pos) != -1; + } + + @Override + public boolean displayOnClickGUI() { + return false; + } + + @Override + public boolean renderInHUD() { + return showOnHUD; + } + } +} diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastBreak.java b/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastBreak.java deleted file mode 100644 index d662926..0000000 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastBreak.java +++ /dev/null @@ -1,72 +0,0 @@ -package de.com.baseband.client.feature.modules.world; - -import de.com.baseband.client.event.events.DamageBlockEvent; -import de.com.baseband.client.feature.Feature; -import de.com.baseband.client.feature.category.World; -import de.com.baseband.client.mixin.mixins.IPlayerControllerMP; -import de.com.baseband.client.registry.annotation.Config; -import net.minecraft.client.Minecraft; -import net.minecraft.network.play.client.CPacketPlayerDigging; -import net.minecraft.util.EnumHand; -import net.minecraft.util.math.BlockPos; - -@World -public class FastBreak extends Feature { - - @Override - public String toString() { - return "FastBreak"; - } - - @Config("Mode") - public Mode mode = Mode.Damage; - - @Config("NoBreakDelay") - public boolean noBreakDelay; - - public enum Mode { - Damage, - Packet, - Instant - } - - @Override - public void onEveryTick() { - //Hot - if (enabled && !notIngame()) { - if(noBreakDelay) { - ((IPlayerControllerMP) (mc.playerController)).setBlockHitDelay(0); - } - text = this + "§7 [" + mode.toString() + "]"; - } else { - text = toString(); - } - } - - - public void damageBlock(DamageBlockEvent event) { - if(noBreakDelay) { - ((IPlayerControllerMP) (mc.playerController)).setBlockHitDelay(0); - } - if (mode == Mode.Packet) { - mc.player.swingArm(EnumHand.MAIN_HAND); - mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.START_DESTROY_BLOCK, event.getBlockPos(), event.getEnumFacing())); - mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, event.getBlockPos(), event.getEnumFacing())); - event.setCancelled(true); - } - - if (mode == Mode.Instant) { - mc.player.swingArm(EnumHand.MAIN_HAND); - mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, event.getBlockPos(), event.getEnumFacing())); - event.setCancelled(true); - } - - if (mode == Mode.Damage && ((IPlayerControllerMP) mc.playerController).getDamage() >= 0.7f) { - ((IPlayerControllerMP) mc.playerController).setDamage(1.0f); - } - } - - private boolean isNotUnbreakable(BlockPos pos) { - return mc.world.getBlockState(pos).getBlock().getBlockHardness(mc.world.getBlockState(pos), Minecraft.getMinecraft().world, pos) != -1; - } -} diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastUse.java b/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastUse.java deleted file mode 100644 index 061c8b8..0000000 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastUse.java +++ /dev/null @@ -1,22 +0,0 @@ -package de.com.baseband.client.feature.modules.world; - -import de.com.baseband.client.feature.Feature; -import de.com.baseband.client.feature.Features; -import de.com.baseband.client.feature.category.World; -import net.minecraft.network.play.client.CPacketPlayerTryUseItem; -import net.minecraft.util.EnumHand; - -@World -public class FastUse extends Feature { - @Override - public String toString() { - return "FastUse"; - } - - @Override - public void onTick() { - if (mc.gameSettings.keyBindUseItem.isKeyDown() && !mc.player.getHeldItemMainhand().isEmpty() && !Features.getFeature(AutoEat.class).eating) { - mc.getConnection().sendPacket(new CPacketPlayerTryUseItem(EnumHand.MAIN_HAND)); - } - } -} diff --git a/Client/src/main/java/de/com/baseband/client/mixin/mixins/IMinecraft.java b/Client/src/main/java/de/com/baseband/client/mixin/mixins/IMinecraft.java index a39c64b..48e9068 100644 --- a/Client/src/main/java/de/com/baseband/client/mixin/mixins/IMinecraft.java +++ b/Client/src/main/java/de/com/baseband/client/mixin/mixins/IMinecraft.java @@ -13,4 +13,7 @@ public interface IMinecraft { @Invoker("rightClickMouse") void rightClick(); + + @Accessor("rightClickDelayTimer") + void setRightClickDelayTimer(int rightClickDelayTimer); }