Module base + how to use it.
Here is a fully commented source dump for a module base + how to use it. (Please note this is a old one i had a while ago that i don't use anymore.
Now heres how to use it.
Thank you for reading if you actually read this instead of copying and pasting.
Also if my grammar or anything is off i'm very tired, so excuse it.
Code:
package me.slcoolj.neptune.modules.base;
public class Module
{
public String display;
public int color;
private int key;
private boolean displaying;
protected boolean enabled;
public Module(String par1Str, int par2, int par3, boolean par4)
{
this.display = par1Str;
this.color = par2;
this.key = par3; //The modules key (use keycodes)
this.displaying = par4; //The fourth parameter is to check if you want it displaying into a arraylist (make a arraylist with a check on modules being enabled)
}
/**Getters*/
public String getDisplayName(){return this.display;}
public String getConfigName(){return this.configName;}
public int getColor(){return this.color;}
public int getKey(){return this.key;}
public boolean isEnabled(){return this.enabled;}//Gets the state. i.e if(ModuleManager.hack.isEnabled())
public boolean shouldDisplay(){return this.displaying;}
/**Toggle shit*/
public void toggle()
{
this.enabled = !this.enabled;
if (this.enabled){this.onEnabled();}
else if (!this.enabled)
{this.onDisabled();}
}
public void toggleOff()
{this.enabled = false; this.onDisabled();}
public void toggleOn()
{this.enabled = true; this.onEnabled();}
/**On'ers? idfk*/
public void onEnabled()
{this.enabled = true;}
public void onDisabled()
{this.enabled = false;}
/**All the stuff that will do certain things depending on what hook is put into them by a hook.java class*/
public void preMotionUpdate() {}//Before the motion update in entityclientplayer
public void postMotionUpdate() {}//After the motion update in entityclient player
public void on********date() {}//onUpdate in EntityClientPlayer or in EntityPlayerSP it's LivingUpdate or something
public void onCommand(String var1) {}//if(par1Str.startsWith(.) && !par1Str.startsWith(.); something like that i don't remember in the onSendMessage or something. Entityclientplayer
//Do more for yourself!
}
Code:
package me.slcoolj.neptune.modules.example;
import me.slcoolj.neptune.modules.base;
import net.minecraft.client.*;
public class Example extends Module{
public Example(){
super("Example", 0xFFFFFF, 33/**This keycode is F*/, true);
}
private Minecraft mc = Minecraft.getMinecraft();
@override
public void onEnabled(){
mc.thePlayer.addChatMessage("ERMAHGERD MERDULE");
}
Also if my grammar or anything is off i'm very tired, so excuse it.