Fixes
This commit is contained in:
@@ -1,18 +1,11 @@
|
|||||||
package refinedstorage.gui;
|
package refinedstorage.gui;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.client.renderer.VertexBuffer;
|
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
import net.minecraft.util.text.translation.I18n;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import refinedstorage.RefinedStorage;
|
import refinedstorage.RefinedStorage;
|
||||||
@@ -155,50 +148,42 @@ public abstract class GuiBase extends GuiContainer {
|
|||||||
zLevel = 200.0F;
|
zLevel = 200.0F;
|
||||||
itemRender.zLevel = 200.0F;
|
itemRender.zLevel = 200.0F;
|
||||||
|
|
||||||
FontRenderer font = null;
|
|
||||||
|
|
||||||
if (stack != null) {
|
|
||||||
font = stack.getItem().getFontRenderer(stack);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (font == null) {
|
|
||||||
font = fontRendererObj;
|
|
||||||
}
|
|
||||||
|
|
||||||
itemRender.renderItemIntoGUI(stack, x, y);
|
itemRender.renderItemIntoGUI(stack, x, y);
|
||||||
|
|
||||||
if (withOverlay) {
|
if (withOverlay) {
|
||||||
renderSlotOverlay(stack, message,x,y);
|
drawItemOverlay(stack, message, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
zLevel = 0.0F;
|
zLevel = 0.0F;
|
||||||
itemRender.zLevel = 0.0F;
|
itemRender.zLevel = 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderSlotOverlay(ItemStack stack, String text, int x, int y) {
|
public void drawItemOverlay(ItemStack stack, String text, int x, int y) {
|
||||||
if (text != null) {
|
if (text != null) {
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translate(x, y, 1);
|
GlStateManager.translate(x, y, 1);
|
||||||
GL11.glScalef(0.5f, 0.5f, 1);
|
GL11.glScalef(0.5f, 0.5f, 1);
|
||||||
|
|
||||||
int stringWidth = fontRendererObj.getStringWidth(text);
|
int stringWidth = fontRendererObj.getStringWidth(text);
|
||||||
GlStateManager.disableLighting();
|
|
||||||
GlStateManager.disableRescaleNormal();
|
|
||||||
GlStateManager.depthMask(false);
|
|
||||||
GlStateManager.enableBlend();
|
|
||||||
GlStateManager.blendFunc(770, 771);
|
|
||||||
GlStateManager.disableDepth();
|
|
||||||
fontRendererObj.drawStringWithShadow(text, 30-stringWidth, 22, 16777215);
|
|
||||||
GlStateManager.enableDepth();
|
|
||||||
GlStateManager.enableTexture2D();
|
|
||||||
GlStateManager.depthMask(true);
|
|
||||||
GlStateManager.enableLighting();
|
|
||||||
GlStateManager.disableBlend();
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
|
|
||||||
}
|
GlStateManager.disableLighting();
|
||||||
|
GlStateManager.disableRescaleNormal();
|
||||||
|
GlStateManager.depthMask(false);
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
GlStateManager.blendFunc(770, 771);
|
||||||
|
GlStateManager.disableDepth();
|
||||||
|
|
||||||
itemRender.renderItemOverlayIntoGUI(fontRendererObj, stack, x, y, "");
|
fontRendererObj.drawStringWithShadow(text, 30 - stringWidth, 22, 16777215);
|
||||||
|
|
||||||
|
GlStateManager.enableDepth();
|
||||||
|
GlStateManager.enableTexture2D();
|
||||||
|
GlStateManager.depthMask(true);
|
||||||
|
GlStateManager.enableLighting();
|
||||||
|
GlStateManager.disableBlend();
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
itemRender.renderItemOverlayIntoGUI(fontRendererObj, stack, x, y, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawString(int x, int y, String message) {
|
public void drawString(int x, int y, String message) {
|
||||||
|
Reference in New Issue
Block a user