Annotation base for rendermodules

This commit is contained in:
ThisIsALegitUsername 2023-02-01 14:46:14 +00:00
parent e8ce550cae
commit 757e8b96a2
6 changed files with 29663 additions and 29606 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,18 @@
package dev.resent.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import dev.resent.module.base.Category;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface RenderMod {
String name();
Category category();
int x();
int y();
boolean hasSetting();
}

View File

@ -1,5 +1,6 @@
package dev.resent.module.base; package dev.resent.module.base;
import dev.resent.annotation.RenderMod;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
@ -10,8 +11,20 @@ public class RenderModule extends Mod {
public int lastX; public int lastX;
public int lastY; public int lastY;
private boolean dragging; private boolean dragging;
public boolean hasSetting;
public RenderModule(){
super();
RenderMod modInfo;
if(getClass().isAnnotationPresent(RenderMod.class)){
modInfo = getClass().getAnnotation(RenderMod.class);
this.name = modInfo.name();
this.category = modInfo.category();
this.hasSetting = modInfo.hasSetting();
this.x = modInfo.x();
this.y = modInfo.y();
}
}
public RenderModule(String name, Category cat, int x, int y) { public RenderModule(String name, Category cat, int x, int y) {
super(name, cat); super(name, cat);
this.x = x; this.x = x;

View File

@ -1,6 +1,6 @@
package dev.resent.module.impl.hud; package dev.resent.module.impl.hud;
import dev.resent.Resent; import dev.resent.annotation.Module;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.util.misc.W; import dev.resent.util.misc.W;
@ -8,6 +8,7 @@ import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@SuppressWarnings("all") @SuppressWarnings("all")
@Module(name = "Freelook", category = Category.HUD)
public class Freelook extends Mod { public class Freelook extends Mod {
public static float cameraYaw = 0.0F; public static float cameraYaw = 0.0F;

View File

@ -3,6 +3,7 @@ package dev.resent.module.impl.hud;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import dev.resent.annotation.RenderMod;
import dev.resent.module.Theme; import dev.resent.module.Theme;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
@ -14,13 +15,13 @@ import dev.resent.util.render.RenderUtils;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@RenderMod(name = "Keystrokes", category = Category.HUD, x = 25, y = 4, hasSetting = true)
public class KeyStrokes extends RenderModule{ public class KeyStrokes extends RenderModule{
public static KeyStrokes INSTANCE = new KeyStrokes(); public static KeyStrokes INSTANCE = new KeyStrokes();
private Minecraft mc = Minecraft.getMinecraft(); private Minecraft mc = Minecraft.getMinecraft();
public KeyStrokes(){ public KeyStrokes(){
super("Keystrokes", Category.HUD, 25, 4, true);
addSetting(sneak, jump, color, colorp, gcolor, gcolorp); addSetting(sneak, jump, color, colorp, gcolor, gcolorp);
} }
@ -138,21 +139,21 @@ public class KeyStrokes extends RenderModule{
switch (asdf.getValue()) { switch (asdf.getValue()) {
case "Red": case "Red":
return new Color(255, 0, 0, 140).getRGB(); return new Color(255, 0, 0, 208).getRGB();
case "Yellow": case "Yellow":
return new Color(255, 255, 0, 140).getRGB(); return new Color(255, 255, 0, 208).getRGB();
case "Green": case "Green":
return new Color(0, 255, 0, 140).getRGB(); return new Color(0, 255, 0, 208).getRGB();
case "Blue": case "Blue":
return new Color(0, 0, 255, 140).getRGB(); return new Color(0, 0, 255, 208).getRGB();
case "Orange": case "Orange":
return new Color(255, 165, 0, 140).getRGB(); return new Color(255, 165, 0, 208).getRGB();
case "Pink": case "Pink":
return new Color(255, 102, 255, 140).getRGB(); return new Color(255, 102, 255, 208).getRGB();
case "Black": case "Black":
return new Color(0, 0, 0, 140).getRGB(); return new Color(0, 0, 0, 208).getRGB();
case "White": case "White":
return new Color(255, 255, 255, 140).getRGB(); return new Color(255, 255, 255, 208).getRGB();
} }
return -1; return -1;
} }