Port crosshair
This commit is contained in:
parent
58b579a1eb
commit
a143a161ab
|
@ -1,15 +1,14 @@
|
||||||
package dev.resent.module.impl.misc;
|
package dev.resent.module.impl.misc;
|
||||||
|
|
||||||
|
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.module.setting.ModeSetting;
|
import dev.resent.module.setting.ModeSetting;
|
||||||
|
|
||||||
|
@Module(name = "Crosshair", category = Category.MISC, hasSetting = true)
|
||||||
public class Crosshair extends Mod {
|
public class Crosshair extends Mod {
|
||||||
|
|
||||||
public Crosshair() {
|
public Crosshair() { addSetting(color); }
|
||||||
super("Crosshair", Category.MISC, true);
|
|
||||||
addSetting(color);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ModeSetting color = new ModeSetting("Hovered crosshair color", "", "White", "Red", "Yellow", "Green", "Blue", "Black");
|
public static ModeSetting color = new ModeSetting("Hovered crosshair color", "", "White", "Red", "Yellow", "Green", "Blue", "Black");
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,9 +325,10 @@ public class GuiIngame extends Gui {
|
||||||
GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0);
|
GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0);
|
||||||
GlStateManager.enableAlpha();
|
GlStateManager.enableAlpha();
|
||||||
|
|
||||||
if (Minecraft.getMinecraft().pointedEntity != null && ModManager.crosshair.isEnabled()){
|
if (ModManager.crosshair.isEnabled()){
|
||||||
GlStateManager.color(RenderUtils.getColorWithoutRGB(Crosshair.color).getRed(), RenderUtils.getColorWithoutRGB(Crosshair.color).getGreen(), RenderUtils.getColorWithoutRGB(Crosshair.color).getBlue());
|
|
||||||
GlStateManager.disableAlpha();
|
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);
|
this.drawTexturedModalRect(scaledResWidth / 2 - 7, scaledResHeight / 2 - 7, 0, 0, 16, 16);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user