package net.mcft.copy.betterstorage.client.renderer;

import net.mcft.copy.betterstorage.block.tileentity.TileEntityBackpack;
import net.minecraft.item.ItemStack;

import org.lwjgl.opengl.GL11;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class ItemRendererBackpack extends ItemRendererContainer {
	
	public static final ItemRendererBackpack instance = new ItemRendererBackpack();
	
	private ItemRendererBackpack() {
		super(TileEntityBackpack.class);
	}
	
	@Override
	public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
		boolean entity = (type == ItemRenderType.ENTITY);
		boolean equippedFirstPerson = (type == ItemRenderType.EQUIPPED_FIRST_PERSON);
		boolean equippedThirdPerson = (type == ItemRenderType.EQUIPPED);
		boolean equipped = (equippedFirstPerson || equippedThirdPerson);
		if (entity || equippedThirdPerson)
			GL11.glScalef(1.2F, 1.2F, 1.2F);
		if (equipped) {
			GL11.glTranslatef(0.5F, 0.5F, 0.5F);
			GL11.glRotatef((equippedThirdPerson ? 200.0F : 75.0F), 0.0F, 1.0F, 0.0F);
		}
		super.renderItem(type, item, data);
	}
	
}

@@ -882,17 +882,26 @@
 f (e
-ntity %7C%7C 
+quipped) %7B%0A%09%09%09if (
 equi
@@ -920,66 +920,54 @@
 son)
-%0A%09%09%09
+ 
 GL11.gl
-Scal
+Translat
 ef(1.
-2F, 1.2
+3F, 0.0
 F, 1.
-2
+0
 F);%0A%09%09
-if (equipped) %7B%0A%09%09%09
+%09else 
 GL11
@@ -986,20 +986,21 @@
 f(0.
-5
+0
 F, 0.
-5
+0
 F, 0.
+8
 5F);
@@ -1081,12 +1081,85 @@
 F);%0A
-
 %09%09%7D%0A
+%09%09if (entity %7C%7C equippedThirdPerson)%0A%09%09%09GL11.glScalef(1.2F, 1.2F, 1.2F);%0A
 %09%09su

Fix #115, fix backpack item renderer offset