/**
* Draws a transparent item in the slot
*
* @param itemStack item to draw
* @param x slot x
* @param y slot y
* @param renderItem Item Render
*/
public void drawItemStack(ItemStack itemStack, int x, int y, RenderItem renderItem, boolean transparent) {
this.zLevel = 50.0f;
renderItem.zLevel = 50.0f;
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
int colorOverlay = new Color(139, 139, 139, 160).hashCode();
RenderHelper.enableGUIStandardItemLighting();
renderItem.renderItemAndEffectIntoGUI(itemStack, x, y);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.disableDepth();
GlStateManager.colorMask(true, true, true, false);
if (transparent) {
this.zLevel = 100.0f;
renderItem.zLevel = 100.0f;
this.drawGradientRect(x, y, x + 16, y + 16, colorOverlay, colorOverlay);
}
GlStateManager.colorMask(true, true, true, true);
GlStateManager.enableDepth();
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
this.zLevel = 0.0f;
renderItem.zLevel = 0.0f;
}
GuiHelper.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:T.E.C.H
作者:
评论列表
文章目录