use of net.minecraft.client.renderer.RenderItem in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class ClientProxyControl method registerItemModel.
private void registerItemModel(Item toRegister) {
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
renderItem.getItemModelMesher().register(toRegister, 0, new ModelResourceLocation(ValkyrienWarfareControlMod.MODID + ":" + toRegister.getUnlocalizedName().substring(5), "inventory"));
}
use of net.minecraft.client.renderer.RenderItem in project Totemic by TeamTotemic.
the class PageRecipe method renderItem.
@SideOnly(Side.CLIENT)
public void renderItem(IGuiLexiconEntry gui, int xPos, int yPos, ItemStack stack, boolean accountForContainer) {
RenderItem render = Minecraft.getMinecraft().getRenderItem();
boolean mouseDown = Mouse.isButtonDown(0);
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
GlStateManager.enableRescaleNormal();
GlStateManager.enableDepth();
render.renderItemAndEffectIntoGUI(stack, xPos, yPos);
render.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, stack, xPos, yPos, null);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
GlStateManager.popMatrix();
if (relativeMouseX >= xPos && relativeMouseY >= yPos && relativeMouseX <= xPos + 16 && relativeMouseY <= yPos + 16) {
tooltipStack = stack;
LexiconRecipeMappings.EntryData data = LexiconRecipeMappings.getDataForStack(tooltipStack);
if (data != null && (data.entry != gui.getEntry() || data.page != gui.getPageOn())) {
tooltipEntry = true;
if (!mouseDownLastTick && mouseDown && GuiScreen.isShiftKeyDown()) {
GuiLexiconEntry newGui = new GuiLexiconEntry(data.entry, (GuiScreen) gui);
newGui.page = data.page;
Minecraft.getMinecraft().displayGuiScreen(newGui);
}
}
if (accountForContainer) {
ItemStack containerStack = stack.getItem().getContainerItem(stack);
if (!containerStack.isEmpty())
tooltipContainerStack = containerStack;
}
}
}
use of net.minecraft.client.renderer.RenderItem in project ConvenientAdditions by Necr0.
the class ItemView method drawItem.
public void drawItem(ItemStack stack) {
RenderItem itemRender = GuiHelper.getRenderItem();
itemRender.zLevel = 100.0F;
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.disableDepth();
itemRender.renderItemAndEffectIntoGUI(Helper.getClientPlayer(), stack, posX, posY);
itemRender.renderItemOverlayIntoGUI(GuiHelper.getFontRenderer(), stack, posX, posY, null);
itemRender.zLevel = 0.0F;
}
use of net.minecraft.client.renderer.RenderItem in project Solar by Martacus.
the class RenderOfferingShrine method render.
@Override
public void render(TileOfferingShrine tileEntity, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.disableLighting();
GlStateManager.scale(0.2F, 0.2F, 0.2F);
GlStateManager.rotate(90, 1, 0, 0);
float percentage = tileEntity.getRunningTicks() / TileOfferingShrine.OFFERING_TICKS;
for (int i = 0; i < 8; i++) {
ItemStack drawStack = tileEntity.getItemStackHandler().getStackInSlot(i);
if (drawStack.isEmpty()) {
continue;
}
GlStateManager.pushMatrix();
GL11.glTranslatef(places[i][0], places[i][1], -1.3f);
RenderHelper.enableStandardItemLighting();
if (drawStack.getItem() instanceof ItemBlock) {
GL11.glTranslatef(0, 0, -0.25f);
}
if (!tileEntity.getOfferingRecipe().equalsIgnoreCase("")) {
GlStateManager.translate(0, 0, -percentage * 5);
}
itemRenderer.renderItem(drawStack, ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popMatrix();
}
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
use of net.minecraft.client.renderer.RenderItem in project Solar by Martacus.
the class RenderSunburntChest method render.
@Override
public void render(TileSunburntChest tileEntity, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
GlStateManager.translate(0.2, 0.65, 0.2);
GlStateManager.disableLighting();
GlStateManager.scale(0.3F, 0.3F, 0.3F);
for (int i = 0; i < 9; i++) {
ItemStack drawStack = tileEntity.getItemStackHandler().getStackInSlot(i);
if (drawStack.isEmpty()) {
continue;
}
int xLoc = i % 3;
int yLoc = (int) Math.floor(i / 3);
GlStateManager.pushMatrix();
GL11.glTranslatef(xLoc, 0, yLoc);
RenderHelper.enableStandardItemLighting();
itemRenderer.renderItem(drawStack, ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.popMatrix();
}
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
Aggregations