Port crosshair

This commit is contained in:
ThisIsALegitUsername 2023-02-02 16:36:14 +00:00
parent 58b579a1eb
commit a143a161ab
2 changed files with 6 additions and 6 deletions

View File

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

View File

@ -325,9 +325,10 @@ public class GuiIngame extends Gui {
GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0);
GlStateManager.enableAlpha();
if (Minecraft.getMinecraft().pointedEntity != null && ModManager.crosshair.isEnabled()){
GlStateManager.color(RenderUtils.getColorWithoutRGB(Crosshair.color).getRed(), RenderUtils.getColorWithoutRGB(Crosshair.color).getGreen(), RenderUtils.getColorWithoutRGB(Crosshair.color).getBlue());
if (ModManager.crosshair.isEnabled()){
GlStateManager.disableAlpha();
if(Minecraft.getMinecraft().pointedEntity != null)
GlStateManager.color(RenderUtils.getColorWithoutRGB(Crosshair.color).getRed(), RenderUtils.getColorWithoutRGB(Crosshair.color).getGreen(), RenderUtils.getColorWithoutRGB(Crosshair.color).getBlue());
}
this.drawTexturedModalRect(scaledResWidth / 2 - 7, scaledResHeight / 2 - 7, 0, 0, 16, 16);