Quick crosshair blending fix.

This commit is contained in:
ThisIsALegitUsername 2023-01-10 21:54:26 +00:00
parent 4079610786
commit b9748318fd
13 changed files with 27747 additions and 27742 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
cd javascript cd javascript
rm EaglercraftX_1.8_Offline_en.html rm EaglercraftX_1.8_Offline_en_US.html
rm EaglercraftX_1.8_Offline_International.html rm EaglercraftX_1.8_Offline_International.html
../MakeOfflineDownload.sh ../MakeOfflineDownload.sh
mv EaglercraftX_1.8_Offline_en_US.html Resent_EaglercraftX_1.8_US.html
mv EaglercraftX_1.8_Offline_International.html Resent_EaglercraftX_1.8_International.html

View File

@ -4,82 +4,78 @@ import java.util.Collection;
import dev.resent.module.base.Category; import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule; import dev.resent.module.base.RenderModule;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.resources.I18n;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.StatCollector; import net.minecraft.util.ResourceLocation;
@SuppressWarnings("all") @SuppressWarnings("all")
public class PotionHUD extends RenderModule{ public class PotionHUD extends RenderModule{
public Minecraft mc = Minecraft.getMinecraft(); protected float zLevelFloat;
public FontRenderer fr;
public ScaledResolution sr;
public PotionHUD() { public PotionHUD() {
super("PotionHUD", Category.HUD, 4, 350); super("PotionHUD", Category.HUD, 4, 350);
} }
@Override public int getWidth() {
public void renderLayout(int mouseX, int mouseY) { return 100;
fr = mc.fontRendererObj;
super.renderLayout(mouseX, mouseY);
fr.drawStringWithShadow("PotionHUD", getX() + getWidth() / 2 - ((getWidth() - 10) / 2),
getY() + (getHeight() / 2 - fr.FONT_HEIGHT / 2), -1);
} }
@Override
public int getHeight() { public int getHeight() {
fr = mc.fontRendererObj; return 90;
return fr.FONT_HEIGHT + 3;
} }
@Override
public void draw() { public void draw() {
this.setHeight(20); int offsetX = 21;
this.setWidth(mc.fontRendererObj.getStringWidth("Resistance VII") + 2); int offsetY = 14;
sr = new ScaledResolution(mc); int i = 80;
Collection<PotionEffect> effects = mc.thePlayer.getActivePotionEffects(); int i2 = 16;
int potcount = 0; Collection<PotionEffect> collection = mc.thePlayer.getActivePotionEffects();
if (!collection.isEmpty()) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
int l = 33;
if (collection.size() > 5)
l = 132 / (collection.size() - 1);
for (PotionEffect potioneffect : mc.thePlayer.getActivePotionEffects()) {
Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
if (potion.hasStatusIcon()) {
GuiIngame guiIngame = new GuiIngame(mc);
GlStateManager.tryBlendFuncSeparate(775, 769, 1, 0);
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/inventory.png"));
int i3 = potion.getStatusIconIndex();
for (PotionEffect e : effects) { guiIngame.drawTexturedModalRect(getX() + 21 - 20, getY() + i2 - 20, 0 + i3 % 8 * 18, 198 + i3 / 8 * 18, 18, 18);
if (!effects.isEmpty()) { }
String eName = StatCollector.translateToLocal(e.getEffectName()); String s1 = I18n.format(potion.getName(), new Object[0]);
String duration = Potion.getDurationString(e); if (potioneffect.getAmplifier() == 1) {
int amp = e.getAmplifier() + 1; s1 = "I";
String ampString = ("" + amp); } else if (potioneffect.getAmplifier() == 2) {
s1 = "II";
if (amp == 1) { } else if (potioneffect.getAmplifier() == 3) {
ampString = "I"; s1 = "III";
} else if (amp == 2) { } else if (potioneffect.getAmplifier() == 4) {
ampString = "II"; s1 = "IV";
} else if (amp == 3) { } else if (potioneffect.getAmplifier() == 5) {
ampString = "III"; s1 = "V";
} else if (amp == 4) {
ampString = "IV";
} else if (amp == 5) {
ampString = "V";
} else { } else {
ampString = ("" + amp); s1 = ("" + potioneffect.getAmplifier());
} }
Potion var8 = Potion.potionTypes[e.getPotionID()]; mc.fontRendererObj.drawString(s1, (getX() + 21), (getY() + i2 - 20), 16777215, true);
/*if (var8.hasStatusIcon()) { String s2 = Potion.getDurationString(potioneffect);
int var9 = var8.getStatusIconIndex(); mc.fontRendererObj.drawString(s2, (getX() + 21), (getY() + i2 + 10 - 20), 8355711, true);
guiScreen.drawTexturedModalRect(this.x, this.y+ 4, 0 + var9 % 8 * 18, 198 + var9 / 8 * 18, 18, 18); i2 += l;
}*/
fr = mc.fontRendererObj;
String toDraw = "§4" + eName + "§r §a" + ampString + " §9" + duration;
fr.drawStringWithShadow(toDraw, this.x + 2, this.y + (potcount * 10) -5, -1);
this.setHeight((potcount * 10) + 10);
potcount++;
} }
} }
super.draw();
} }
} }

View File

@ -171,10 +171,11 @@ public class GuiIngame extends Gui {
GlStateManager.enableBlend(); GlStateManager.enableBlend();
if (this.showCrosshair()) { if (this.showCrosshair()) {
//GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0);
GlStateManager.enableAlpha();
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
Entity target = mc.pointedEntity; Entity target = mc.pointedEntity;
if(!ModManager.crosshair.isEnabled())
GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, 1, 0);
GlStateManager.enableAlpha();
if(target != null && ModManager.crosshair.isEnabled()) if(target != null && ModManager.crosshair.isEnabled())
GlStateManager.color(RenderUtils.getColorWithoutRGB(Crosshair.color).getRed(), RenderUtils.getColorWithoutRGB(Crosshair.color).getGreen(), RenderUtils.getColorWithoutRGB(Crosshair.color).getBlue()); GlStateManager.color(RenderUtils.getColorWithoutRGB(Crosshair.color).getRed(), RenderUtils.getColorWithoutRGB(Crosshair.color).getGreen(), RenderUtils.getColorWithoutRGB(Crosshair.color).getBlue());