Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.arctic.paperArmor.client;
- import com.arctic.paperArmor.init.ModItems;
- import com.arctic.paperArmor.tileEntities.TECrafting;
- import net.minecraft.client.renderer.Tessellator;
- import net.minecraft.client.renderer.texture.TextureMap;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemBlock;
- import net.minecraft.item.ItemStack;
- import net.minecraft.tileentity.TileEntity;
- import org.lwjgl.opengl.GL11;
- public class CraftingRenderer extends TERendererBase{
- @Override
- public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
- this.bindTexture(TextureMap.locationItemsTexture);
- Tessellator tessellator = Tessellator.instance;
- GL11.glPushMatrix();
- GL11.glTranslated(x, y, z);
- tessellator.startDrawingQuads();
- Helper helper = new Helper();
- helper.y2=0.1;
- helper.icon = ModItems.paperTile.getIconFromDamage(0);
- helper.set();
- TECrafting craft = (TECrafting) tileEntity;
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 3; j++) {
- ItemStack stack = craft.getStackInSlot(i + (j * 3));
- helper.x1 = ((double) i)/3D;
- helper.z1 = ((double) j)/3D;
- helper.x2 = ((double) i+1D)/3D;
- helper.z2 = ((double) j+1D)/3D;
- if (i==1&&j==0){
- helper.y2=0.05;
- helper.icon = Items.redstone.getIconFromDamage(0);
- helper.set();
- helper.drawPosY(tessellator);
- helper.y2=0.1;
- }
- if (stack!=null){
- Item item = stack.getItem();
- if (item instanceof ItemBlock){
- this.bindTexture(TextureMap.locationBlocksTexture);
- helper.icon = ((ItemBlock) item).field_150939_a.getIcon(0,0);
- } else {
- this.bindTexture(TextureMap.locationItemsTexture);
- helper.icon = stack.getItem().getIcon(stack, 0);
- }
- helper.set();
- helper.drawPosY(tessellator);
- }
- }
- }
- tessellator.draw();
- GL11.glPopMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement