Skip to content

Commit

Permalink
Agalar Hack 0.0.2
Browse files Browse the repository at this point in the history
- Fixed binds
- Fixed toggles
- Fixed more stuff
- Added speed
  • Loading branch information
MrHakan committed Nov 20, 2020
1 parent 9f1dc05 commit 766a53b
Show file tree
Hide file tree
Showing 17 changed files with 212 additions and 179 deletions.
55 changes: 25 additions & 30 deletions src/main/java/me/mrhakan/agalarhack/Main.java
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
package me.mrhakan.agalarhack;

import net.minecraftforge.fml.common.gameevent.InputEvent;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;

import me.mrhakan.agalarhack.commands.CommandManager;
import me.mrhakan.agalarhack.managers.CommandManager;
import me.mrhakan.agalarhack.managers.SettingsManager;
import me.mrhakan.agalarhack.module.Module;
import me.mrhakan.agalarhack.module.ModuleManager;
import me.mrhakan.agalarhack.proxy.CommonProxy;
import me.mrhakan.agalarhack.managers.ModuleManager;
import me.mrhakan.agalarhack.ui.Hud;
import me.mrhakan.agalarhack.util.Reference;
import net.minecraft.client.Minecraft;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent;

@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION)
@Mod(
modid = "agh",
name = "Agalar Hack",
version = "0.0.2")
public class Main {

public static final String discordid = "";
public static String prefix = ".";

public static String name = "Agalar Hack";
public static String modid = "agh";
public static String currentvers = "0.0.2";
public static String prefix = ".";

public static Minecraft mc = Minecraft.getMinecraft();

public static ModuleManager moduleManager = new ModuleManager();
public static final SettingsManager SETTINGS_MANAGER = new SettingsManager();
public static Hud hud;

@Instance
public Main instance;

@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.COMMON_PROXY_CLASS)
public static CommonProxy proxy;


@EventHandler
public void PreInit (FMLPreInitializationEvent event) {
Display.setTitle(Reference.NAME + " " + Reference.VERSION);
Display.setTitle(name + " " + currentvers);
}

@EventHandler
Expand All @@ -49,6 +50,7 @@ public void init (FMLPreInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(new Hud());
moduleManager = new ModuleManager();
hud = new Hud();

}

@EventHandler
Expand All @@ -57,25 +59,18 @@ public void PostInit (FMLPreInitializationEvent event) {
CommandManager.init();
MinecraftForge.EVENT_BUS.register(new CommandManager());
MinecraftForge.EVENT_BUS.register(this);

}

@SubscribeEvent
public void key(KeyInputEvent e) {
if(Minecraft.getMinecraft().world == null || Minecraft.getMinecraft().player == null)
return;
try {
if(Keyboard.isCreated()) {
if(Keyboard.getEventKeyState() ) {
int keyCode = Keyboard.getEventKey();
if(keyCode<= 0)
return;
for(Module m : moduleManager.modules) {
if(m.getKey() == keyCode && keyCode > 0) {
m.toggle();
}
}
}

public void onKeyPress(InputEvent.KeyInputEvent event) {
for (Module m: moduleManager.getModuleList()) {
if(Keyboard.isKeyDown(m.getKey())){
m.toggle();

}
} catch (Exception q) { q.printStackTrace(); }

}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package me.mrhakan.agalarhack.commands;
package me.mrhakan.agalarhack.managers;

import java.util.HashSet;

import me.mrhakan.agalarhack.Main;
import me.mrhakan.agalarhack.commands.Command;
import me.mrhakan.agalarhack.commands.Commands.bind;
import me.mrhakan.agalarhack.commands.Commands.toggle;
import net.minecraftforge.client.event.ClientChatEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package me.mrhakan.agalarhack.module;
package me.mrhakan.agalarhack.managers;

import java.util.ArrayList;
import java.util.List;

import me.mrhakan.agalarhack.Main;
import me.mrhakan.agalarhack.module.Category;
import me.mrhakan.agalarhack.module.Module;
import me.mrhakan.agalarhack.module.combat.*;
import me.mrhakan.agalarhack.module.movement.*;
import me.mrhakan.agalarhack.module.render.*;
Expand All @@ -15,18 +17,19 @@ public class ModuleManager {
public ModuleManager() {
(modules = new ArrayList<Module>()).clear();
//COMBAT
this.modules.add(new AutoCrystal());
//EXPLOITS
this.modules.add(new Aura());
//EXPLOIT

//MISC

//MOVEMENT
this.modules.add(new Sprint());
this.modules.add(new Speed());
this.modules.add(new Flight());
this.modules.add(new Jesus());
//RENDER
this.modules.add(new Fullbright());
//WORLD

}

public Module getModule (String name) {
Expand Down
152 changes: 72 additions & 80 deletions src/main/java/me/mrhakan/agalarhack/module/Module.java
Original file line number Diff line number Diff line change
@@ -1,107 +1,99 @@
package me.mrhakan.agalarhack.module;

import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.lwjgl.input.Keyboard;

import me.mrhakan.agalarhack.Main;
import me.mrhakan.agalarhack.managers.Settings;
import net.minecraftforge.common.MinecraftForge;

public class Module {

public String name, description;
private int key;
protected Minecraft mc = Minecraft.getMinecraft();

private String name, displayName;
private Category category;
public boolean toggled;
private boolean toggled;
public Settings settings = new Settings();

public Module(String name, String description, Category category) {
super();
this.name = name;
this.description = description;
this.category = category;
this.key = 0;
this.toggled = false;
}



public Module(String name , Category category){
this.name = name;
this.category = category;
toggled = false;

}
public void registerSettings() {
settings.addSetting("enabled", false);
settings.addSetting("keybind", String.valueOf(Keyboard.KEY_NONE));
selfSettings();
Main.SETTINGS_MANAGER.updateSettings();

}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public void setSettings(Settings newSettings) {
settings = newSettings;
}

public int getKey() {
return key;
}

public void setKey(int key) {
this.key = key;
}

public boolean isToggled() {
return toggled;
settings.addSetting("enabled", false);
settings.addSetting("keybind", String.valueOf(Keyboard.KEY_NONE));
selfSettings();
Main.SETTINGS_MANAGER.updateSettings();

}

public void setToggled(boolean toggled) {
this.toggled = toggled;

if(this.toggled) {
this.onEnable();
}else {
this.onDisable();
}
public void onEnable() {
MinecraftForge.EVENT_BUS.register(this);
}

public void onDisable() {
MinecraftForge.EVENT_BUS.unregister(this);
}
@SubscribeEvent
public void gameTickEvent(TickEvent event) {

if(this.isToggled()) onUpdate();

onUpdate();
}

public void setSettings(Settings newSettings) {
settings = newSettings;
}
public void onUpdate() {
}

public void selfSettings() {

}

public void onToggle() {

}


public void onToggle() {}
public void toggle() {
toggled = !toggled;
onToggle();
if (toggled) {
onEnable();
settings.setSetting("enabled", true);
Main.SETTINGS_MANAGER.updateSettings();
onToggle();
if (toggled) {
onEnable();
settings.setSetting("enabled", true);
Main.SETTINGS_MANAGER.updateSettings();

} else {
onDisable();
settings.setSetting("enabled", false);
Main.SETTINGS_MANAGER.updateSettings();
} else {
onDisable();
settings.setSetting("enabled", false);
Main.SETTINGS_MANAGER.updateSettings();

}
}
}

public void onEnable() {
MinecraftForge.EVENT_BUS.register(this);
public Integer getKey(){
return Integer.parseInt(settings.getSetting("keybind").toString());
}

public void onDisable() {
MinecraftForge.EVENT_BUS.unregister(this);
}

public String getName() {
return this.name;
return name;
}
public void setName(String name) {
this.name = name;
}

public Category getCategory() {
return this.category;
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public boolean isToggled() {
return toggled;
}
public String getDisplayName() {
return displayName == null ? name : displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
}
public void setup() {}
}
14 changes: 14 additions & 0 deletions src/main/java/me/mrhakan/agalarhack/module/combat/Aura.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package me.mrhakan.agalarhack.module.combat;

import me.mrhakan.agalarhack.module.Category;
import me.mrhakan.agalarhack.module.Module;

public class Aura extends Module {

public Aura() {
super("Aura", Category.COMBAT);
}



}
12 changes: 0 additions & 12 deletions src/main/java/me/mrhakan/agalarhack/module/combat/AutoCrystal.java

This file was deleted.

Loading

0 comments on commit 766a53b

Please sign in to comment.