Archive eaglercraft-archive-resent-3-3-source (source, 1.8.8, clean)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package dev.resent.module.base;
|
||||
|
||||
public enum Category {
|
||||
HUD("Hud"),
|
||||
MOVEMENT("Movement"),
|
||||
MISC("Misc");
|
||||
|
||||
public final String name;
|
||||
Category(String name){
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package dev.resent.module.base;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import dev.resent.Resent;
|
||||
import dev.resent.event.impl.Event;
|
||||
import dev.resent.setting.Setting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class Mod {
|
||||
|
||||
public Minecraft mc = Minecraft.getMinecraft();
|
||||
public int keyCode;
|
||||
|
||||
public String name;
|
||||
public Category category;
|
||||
public boolean enabled = false;
|
||||
public boolean hasSetting;
|
||||
|
||||
public List<Setting> settings = new ArrayList<>();
|
||||
|
||||
public Mod(String name, Category cat) {
|
||||
this.name = name;
|
||||
this.category = cat;
|
||||
}
|
||||
|
||||
public Mod(String name, Category cat, boolean hasSetting) {
|
||||
this.name = name;
|
||||
this.category = cat;
|
||||
this.hasSetting = hasSetting;
|
||||
}
|
||||
|
||||
public void addSetting(Setting... settings) {
|
||||
this.settings.addAll(Arrays.asList(settings));
|
||||
}
|
||||
|
||||
public void onEnable() { }
|
||||
public void onDisable() { }
|
||||
|
||||
public void toggle() {
|
||||
this.enabled = !this.enabled;
|
||||
if (this.enabled){
|
||||
onEnable();
|
||||
}else{
|
||||
onDisable();
|
||||
}
|
||||
}
|
||||
|
||||
public void onEvent(Event e){
|
||||
for(int i = 0; i < Resent.INSTANCE.modManager.modules.size(); i++){
|
||||
if(!Resent.INSTANCE.modManager.modules.get(i).isEnabled())
|
||||
continue;
|
||||
|
||||
Resent.INSTANCE.modManager.modules.get(i).onEvent(e);
|
||||
}
|
||||
}
|
||||
public void setEnabled(boolean state) {
|
||||
this.enabled = state;
|
||||
if (this.enabled)
|
||||
onEnable();
|
||||
else
|
||||
onDisable();
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package dev.resent.module.base;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import dev.resent.module.impl.hud.ArmorHud;
|
||||
import dev.resent.module.impl.hud.CPS;
|
||||
import dev.resent.module.impl.hud.ComboCounter;
|
||||
import dev.resent.module.impl.hud.FPS;
|
||||
import dev.resent.module.impl.hud.Freelook;
|
||||
import dev.resent.module.impl.hud.Health;
|
||||
import dev.resent.module.impl.hud.Hitboxes;
|
||||
import dev.resent.module.impl.hud.Info;
|
||||
import dev.resent.module.impl.hud.KeyStrokes;
|
||||
import dev.resent.module.impl.hud.Ping;
|
||||
import dev.resent.module.impl.hud.PotCounter;
|
||||
import dev.resent.module.impl.hud.PotionHUD;
|
||||
import dev.resent.module.impl.hud.ReachDisplay;
|
||||
import dev.resent.module.impl.hud.ServerInfo;
|
||||
import dev.resent.module.impl.hud.Watermark;
|
||||
import dev.resent.module.impl.misc.Animations;
|
||||
import dev.resent.module.impl.misc.AutoGG;
|
||||
import dev.resent.module.impl.misc.AutoRespawn;
|
||||
import dev.resent.module.impl.misc.ClearChat;
|
||||
import dev.resent.module.impl.misc.Crosshair;
|
||||
import dev.resent.module.impl.misc.DynamicFOV;
|
||||
import dev.resent.module.impl.misc.FPSB;
|
||||
import dev.resent.module.impl.misc.Fullbright;
|
||||
import dev.resent.module.impl.misc.MinimalViewBobbing;
|
||||
import dev.resent.module.impl.misc.NoHurtCam;
|
||||
import dev.resent.module.impl.misc.NoParticles;
|
||||
import dev.resent.module.impl.misc.NoRain;
|
||||
import dev.resent.module.impl.misc.NoSwingDelay;
|
||||
import dev.resent.module.impl.misc.Scoreboard;
|
||||
import dev.resent.module.impl.misc.SelfNametag;
|
||||
import dev.resent.module.impl.misc.Tooltips;
|
||||
import dev.resent.module.impl.movement.Sprint;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class ModManager {
|
||||
|
||||
public List<Mod> modules = new ArrayList<>();
|
||||
public Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
public static String currentModDragging = null;
|
||||
|
||||
public static Sprint sprint;
|
||||
public static CPS cps;
|
||||
public static KeyStrokes keyStrokes;
|
||||
public static Fullbright fullbright;
|
||||
public static ArmorHud armorHud;
|
||||
public static NoRain noRain = new NoRain();
|
||||
public static DynamicFOV dynamicFOV = new DynamicFOV();
|
||||
public static PotionHUD potionHud;
|
||||
public static NoHurtCam noHurtCam = new NoHurtCam();
|
||||
public static Info coordinate;
|
||||
public static FPS fps;
|
||||
public static ReachDisplay reachDisplay;
|
||||
public static AutoGG autoGG;
|
||||
public static Freelook freelook;
|
||||
public static ComboCounter comboCounter = new ComboCounter();
|
||||
public static Hitboxes hitboxes = new Hitboxes();
|
||||
public static Health health;
|
||||
public static AutoRespawn autoRespawn;
|
||||
//public static ChunkBorders chunkBorders;
|
||||
public static NoParticles noParticles = new NoParticles();
|
||||
public static Scoreboard scoreboard = new Scoreboard();
|
||||
public static SelfNametag selfNametag = new SelfNametag();
|
||||
public static ClearChat clearChat = new ClearChat();
|
||||
public static Tooltips tooltips;
|
||||
public static FPSB fpsb = new FPSB();
|
||||
public static Animations animations = new Animations();
|
||||
public static MinimalViewBobbing minimalViewBobbing = new MinimalViewBobbing();
|
||||
public static Watermark watermark;
|
||||
public static NoSwingDelay noSwingDelay;
|
||||
public static PotCounter potCounter;
|
||||
public static Ping ping;
|
||||
public static ServerInfo serverInfo;
|
||||
public static Crosshair crosshair = new Crosshair();
|
||||
|
||||
public ModManager() {
|
||||
|
||||
//Hud
|
||||
register(ping = new Ping());
|
||||
register(serverInfo = new ServerInfo());
|
||||
register(watermark = new Watermark());
|
||||
register(freelook = new Freelook());
|
||||
register(fpsb);
|
||||
register(keyStrokes = new KeyStrokes());
|
||||
register(armorHud = new ArmorHud());
|
||||
register(cps = new CPS());
|
||||
register(potionHud = new PotionHUD());
|
||||
register(reachDisplay = new ReachDisplay());
|
||||
register(comboCounter);
|
||||
register(coordinate = new Info());
|
||||
register(fps = new FPS());
|
||||
register(health = new Health());
|
||||
register(potCounter = new PotCounter());
|
||||
|
||||
|
||||
//Mechanic
|
||||
register(crosshair);
|
||||
register(autoRespawn = new AutoRespawn());
|
||||
register(fullbright = new Fullbright());
|
||||
register(noSwingDelay = new NoSwingDelay());
|
||||
register(minimalViewBobbing);
|
||||
register(noRain);
|
||||
register(dynamicFOV);
|
||||
register(sprint = new Sprint());
|
||||
register(noHurtCam);
|
||||
register(autoGG = new AutoGG());
|
||||
register(hitboxes);
|
||||
//register(chunkBorders = new ChunkBorders());
|
||||
register(noParticles);
|
||||
register(scoreboard );
|
||||
//register(selfNametag = new SelfNametag());
|
||||
register(clearChat);
|
||||
register(tooltips = new Tooltips());
|
||||
register(animations);
|
||||
|
||||
}
|
||||
|
||||
public void register(Mod m) {
|
||||
this.modules.add(m);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package dev.resent.module.base;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.Mouse;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
public class RenderModule extends Mod {
|
||||
|
||||
public int x, y, width, height;
|
||||
public int lastX;
|
||||
public int lastY;
|
||||
private boolean dragging;
|
||||
public boolean hasSetting;
|
||||
|
||||
public RenderModule(String name, Category cat, int x, int y) {
|
||||
super(name, cat);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public RenderModule(String name, Category cat, int x, int y, boolean hasSetting) {
|
||||
super(name, cat, hasSetting);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.hasSetting = hasSetting;
|
||||
}
|
||||
|
||||
public void draw() { }
|
||||
|
||||
public void resize() {
|
||||
if ((getX() + getWidth()) > GuiScreen.width) {
|
||||
this.x = GuiScreen.width - getWidth();
|
||||
dragging = false;
|
||||
} else if ((getY() + getHeight()) > GuiScreen.height) {
|
||||
this.y = GuiScreen.height - getHeight();
|
||||
dragging = false;
|
||||
} else if ((getX()) < 0) {
|
||||
this.x = 0;
|
||||
dragging = false;
|
||||
} else if ((getY()) < 0) {
|
||||
this.y = 0;
|
||||
dragging = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void draggingFix(int mouseX, int mouseY) {
|
||||
if (this.dragging) {
|
||||
this.x = mouseX + this.lastX;
|
||||
this.y = mouseY + this.lastY;
|
||||
if(!Mouse.isButtonDown(0)) this.dragging = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void renderLayout(int mouseX, int mouseY) {
|
||||
|
||||
resize();
|
||||
draw();
|
||||
draggingFix(mouseX, mouseY);
|
||||
|
||||
boolean hovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + getWidth()
|
||||
&& mouseY < getY() + this.getHeight();
|
||||
|
||||
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + this.getHeight(), hovered ? 0x50FFFFFF : 0x40FFFFFF);
|
||||
Gui.drawRect(this.x, this.y, this.x + this.getWidth(), this.y + 1, -1);
|
||||
Gui.drawRect(this.x, this.y, this.x + 1, this.y + getHeight(), -1);
|
||||
Gui.drawRect(this.x + this.getWidth() - 1, this.y, this.x + getWidth(), this.y + this.getHeight(), -1);
|
||||
Gui.drawRect(this.x, this.y + this.getHeight() - 1, this.x + getWidth(), this.y + this.getHeight(), -1);
|
||||
|
||||
boolean mouseOverX = (mouseX >= this.getX() && mouseX <= this.getX()+this.getWidth());
|
||||
boolean mouseOverY = (mouseY >= this.getY() && mouseY <= this.getY()+this.getHeight());
|
||||
if(mouseOverX && mouseOverY){
|
||||
if(Mouse.isButtonDown(0)){
|
||||
if (!this.dragging) {
|
||||
this.lastX = x - mouseX;
|
||||
this.lastY = y - mouseY;
|
||||
this.dragging = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user