Rename classes & refactor

This commit is contained in:
ThisIsALegitUsername 2023-02-02 16:17:26 +00:00
parent c05ae4dcc8
commit 6c6b2238b0
17 changed files with 58 additions and 58 deletions

View File

@ -9,7 +9,7 @@ import dev.resent.module.base.Category;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface RenderMod {
public @interface RenderModule {
String name();
Category category();
int x();

View File

@ -1,23 +1,23 @@
package dev.resent.module.base;
import dev.resent.annotation.RenderMod;
import dev.resent.annotation.RenderModule;
import dev.resent.util.render.RenderUtils;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreen;
public abstract class RenderModule extends Mod {
public abstract class RenderMod extends Mod {
public int x, y, width, height;
public int lastX;
public int lastY;
private boolean dragging;
public RenderModule(){
public RenderMod(){
super();
RenderMod modInfo;
if(getClass().isAnnotationPresent(RenderMod.class)){
modInfo = getClass().getAnnotation(RenderMod.class);
RenderModule modInfo;
if(getClass().isAnnotationPresent(RenderModule.class)){
modInfo = getClass().getAnnotation(RenderModule.class);
this.name = modInfo.name();
this.category = modInfo.category();
this.hasSetting = modInfo.hasSetting();
@ -26,13 +26,13 @@ public abstract class RenderModule extends Mod {
}
}
public RenderModule(String name, Category cat, int x, int y) {
public RenderMod(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) {
public RenderMod(String name, Category cat, int x, int y, boolean hasSetting) {
super(name, cat, hasSetting);
this.x = x;
this.y = y;

View File

@ -1,16 +1,16 @@
package dev.resent.module.impl.hud;
import dev.resent.annotation.RenderMod;
import dev.resent.annotation.RenderModule;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import dev.resent.module.setting.BooleanSetting;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.item.ItemStack;
@RenderMod(name = "ArmorHud", category = Category.HUD, x = 15, y = 4, hasSetting = true)
public class ArmorHud extends RenderModule {
@RenderModule(name = "ArmorHud", category = Category.HUD, x = 15, y = 4, hasSetting = true)
public class ArmorHud extends RenderMod {
public ScaledResolution sr;
public ArmorHud() { addSetting(helm, chestp, leg, boot, item); }

View File

@ -3,14 +3,14 @@ package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.annotation.RenderMod;
import dev.resent.annotation.RenderModule;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import dev.resent.util.misc.FuncUtils;
@RenderMod(name = "CPS", category = Category.HUD, x = 4, y = 26)
public class CPS extends RenderModule {
@RenderModule(name = "CPS", category = Category.HUD, x = 4, y = 26)
public class CPS extends RenderMod {
private List<Long> clicks = new ArrayList<>();
private boolean wasPressed;

View File

@ -1,15 +1,15 @@
package dev.resent.module.impl.hud;
import dev.resent.annotation.RenderMod;
import dev.resent.annotation.RenderModule;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.network.play.server.S19PacketEntityStatus;
@RenderMod(name = "ComboCounter", category = Category.HUD, x = 4, y = 14)
public class ComboCounter extends RenderModule {
@RenderModule(name = "ComboCounter", category = Category.HUD, x = 4, y = 14)
public class ComboCounter extends RenderMod {
public static boolean attacked = false;
public static int combo = 0;

View File

@ -1,13 +1,13 @@
package dev.resent.module.impl.hud;
import dev.resent.annotation.RenderMod;
import dev.resent.annotation.RenderModule;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import net.minecraft.client.Minecraft;
@RenderMod(name = "FPS", category = Category.HUD, x = 4, y = 38)
public class FPS extends RenderModule {
@RenderModule(name = "FPS", category = Category.HUD, x = 4, y = 38)
public class FPS extends RenderMod {
public int getWidth() { return mc.fontRendererObj.getStringWidth(getText()) + 4; }
public int getHeight() { return mc.fontRendererObj.FONT_HEIGHT + 4; }

View File

@ -2,12 +2,12 @@ package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import dev.resent.module.setting.BooleanSetting;
import dev.resent.util.render.Color;
import net.minecraft.util.BlockPos;
public class Info extends RenderModule {
public class Info extends RenderMod {
public Info() {
super("Info", Category.HUD, 150, 4);

View File

@ -3,10 +3,10 @@ package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.annotation.RenderMod;
import dev.resent.annotation.RenderModule;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting;
import dev.resent.util.misc.FuncUtils;
@ -15,8 +15,8 @@ import dev.resent.util.render.RenderUtils;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.minecraft.client.Minecraft;
@RenderMod(name = "Keystrokes", category = Category.HUD, x = 25, y = 4, hasSetting = true)
public class KeyStrokes extends RenderModule{
@RenderModule(name = "Keystrokes", category = Category.HUD, x = 25, y = 4, hasSetting = true)
public class KeyStrokes extends RenderMod{
public static KeyStrokes INSTANCE = new KeyStrokes();
private Minecraft mc = Minecraft.getMinecraft();

View File

@ -2,9 +2,9 @@ package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
public class Ping extends RenderModule {
public class Ping extends RenderMod {
public Ping() {
super("Ping Display", Category.HUD, 4, 54, true);

View File

@ -2,11 +2,11 @@ package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class PotCounter extends RenderModule {
public class PotCounter extends RenderMod {
public PotCounter() {
super("PotCounter", Category.HUD, 4, 74, true);

View File

@ -3,7 +3,7 @@ package dev.resent.module.impl.hud;
import java.util.Collection;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.client.Minecraft;
@ -16,7 +16,7 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
@SuppressWarnings("all")
public class PotionHUD extends RenderModule {
public class PotionHUD extends RenderMod {
int i2 = 16;

View File

@ -4,11 +4,11 @@ import java.text.DecimalFormat;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3;
public class ReachDisplay extends RenderModule {
public class ReachDisplay extends RenderMod {
public static final DecimalFormat df2 = new DecimalFormat("0.00");
public double range;

View File

@ -2,9 +2,9 @@ package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
public class ServerInfo extends RenderModule {
public class ServerInfo extends RenderMod {
public ServerInfo() {
super("Server info", Category.HUD, 4, 44, true);

View File

@ -2,10 +2,10 @@ package dev.resent.module.impl.movement;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import dev.resent.module.setting.BooleanSetting;
public class Sprint extends RenderModule {
public class Sprint extends RenderMod {
public BooleanSetting drawn = new BooleanSetting("Text Drawn", "", true);

View File

@ -1,7 +1,7 @@
package dev.resent.ui;
import dev.resent.Resent;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@ -21,8 +21,8 @@ public class HUDConfigScreen extends GuiScreen {
public void drawScreen(int mx, int my, float par3) {
this.drawDefaultBackground();
for (int i = 0; i < Resent.INSTANCE.modManager.modules.size(); i++) {
if (Resent.INSTANCE.modManager.modules.get(i).isEnabled() && (Resent.INSTANCE.modManager.modules.get(i) instanceof RenderModule)) {
((RenderModule) Resent.INSTANCE.modManager.modules.get(i)).renderLayout(mx, my);
if (Resent.INSTANCE.modManager.modules.get(i).isEnabled() && (Resent.INSTANCE.modManager.modules.get(i) instanceof RenderMod)) {
((RenderMod) Resent.INSTANCE.modManager.modules.get(i)).renderLayout(mx, my);
}
}
super.drawScreen(mx, my, par3);

View File

@ -31,7 +31,7 @@ import com.google.common.base.Predicates;
import dev.resent.Resent;
import dev.resent.module.base.Mod;
import dev.resent.module.base.ModManager;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import dev.resent.ui.HUDConfigScreen;
import dev.resent.util.misc.W;
import net.lax1dude.eaglercraft.v1_8.Display;
@ -886,8 +886,8 @@ public class EntityRenderer implements IResourceManagerReloadListener {
GlStateManager.enableOverlayFramebufferBlending();
this.mc.ingameGUI.renderGameOverlay(parFloat1);
for (Mod m : Resent.INSTANCE.modManager.modules) {
if (m.isEnabled() && m instanceof RenderModule && !(mc.currentScreen instanceof HUDConfigScreen)) {
((RenderModule) m).draw();
if (m.isEnabled() && m instanceof RenderMod && !(mc.currentScreen instanceof HUDConfigScreen)) {
((RenderMod) m).draw();
}
}
GlStateManager.disableOverlayFramebufferBlending();

View File

@ -7,7 +7,7 @@ import com.google.common.collect.Sets;
import dev.resent.Resent;
import dev.resent.module.base.Mod;
import dev.resent.module.base.ModManager;
import dev.resent.module.base.RenderModule;
import dev.resent.module.base.RenderMod;
import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.ModeSetting;
import dev.resent.module.setting.Setting;
@ -1052,12 +1052,12 @@ public class GameSettings {
m.setEnabled(astring[1].equals("true"));
}
List<RenderModule> rmodules = new ArrayList<>();
if (m instanceof RenderModule) {
rmodules.add((RenderModule) m);
List<RenderMod> rmodules = new ArrayList<>();
if (m instanceof RenderMod) {
rmodules.add((RenderMod) m);
}
for (RenderModule rmod : rmodules) {
for (RenderMod rmod : rmodules) {
if (astring[0].equals(rmod.name + "_x")) {
rmod.setX(Integer.parseInt(astring[1]));
}
@ -1203,12 +1203,12 @@ public class GameSettings {
for (Mod m : Resent.INSTANCE.modManager.modules) {
printwriter.println(m.name + ":" + m.isEnabled());
List<RenderModule> rmodules = new ArrayList<>();
if (m instanceof RenderModule) {
rmodules.add((RenderModule) m);
List<RenderMod> rmodules = new ArrayList<>();
if (m instanceof RenderMod) {
rmodules.add((RenderMod) m);
}
for (RenderModule rmod : rmodules) {
for (RenderMod rmod : rmodules) {
printwriter.println(rmod.name + "_x:" + rmod.getX());
printwriter.println(rmod.name + "_y:" + rmod.getY());
printwriter.println(rmod.name + "_lastx:" + rmod.lastX);