use of net.minecraft.client.renderer.RenderItem in project RebornCore by TechReborn.
the class StackInfoHUD method renderItemStack.
public void renderItemStack(ItemStack stack, int x, int y) {
if (stack != EMPTY) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
itemRenderer.renderItemAndEffectIntoGUI(stack, x, y);
GL11.glDisable(GL11.GL_LIGHTING);
}
}
use of net.minecraft.client.renderer.RenderItem in project TechReborn by TechReborn.
the class TRBuilder method renderItemStack.
public void renderItemStack(ItemStack stack, int x, int y) {
if (stack != EMPTY) {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
itemRenderer.renderItemAndEffectIntoGUI(stack, x, y);
GL11.glDisable(GL11.GL_LIGHTING);
}
}
use of net.minecraft.client.renderer.RenderItem in project Tropicraft by Tropicraft.
the class RenderBambooItemFrame method renderItem.
private void renderItem(EntityBambooItemFrame itemFrame) {
ItemStack itemstack = itemFrame.getDisplayedItem();
if (!itemstack.isEmpty()) {
EntityItem entityitem = new EntityItem(itemFrame.world, 0.0D, 0.0D, 0.0D, itemstack);
Item item = entityitem.getItem().getItem();
entityitem.getItem().setCount(1);
entityitem.hoverStart = 0.0F;
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
int i = itemFrame.getRotation();
if (item instanceof net.minecraft.item.ItemMap) {
i = i % 4 * 2;
}
GlStateManager.rotate((float) i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);
if (item instanceof net.minecraft.item.ItemMap) {
this.renderManager.renderEngine.bindTexture(MAP_BACKGROUND_TEXTURES);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
float f = 0.0078125F;
GlStateManager.scale(f, f, f);
GlStateManager.translate(-64.0F, -64.0F, 0.0F);
MapData mapdata = Items.FILLED_MAP.getMapData(entityitem.getItem(), itemFrame.world);
GlStateManager.translate(0.0F, 0.0F, -1.0F);
if (mapdata != null) {
this.mc.entityRenderer.getMapItemRenderer().renderMap(mapdata, true);
}
} else {
GlStateManager.scale(0.5F, 0.5F, 0.5F);
if (!this.itemRenderer.shouldRenderItemIn3D(entityitem.getItem()) || item instanceof ItemSkull) {
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
}
GlStateManager.pushAttrib();
RenderHelper.enableStandardItemLighting();
this.itemRenderer.renderItem(entityitem.getItem(), ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popAttrib();
}
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}
use of net.minecraft.client.renderer.RenderItem in project Cavern2 by kegare.
the class GuiListSlot method drawItemStack.
public void drawItemStack(RenderItem renderer, @Nullable IBlockState state, int x, int y, FontRenderer fontRenderer, @Nullable String overlay) {
if (state == null) {
return;
}
Item item = Item.getItemFromBlock(CaveRenderingRegistry.getRenderBlock(state.getBlock()));
if (item == Items.AIR) {
return;
}
int meta = state.getBlock().getMetaFromState(state);
drawItemStack(renderer, new ItemStack(item, 1, meta), x, y, fontRenderer, overlay);
}
use of net.minecraft.client.renderer.RenderItem in project HorsePower by GoryMoon.
the class ColorGetter method getTextureAtlasSprite.
@Nullable
private static TextureAtlasSprite getTextureAtlasSprite(ItemStack itemStack) {
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
ItemModelMesher itemModelMesher = renderItem.getItemModelMesher();
IBakedModel itemModel = itemModelMesher.getItemModel(itemStack);
return itemModel.getParticleTexture();
}
Aggregations