Skip to content

Commit

Permalink
dawsd
Browse files Browse the repository at this point in the history
  • Loading branch information
evaan committed May 7, 2021
1 parent 5713eaa commit c3bfdcc
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 48 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/evaan/frostburn/FrostBurn.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/evaan/frostburn/clickgui/ClickGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;

Expand All @@ -35,10 +30,10 @@ public class NewGui extends Screen {
private HashMap<Module, ImBoolean> enabledMap = new HashMap<>();
private HashMap<Setting, Object> 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");

Expand Down Expand Up @@ -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()));
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/evaan/frostburn/module/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Formatting;

import java.awt.*;
import java.util.ArrayList;

/**
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/evaan/frostburn/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ public class KillAura extends Module {
Setting<Boolean> switchItem = register(new Setting("Switch", this, true));
Setting<Boolean> allEntities = register(new Setting("AllEntities", this, true));
Setting<Boolean> multiAura = register(new Setting("Multi", this, true));
Setting<Boolean> 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<Entity> filtered;
Expand Down
Original file line number Diff line number Diff line change
@@ -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);}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

/**
Expand All @@ -12,7 +12,7 @@ public class ImGuiMod extends Module {

@Override
public void onEnable() {
mc.openScreen(new NewGui());
mc.openScreen(new ImGuiScreen());
disable();
}
}
4 changes: 3 additions & 1 deletion src/main/java/com/evaan/frostburn/util/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/evaan/frostburn/util/Keyboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
* <br>
* A raw Keyboard interface. This can be used to poll the current state of the
Expand Down

0 comments on commit c3bfdcc

Please sign in to comment.