GL11.glPushMatrix();
TextureManager var99 = this.mc.getTextureManager();
// Spout Start
Block var4block = Block.blocksList[par2ItemStack.itemID];
boolean custom = false;
BlockDesign design = null;
if (par2ItemStack.itemID == 318) {
org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(par2ItemStack.getItemDamage());
if (item != null) {
String textureURI = item.getTexture();
if (textureURI == null) {
org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(par2ItemStack.getItemDamage());
design = block != null ? block.getBlockDesign() : null;
textureURI = design != null ? design.getTextureURL() : null;
}
if (textureURI != null) {
Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI);
if (texture != null) {
SpoutClient.getHandle().renderEngine.bindTexture(texture.getTextureID());
custom = true;
}
}
}
}
if (!custom) {
if (par2ItemStack.itemID < 256) {
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
} else {
this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture);
}
}
if (design != null) {
GL11.glDisable(GL11.GL_LIGHTING);
design.renderItemstack(null, -0.5F, -0.5F, -0.5F, 0, 1F, rand);
GL11.glEnable(GL11.GL_LIGHTING);
}
else if(var4block != null && RenderBlocks.renderItemIn3d(var4block.getRenderType())) {
this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
} else {