Register the mod and add customizable colors

This commit is contained in:
ThisIsALegitUsername 2023-01-09 03:54:28 +00:00
parent c302639cdf
commit 587099f8a4
11 changed files with 65978 additions and 65807 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -23,6 +23,7 @@ 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;
@ -81,6 +82,7 @@ public class ModManager {
public static PotCounter potCounter;
public static Ping ping;
public static ServerInfo serverInfo;
public static Crosshair crosshair = new Crosshair();
public ModManager() {
@ -104,6 +106,7 @@ public class ModManager {
//Mechanic
register(crosshair);
register(fullbright = new Fullbright());
register(noSwingDelay = new NoSwingDelay());
register(minimalViewBobbing);

View File

@ -0,0 +1,15 @@
package dev.resent.module.impl.misc;
import dev.resent.module.base.Category;
import dev.resent.module.base.Mod;
import dev.resent.setting.ModeSetting;
public class Crosshair extends Mod{
public Crosshair(){
super("Crosshair", Category.MISC, true);
addSetting(color);
}
public static ModeSetting color = new ModeSetting("Hovered crosshair color", "", "White", "Red", "Yellow", "Green", "Blue", "Pink", "Orange", "Black");
}

View File

@ -15,9 +15,12 @@ import com.google.common.collect.Lists;
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.impl.misc.Crosshair;
import dev.resent.ui.mods.HUDConfigScreen;
import dev.resent.util.misc.W;
import dev.resent.util.render.RenderUtils;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -171,12 +174,15 @@ public class GuiIngame extends Gui {
GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0);
GlStateManager.enableAlpha();
Minecraft mc = Minecraft.getMinecraft();
Entity target = mc.getRenderViewEntity();
Entity target = mc.pointedEntity;
if(target == null)
if(target != null && ModManager.crosshair.isEnabled())
GlStateManager.color(RenderUtils.getColorWithoutRGB(Crosshair.color).getRed(), RenderUtils.getColorWithoutRGB(Crosshair.color).getBlue(), RenderUtils.getColorWithoutRGB(Crosshair.color).getGreen(), 1);
this.drawTexturedModalRect(i / 2 - 7, j / 2 - 7, 0, 0, 16, 16);
}
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
this.mc.mcProfiler.startSection("bossHealth");
this.renderBossHealth();