ForgePatch/patches/minecraft/net/minecraft/client/gui/IngameGui.java.patch

43 lines
2.0 KiB
Diff

--- a/net/minecraft/client/gui/IngameGui.java
+++ b/net/minecraft/client/gui/IngameGui.java
@@ -406,6 +406,9 @@
for(EffectInstance effectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
Effect effect = effectinstance.func_188419_a();
+ if (!effectinstance.shouldRenderHUD()) continue;
+ // Rebind in case previous renderHUDEffect changed texture
+ this.field_73839_d.func_110434_K().func_110577_a(ContainerScreen.field_147001_a);
if (effectinstance.func_205348_f()) {
int k = this.field_194811_H;
int l = 1;
@@ -443,6 +446,7 @@
RenderSystem.color4f(1.0F, 1.0F, 1.0F, f1);
blit(j1 + 3, k1 + 3, this.getBlitOffset(), 18, 18, textureatlassprite);
});
+ effectinstance.renderHUDEffect(this, k, l, this.getBlitOffset(), f);
}
}
@@ -568,6 +572,7 @@
}
String s = itextcomponent.func_150254_d();
+ s = this.field_92016_l.getHighlightTip(s);
int i = (this.field_194811_H - this.func_175179_f().func_78256_a(s)) / 2;
int j = this.field_194812_I - 59;
if (!this.field_73839_d.field_71442_b.func_78755_b()) {
@@ -584,7 +589,13 @@
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
fill(i - 2, j - 2, i + this.func_175179_f().func_78256_a(s) + 2, j + 9 + 2, this.field_73839_d.field_71474_y.func_216839_a(0));
+ FontRenderer font = field_92016_l.func_77973_b().getFontRenderer(field_92016_l);
+ if (font == null) {
this.func_175179_f().func_175063_a(s, (float)i, (float)j, 16777215 + (k << 24));
+ } else {
+ i = (this.field_194811_H - font.func_78256_a(s)) / 2;
+ font.func_175063_a(s, (float)i, (float)j, 16777215 + (k << 24));
+ }
RenderSystem.disableBlend();
RenderSystem.popMatrix();
}