mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-23 21:49:46 +00:00
38 lines
2.0 KiB
Diff
38 lines
2.0 KiB
Diff
--- a/net/minecraft/client/renderer/InventoryEffectRenderer.java
|
|
+++ b/net/minecraft/client/renderer/InventoryEffectRenderer.java
|
|
@@ -25,10 +25,16 @@
|
|
}
|
|
|
|
protected void func_175378_g() {
|
|
- if (this.field_146297_k.field_71439_g.func_70651_bq().isEmpty()) {
|
|
+ boolean hasVisibleEffect = false;
|
|
+ for(PotionEffect potioneffect : this.field_146297_k.field_71439_g.func_70651_bq()) {
|
|
+ Potion potion = potioneffect.func_188419_a();
|
|
+ if(potion.shouldRender(potioneffect)) { hasVisibleEffect = true; break; }
|
|
+ }
|
|
+ if (this.field_146297_k.field_71439_g.func_70651_bq().isEmpty() || !hasVisibleEffect) {
|
|
this.field_147003_i = (this.field_146294_l - this.field_146999_f) / 2;
|
|
this.field_147045_u = false;
|
|
} else {
|
|
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.PotionShiftEvent(this))) this.field_147003_i = (this.field_146294_l - this.field_146999_f) / 2; else
|
|
this.field_147003_i = 160 + (this.field_146294_l - this.field_146999_f - 200) / 2;
|
|
this.field_147045_u = true;
|
|
}
|
|
@@ -58,6 +64,7 @@
|
|
|
|
for(PotionEffect potioneffect : Ordering.natural().sortedCopy(collection)) {
|
|
Potion potion = potioneffect.func_188419_a();
|
|
+ if(!potion.shouldRender(potioneffect)) continue;
|
|
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
|
|
this.field_146297_k.func_110434_K().func_110577_a(field_147001_a);
|
|
this.func_73729_b(i, j, 0, 166, 140, 32);
|
|
@@ -66,6 +73,8 @@
|
|
this.func_73729_b(i + 6, j + 7, i1 % 12 * 18, 198 + i1 / 12 * 18, 18, 18);
|
|
}
|
|
|
|
+ potion.renderInventoryEffect(potioneffect, this, i, j, this.field_73735_i);
|
|
+ if (!potion.shouldRenderInvText(potioneffect)) { j += l; continue; }
|
|
String s1 = I18n.func_135052_a(potion.func_76393_a());
|
|
if (potioneffect.func_76458_c() == 1) {
|
|
s1 = s1 + ' ' + I18n.func_135052_a("enchantment.level.2");
|