Skip to content

Commit

Permalink
Fix offset of ItemRendererContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
copyboy committed Oct 21, 2013
1 parent 01e26a3 commit 5114169
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.mcft.copy.betterstorage.client.renderer;

import org.lwjgl.opengl.GL11;

import net.mcft.copy.betterstorage.block.tileentity.TileEntityContainer;
import net.mcft.copy.betterstorage.proxy.ClientProxy;
import net.minecraft.block.Block;
Expand Down Expand Up @@ -30,7 +32,12 @@ public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
if (renderingHandler == null)
renderingHandler = ClientProxy.renderingHandlers.get(tileEntityClass);
((TileEntityContainer)renderingHandler.tileEntity).onBlockRenderInInventory(item);
GL11.glPushMatrix();
if ((type == ItemRenderType.EQUIPPED) ||
(type == ItemRenderType.EQUIPPED_FIRST_PERSON))
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
renderingHandler.renderInventoryBlock(Block.blocksList[item.itemID], 0, 0, null);
GL11.glPopMatrix();
}

}
1 change: 0 additions & 1 deletion src/net/mcft/copy/betterstorage/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ private void registerRenderers() {
registerItemRenderer(Blocks.backpack, ItemRendererBackpack.instance);
registerItemRenderer(Blocks.enderBackpack, ItemRendererBackpack.instance);
registerItemRenderer(Blocks.reinforcedChest, new ItemRendererContainer(TileEntityReinforcedChest.class));
registerItemRenderer(Blocks.locker, new ItemRendererContainer(TileEntityLocker.class));
registerItemRenderer(Blocks.reinforcedLocker, new ItemRendererContainer(TileEntityReinforcedLocker.class));

RenderingRegistry.registerEntityRenderingHandler(EntityFrienderman.class, new RenderFrienderman());
Expand Down

0 comments on commit 5114169

Please sign in to comment.