77 lines
3.1 KiB
Diff
77 lines
3.1 KiB
Diff
--- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
|
+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
|
@@ -8,6 +8,7 @@
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
import net.minecraft.client.Minecraft;
|
|
+import net.minecraft.client.gui.FontRenderer;
|
|
import net.minecraft.client.gui.GuiScreen;
|
|
import net.minecraft.client.renderer.OpenGlHelper;
|
|
import net.minecraft.client.renderer.RenderHelper;
|
|
@@ -143,7 +144,11 @@
|
|
}
|
|
}
|
|
|
|
+ //Forge: Force lighting to be disabled as there are some issue where lighting would
|
|
+ //incorrectly be applied based on items that are in the inventory.
|
|
+ GL11.glDisable(GL11.GL_LIGHTING);
|
|
this.drawGuiContainerForegroundLayer(par1, par2);
|
|
+ GL11.glEnable(GL11.GL_LIGHTING);
|
|
InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory;
|
|
ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack;
|
|
|
|
@@ -207,8 +212,11 @@
|
|
GL11.glTranslatef(0.0F, 0.0F, 32.0F);
|
|
this.zLevel = 200.0F;
|
|
itemRenderer.zLevel = 200.0F;
|
|
- itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.func_110434_K(), par1ItemStack, par2, par3);
|
|
- itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.func_110434_K(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8), par4Str);
|
|
+ FontRenderer font = null;
|
|
+ if (par1ItemStack != null) font = par1ItemStack.getItem().getFontRenderer(par1ItemStack);
|
|
+ if (font == null) font = fontRenderer;
|
|
+ itemRenderer.renderItemAndEffectIntoGUI(font, this.mc.func_110434_K(), par1ItemStack, par2, par3);
|
|
+ itemRenderer.renderItemOverlayIntoGUI(font, this.mc.func_110434_K(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8), par4Str);
|
|
this.zLevel = 0.0F;
|
|
itemRenderer.zLevel = 0.0F;
|
|
}
|
|
@@ -229,7 +237,8 @@
|
|
}
|
|
}
|
|
|
|
- this.func_102021_a(list, par2, par3);
|
|
+ FontRenderer font = par1ItemStack.getItem().getFontRenderer(par1ItemStack);
|
|
+ drawHoveringText(list, par2, par3, (font == null ? fontRenderer : font));
|
|
}
|
|
|
|
/**
|
|
@@ -242,6 +251,11 @@
|
|
}
|
|
|
|
protected void func_102021_a(List par1List, int par2, int par3)
|
|
+ {
|
|
+ drawHoveringText(par1List, par2, par3, fontRenderer);
|
|
+ }
|
|
+
|
|
+ protected void drawHoveringText(List par1List, int par2, int par3, FontRenderer font)
|
|
{
|
|
if (!par1List.isEmpty())
|
|
{
|
|
@@ -255,7 +269,7 @@
|
|
while (iterator.hasNext())
|
|
{
|
|
String s = (String)iterator.next();
|
|
- int l = this.fontRenderer.getStringWidth(s);
|
|
+ int l = font.getStringWidth(s);
|
|
|
|
if (l > k)
|
|
{
|
|
@@ -300,7 +314,7 @@
|
|
for (int k2 = 0; k2 < par1List.size(); ++k2)
|
|
{
|
|
String s1 = (String)par1List.get(k2);
|
|
- this.fontRenderer.drawStringWithShadow(s1, i1, j1, -1);
|
|
+ font.drawStringWithShadow(s1, i1, j1, -1);
|
|
|
|
if (k2 == 0)
|
|
{
|