From c3bfdcc7d59da2a7d0e6f9b0978cb6ddae19e491 Mon Sep 17 00:00:00 2001 From: evaan Date: Fri, 7 May 2021 09:45:21 -0230 Subject: [PATCH] dawsd --- README.md | 2 +- .../java/com/evaan/frostburn/FrostBurn.java | 2 +- .../evaan/frostburn/clickgui/ClickGui.java | 1 - .../NewGui.java => clickgui/ImGuiScreen.java} | 41 ++++++++----------- .../clickgui/button/buttons/BoolButton.java | 2 +- .../command/commands/SettingCommand.java | 1 - .../command/commands/ToggleCommand.java | 1 - .../mixins/MixinMinecraftClient.java | 2 - .../frostburn/mixins/MixinPlayerEntity.java | 2 - .../com/evaan/frostburn/module/Module.java | 1 - .../evaan/frostburn/module/ModuleManager.java | 5 ++- .../module/modules/combat/KillAura.java | 3 +- .../module/modules/misc/YawLock.java | 4 -- .../module/modules/render/ClickGuiMod.java | 3 -- .../module/modules/render/ImGuiMod.java | 4 +- .../evaan/frostburn/util/ConfigManager.java | 4 +- .../com/evaan/frostburn/util/Keyboard.java | 4 +- 17 files changed, 34 insertions(+), 48 deletions(-) rename src/main/java/com/evaan/frostburn/{imgui/NewGui.java => clickgui/ImGuiScreen.java} (79%) diff --git a/README.md b/README.md index 78ad616..9fd628c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A 1.16.5 utility mod oriented towards anarchy servers - [x] Module System - [x] Friends - [x] Settings - - [ ] ClickGUI (Missing some few final touches) + - [x] ClickGUI (Uses [imgui](https://github.com/SpaiR/imgui-java)) - [ ] HUD - [ ] Render Modules - [ ] Chams diff --git a/src/main/java/com/evaan/frostburn/FrostBurn.java b/src/main/java/com/evaan/frostburn/FrostBurn.java index 98827f2..2ee7eae 100644 --- a/src/main/java/com/evaan/frostburn/FrostBurn.java +++ b/src/main/java/com/evaan/frostburn/FrostBurn.java @@ -1,8 +1,8 @@ package com.evaan.frostburn; +import com.evaan.frostburn.clickgui.ClickGui; import com.evaan.frostburn.command.CommandManager; import com.evaan.frostburn.module.ModuleManager; -import com.evaan.frostburn.clickgui.ClickGui; import com.evaan.frostburn.util.ConfigManager; import com.evaan.frostburn.util.SettingsManager; import me.zero.alpine.EventBus; diff --git a/src/main/java/com/evaan/frostburn/clickgui/ClickGui.java b/src/main/java/com/evaan/frostburn/clickgui/ClickGui.java index f0187a0..4400efa 100644 --- a/src/main/java/com/evaan/frostburn/clickgui/ClickGui.java +++ b/src/main/java/com/evaan/frostburn/clickgui/ClickGui.java @@ -3,7 +3,6 @@ import com.evaan.frostburn.clickgui.button.ModuleButton; import com.evaan.frostburn.module.Module; import com.evaan.frostburn.module.ModuleManager; -import com.evaan.frostburn.util.Keyboard; import com.evaan.frostburn.util.Wrapper; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.util.math.MatrixStack; diff --git a/src/main/java/com/evaan/frostburn/imgui/NewGui.java b/src/main/java/com/evaan/frostburn/clickgui/ImGuiScreen.java similarity index 79% rename from src/main/java/com/evaan/frostburn/imgui/NewGui.java rename to src/main/java/com/evaan/frostburn/clickgui/ImGuiScreen.java index 029806b..cc71bb1 100644 --- a/src/main/java/com/evaan/frostburn/imgui/NewGui.java +++ b/src/main/java/com/evaan/frostburn/clickgui/ImGuiScreen.java @@ -1,16 +1,8 @@ -package com.evaan.frostburn.imgui; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Objects; +package com.evaan.frostburn.clickgui; import com.evaan.frostburn.module.Module; import com.evaan.frostburn.module.ModuleManager; import com.evaan.frostburn.util.Setting; -import imgui.ImGui; -import imgui.flag.ImGuiCol; -import imgui.flag.ImGuiStyleVar; import imgui.gl3.ImGuiImplGl3; import imgui.glfw.ImGuiImplGlfw; import imgui.type.ImBoolean; @@ -23,8 +15,11 @@ import net.minecraft.text.LiteralText; import net.minecraft.util.Formatting; +import java.util.HashMap; +import java.util.Objects; + @Environment(EnvType.CLIENT) -public class NewGui extends Screen { +public class ImGuiScreen extends Screen { private long windowPtr; @@ -35,10 +30,10 @@ public class NewGui extends Screen { private HashMap enabledMap = new HashMap<>(); private HashMap settingsMap = new HashMap<>(); - public NewGui() { + public ImGuiScreen() { super(new LiteralText("FrostBurn ClickGui")); windowPtr = MinecraftClient.getInstance().getWindow().getHandle(); - ImGui.createContext(); + imgui.ImGui.createContext(); implGlfw.init(windowPtr, false); implGl3.init("#version 150"); @@ -74,44 +69,44 @@ public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { textRenderer.drawWithShadow(matrices, new LiteralText(Formatting.BLUE+"Frost"+Formatting.RED+"Burn"+Formatting.WHITE+" 1.0 by evaan"), 2, 2, 0xffffff); textRenderer.drawWithShadow(matrices, new LiteralText("https://github.com/evaan/FrostBurn"), 2, 12, 0xffffff); implGlfw.newFrame(); - ImGui.newFrame(); + imgui.ImGui.newFrame(); for (Module.Category category : Module.Category.values()) { - ImGui.begin(category.getName()); + imgui.ImGui.begin(category.getName()); for (Module module : ModuleManager.getModulesInCategory(category)) { if (module.getName().equalsIgnoreCase("imgui") || module.getName().equalsIgnoreCase("clickgui")) continue; - ImGui.checkbox(module.getName(), enabledMap.get(module)); + imgui.ImGui.checkbox(module.getName(), enabledMap.get(module)); if (enabledMap.get(module).get() != module.isEnabled()) module.toggle(); - if (!module.settings.isEmpty() && ImGui.collapsingHeader(module.getName() + " Settings")) { + if (!module.settings.isEmpty() && imgui.ImGui.collapsingHeader(module.getName() + " Settings")) { for (Setting setting : module.settings) { switch (setting.getType()) { case BOOLEAN: - ImGui.checkbox(setting.getName(), (ImBoolean) settingsMap.get(setting)); + imgui.ImGui.checkbox(setting.getName(), (ImBoolean) settingsMap.get(setting)); if ((boolean) setting.getValue() != ((ImBoolean) settingsMap.get(setting)).get()) setting.setValue(((ImBoolean) settingsMap.get(setting)).get()); break; case INTEGER: - ImGui.sliderInt(setting.getName(), (int[]) settingsMap.get(setting), (int) setting.getMin(), (int) setting.getMax()); + imgui.ImGui.sliderInt(setting.getName(), (int[]) settingsMap.get(setting), (int) setting.getMin(), (int) setting.getMax()); int[] javaStupid = (int[]) settingsMap.get(setting); if (javaStupid[0] != (int) setting.getValue()) setting.setValue(javaStupid[0]); break; case FLOAT: - ImGui.sliderFloat(setting.getName(), (float[]) settingsMap.get(setting), (float) setting.getMin(),(float) setting.getMax()); + imgui.ImGui.sliderFloat(setting.getName(), (float[]) settingsMap.get(setting), (float) setting.getMin(),(float) setting.getMax()); float[] javaStupid1 = (float[]) settingsMap.get(setting); if (javaStupid1[0] != (float) setting.getValue()) setting.setValue(javaStupid1[0]); break; case STRING: String[] javaStupid2 = (String[]) setting.getOptions().toArray(new String[setting.getOptions().size()]); - ImGui.combo(setting.getName(), (ImInt) settingsMap.get(setting), javaStupid2); + imgui.ImGui.combo(setting.getName(), (ImInt) settingsMap.get(setting), javaStupid2); if (((ImInt) settingsMap.get(setting)).get() != setting.getOptions().indexOf(setting.getValue())) setting.setValue(setting.getOptions().get(((ImInt) settingsMap.get(setting)).get())); } } } } - ImGui.end(); + imgui.ImGui.end(); } - ImGui.render(); - implGl3.renderDrawData(Objects.requireNonNull(ImGui.getDrawData())); + imgui.ImGui.render(); + implGl3.renderDrawData(Objects.requireNonNull(imgui.ImGui.getDrawData())); } } \ No newline at end of file diff --git a/src/main/java/com/evaan/frostburn/clickgui/button/buttons/BoolButton.java b/src/main/java/com/evaan/frostburn/clickgui/button/buttons/BoolButton.java index 08266c6..a37b361 100644 --- a/src/main/java/com/evaan/frostburn/clickgui/button/buttons/BoolButton.java +++ b/src/main/java/com/evaan/frostburn/clickgui/button/buttons/BoolButton.java @@ -1,8 +1,8 @@ package com.evaan.frostburn.clickgui.button.buttons; import com.evaan.frostburn.clickgui.button.ModuleButton; -import com.evaan.frostburn.module.Module; import com.evaan.frostburn.clickgui.button.SettingButton; +import com.evaan.frostburn.module.Module; import com.evaan.frostburn.module.modules.render.ClickGuiMod; import com.evaan.frostburn.util.Setting; import com.evaan.frostburn.util.Wrapper; diff --git a/src/main/java/com/evaan/frostburn/command/commands/SettingCommand.java b/src/main/java/com/evaan/frostburn/command/commands/SettingCommand.java index 46c4f11..f4b632c 100644 --- a/src/main/java/com/evaan/frostburn/command/commands/SettingCommand.java +++ b/src/main/java/com/evaan/frostburn/command/commands/SettingCommand.java @@ -3,7 +3,6 @@ import com.evaan.frostburn.command.Command; import com.evaan.frostburn.module.Module; import com.evaan.frostburn.module.ModuleManager; -import com.evaan.frostburn.util.ConfigManager; import com.evaan.frostburn.util.Setting; import com.evaan.frostburn.util.SettingsManager; diff --git a/src/main/java/com/evaan/frostburn/command/commands/ToggleCommand.java b/src/main/java/com/evaan/frostburn/command/commands/ToggleCommand.java index a712dd9..5e13c55 100644 --- a/src/main/java/com/evaan/frostburn/command/commands/ToggleCommand.java +++ b/src/main/java/com/evaan/frostburn/command/commands/ToggleCommand.java @@ -3,7 +3,6 @@ import com.evaan.frostburn.command.Command; import com.evaan.frostburn.module.Module; import com.evaan.frostburn.module.ModuleManager; -import com.evaan.frostburn.util.ConfigManager; /** * @Author evaan diff --git a/src/main/java/com/evaan/frostburn/mixins/MixinMinecraftClient.java b/src/main/java/com/evaan/frostburn/mixins/MixinMinecraftClient.java index 2596b4f..4ae3a09 100644 --- a/src/main/java/com/evaan/frostburn/mixins/MixinMinecraftClient.java +++ b/src/main/java/com/evaan/frostburn/mixins/MixinMinecraftClient.java @@ -1,14 +1,12 @@ package com.evaan.frostburn.mixins; import com.evaan.frostburn.FrostBurn; -import com.evaan.frostburn.util.ConfigManager; import net.minecraft.client.MinecraftClient; import net.minecraft.client.util.Window; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.io.IOException; diff --git a/src/main/java/com/evaan/frostburn/mixins/MixinPlayerEntity.java b/src/main/java/com/evaan/frostburn/mixins/MixinPlayerEntity.java index ca1f51c..f7a454e 100644 --- a/src/main/java/com/evaan/frostburn/mixins/MixinPlayerEntity.java +++ b/src/main/java/com/evaan/frostburn/mixins/MixinPlayerEntity.java @@ -3,10 +3,8 @@ import com.evaan.frostburn.FrostBurn; import com.evaan.frostburn.module.ModuleManager; import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.client.options.GameOptions; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; -import net.minecraft.util.math.Vec3d; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/com/evaan/frostburn/module/Module.java b/src/main/java/com/evaan/frostburn/module/Module.java index 0a6f841..2960181 100644 --- a/src/main/java/com/evaan/frostburn/module/Module.java +++ b/src/main/java/com/evaan/frostburn/module/Module.java @@ -8,7 +8,6 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Formatting; -import java.awt.*; import java.util.ArrayList; /** diff --git a/src/main/java/com/evaan/frostburn/module/ModuleManager.java b/src/main/java/com/evaan/frostburn/module/ModuleManager.java index 720eb4b..bd3d9c9 100644 --- a/src/main/java/com/evaan/frostburn/module/ModuleManager.java +++ b/src/main/java/com/evaan/frostburn/module/ModuleManager.java @@ -2,8 +2,11 @@ import com.evaan.frostburn.module.modules.combat.*; import com.evaan.frostburn.module.modules.misc.*; +import com.evaan.frostburn.module.modules.movement.Jesus; +import com.evaan.frostburn.module.modules.movement.NoFall; +import com.evaan.frostburn.module.modules.movement.SafeWalk; +import com.evaan.frostburn.module.modules.movement.Sprint; import com.evaan.frostburn.module.modules.render.*; -import com.evaan.frostburn.module.modules.movement.*; import java.util.ArrayList; import java.util.Comparator; diff --git a/src/main/java/com/evaan/frostburn/module/modules/combat/KillAura.java b/src/main/java/com/evaan/frostburn/module/modules/combat/KillAura.java index 8afa55f..45d1236 100644 --- a/src/main/java/com/evaan/frostburn/module/modules/combat/KillAura.java +++ b/src/main/java/com/evaan/frostburn/module/modules/combat/KillAura.java @@ -23,13 +23,14 @@ public class KillAura extends Module { Setting switchItem = register(new Setting("Switch", this, true)); Setting allEntities = register(new Setting("AllEntities", this, true)); Setting multiAura = register(new Setting("Multi", this, true)); + Setting spam = register(new Setting("Spam", this, false)); //todo rotate @Override public void onUpdate() { if (mc.player == null || mc.world == null) return; - if(mc.player.getAttackCooldownProgress(0) < 1) return; + if(mc.player.getAttackCooldownProgress(0) < 1 && spam.getValue()) return; try { List filtered; diff --git a/src/main/java/com/evaan/frostburn/module/modules/misc/YawLock.java b/src/main/java/com/evaan/frostburn/module/modules/misc/YawLock.java index 445dd21..63e6396 100644 --- a/src/main/java/com/evaan/frostburn/module/modules/misc/YawLock.java +++ b/src/main/java/com/evaan/frostburn/module/modules/misc/YawLock.java @@ -1,11 +1,7 @@ package com.evaan.frostburn.module.modules.misc; import com.evaan.frostburn.module.Module; -import com.evaan.frostburn.util.Setting; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.command.argument.EntityAnchorArgumentType; -import net.minecraft.util.math.Direction; -import net.minecraft.util.math.Vec3d; public class YawLock extends Module { public YawLock() {super("YawLock", Category.MISC);} diff --git a/src/main/java/com/evaan/frostburn/module/modules/render/ClickGuiMod.java b/src/main/java/com/evaan/frostburn/module/modules/render/ClickGuiMod.java index c4eaae5..9d6f9c8 100644 --- a/src/main/java/com/evaan/frostburn/module/modules/render/ClickGuiMod.java +++ b/src/main/java/com/evaan/frostburn/module/modules/render/ClickGuiMod.java @@ -3,9 +3,6 @@ import com.evaan.frostburn.FrostBurn; import com.evaan.frostburn.module.Module; import com.evaan.frostburn.util.Setting; -import org.lwjgl.system.CallbackI; - -import java.util.ArrayList; public class ClickGuiMod extends Module { public ClickGuiMod() {super("ClickGui", Category.RENDER);} diff --git a/src/main/java/com/evaan/frostburn/module/modules/render/ImGuiMod.java b/src/main/java/com/evaan/frostburn/module/modules/render/ImGuiMod.java index 035d0a7..bd40066 100644 --- a/src/main/java/com/evaan/frostburn/module/modules/render/ImGuiMod.java +++ b/src/main/java/com/evaan/frostburn/module/modules/render/ImGuiMod.java @@ -1,6 +1,6 @@ package com.evaan.frostburn.module.modules.render; -import com.evaan.frostburn.imgui.NewGui; +import com.evaan.frostburn.clickgui.ImGuiScreen; import com.evaan.frostburn.module.Module; /** @@ -12,7 +12,7 @@ public class ImGuiMod extends Module { @Override public void onEnable() { - mc.openScreen(new NewGui()); + mc.openScreen(new ImGuiScreen()); disable(); } } diff --git a/src/main/java/com/evaan/frostburn/util/ConfigManager.java b/src/main/java/com/evaan/frostburn/util/ConfigManager.java index d25fcd8..d7f9aa5 100644 --- a/src/main/java/com/evaan/frostburn/util/ConfigManager.java +++ b/src/main/java/com/evaan/frostburn/util/ConfigManager.java @@ -4,7 +4,9 @@ import com.evaan.frostburn.module.ModuleManager; import net.minecraft.client.MinecraftClient; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; import java.util.Properties; public class ConfigManager { diff --git a/src/main/java/com/evaan/frostburn/util/Keyboard.java b/src/main/java/com/evaan/frostburn/util/Keyboard.java index a6a1560..a69bb44 100644 --- a/src/main/java/com/evaan/frostburn/util/Keyboard.java +++ b/src/main/java/com/evaan/frostburn/util/Keyboard.java @@ -31,14 +31,14 @@ */ package com.evaan.frostburn.util; +import org.lwjgl.BufferUtils; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.nio.ByteBuffer; import java.util.HashMap; import java.util.Map; -import org.lwjgl.BufferUtils; - /** *
* A raw Keyboard interface. This can be used to poll the current state of the