Finished the old TESR's of the custom rendered blocks, will transition to .jsons when convenient.
This commit is contained in:
parent
977b6ce29d
commit
800bf06872
|
@ -1,22 +1,25 @@
|
||||||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.client.renderer.entity.RenderItem;
|
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
||||||
import net.minecraft.entity.item.EntityItem;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
|
@ -27,15 +30,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
public RenderAlchemicCalcinator()
|
public RenderAlchemicCalcinator()
|
||||||
{
|
{
|
||||||
customRenderItem = new RenderItem()
|
customRenderItem = Minecraft.getMinecraft().getRenderItem();
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean shouldBob()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
customRenderItem.setRenderManager(RenderManager.instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,7 +55,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
if (tileAltar.getStackInSlot(1) != null)
|
if (tileAltar.getStackInSlot(1) != null)
|
||||||
{
|
{
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(1));
|
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(1));
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(1));
|
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(1));
|
||||||
float displacement = 0.2F;
|
float displacement = 0.2F;
|
||||||
|
@ -79,7 +74,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
|
GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,7 +84,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
if (tileAltar.getStackInSlot(0) != null)
|
if (tileAltar.getStackInSlot(0) != null)
|
||||||
{
|
{
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||||
float displacement = -0.5F;
|
float displacement = -0.5F;
|
||||||
|
@ -108,13 +103,13 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
|
GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
|
||||||
ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
|
ReagentContainerInfo[] info = tileAltar.getContainerInfo(EnumFacing.UP);
|
||||||
if (info.length >= 1 && info[0] != null)
|
if (info.length >= 1 && info[0] != null)
|
||||||
{
|
{
|
||||||
ReagentStack reagentStack = info[0].reagent;
|
ReagentStack reagentStack = info[0].reagent;
|
||||||
|
@ -131,7 +126,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity)
|
private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity)
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
this.bindTexture(resourceLocation);
|
this.bindTexture(resourceLocation);
|
||||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
|
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
|
||||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
|
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
|
||||||
|
@ -142,10 +137,11 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
GL11.glDepthMask(false);
|
GL11.glDepthMask(false);
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
WorldRenderer wr = tessellator.getWorldRenderer();
|
||||||
tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity);
|
wr.startDrawingQuads();
|
||||||
|
wr.func_178961_b(colourRed, colourGreen, colourBlue, colourIntensity); //setCoulourRGBA
|
||||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||||
tessellator.setBrightness(240);
|
wr.func_178963_b(240); //setBrightness
|
||||||
|
|
||||||
double x1 = -7d / 16d;
|
double x1 = -7d / 16d;
|
||||||
double x2 = 7d / 16d;
|
double x2 = 7d / 16d;
|
||||||
|
@ -159,22 +155,22 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
double resy1 = 1.0d;
|
double resy1 = 1.0d;
|
||||||
double resy2 = 1.0d;
|
double resy2 = 1.0d;
|
||||||
|
|
||||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
wr.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||||
tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1);
|
wr.addVertexWithUV(x2, y1, z1, resx2, resy1);
|
||||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2);
|
wr.addVertexWithUV(x2, y2, z1, resx2, resy2);
|
||||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
wr.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
wr.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||||
tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1);
|
wr.addVertexWithUV(x1, y1, z2, resx2, resy1);
|
||||||
tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2);
|
wr.addVertexWithUV(x1, y2, z2, resx2, resy2);
|
||||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
wr.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||||
tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1);
|
wr.addVertexWithUV(x1, y1, z2, resx1, resy1);
|
||||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
wr.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
wr.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
wr.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||||
tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1);
|
wr.addVertexWithUV(x2, y1, z1, resx1, resy1);
|
||||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
wr.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
wr.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||||
tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2);
|
wr.addVertexWithUV(x2, y2, z1, resx1, resy2);
|
||||||
tessellator.draw();
|
tessellator.draw();
|
||||||
|
|
||||||
GL11.glDepthMask(true);
|
GL11.glDepthMask(true);
|
||||||
|
@ -193,228 +189,13 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
if (itemStack.getItem() instanceof ItemBlock)
|
if (itemStack.getItem() instanceof ItemBlock)
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
return 0.90F * scaleFactor;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
return 0.80F * scaleFactor;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
return 0.65F * scaleFactor;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return scaleFactor;
|
return scaleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getXDisplacementForSlot(int slot)
|
|
||||||
{
|
|
||||||
switch (slot)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return 0.0f;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
return -0.375f;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return -0.125f;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.3125f;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.3125f;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
return -0.125f;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private float getYDisplacementForSlot(int slot)
|
|
||||||
{
|
|
||||||
switch (slot)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return 0.4f;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
return -0.35f;
|
|
||||||
|
|
||||||
case 6:
|
|
||||||
return 0.4f;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return -0.35f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private float getZDisplacementForSlot(int slot)
|
|
||||||
{
|
|
||||||
switch (slot)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return 0.0f;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
return 0.0f;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.375f;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.25f;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return -0.25f;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
return -0.375f;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection)
|
|
||||||
{
|
|
||||||
if (ghostItemStack != null)
|
|
||||||
{
|
|
||||||
if (ghostItemStack.getItem() instanceof ItemBlock)
|
|
||||||
{
|
|
||||||
switch (forgeDirection)
|
|
||||||
{
|
|
||||||
case DOWN:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 2.7F, (float) z + 0.5F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case UP:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.25F, (float) z + 0.5F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case NORTH:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.7F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SOUTH:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.3F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case EAST:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.3F, (float) y + 0.5F, (float) z + 0.5F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WEST:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.70F, (float) y + 0.5F, (float) z + 0.5F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case UNKNOWN:
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
switch (forgeDirection)
|
|
||||||
{
|
|
||||||
case DOWN:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.6F, (float) z + 0.5F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case UP:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.20F, (float) z + 0.5F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case NORTH:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.7F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SOUTH:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.4F, (float) z + 0.3F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case EAST:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.3F, (float) y + 0.4F, (float) z + 0.5F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WEST:
|
|
||||||
{
|
|
||||||
GL11.glTranslatef((float) x + 0.70F, (float) y + 0.4F, (float) z + 0.5F);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case UNKNOWN:
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,12 +1,13 @@
|
||||||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.entity.RenderItem;
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
|
@ -22,19 +23,11 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
public RenderPedestal()
|
public RenderPedestal()
|
||||||
{
|
{
|
||||||
customRenderItem = new RenderItem()
|
customRenderItem = Minecraft.getMinecraft().getRenderItem();
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean shouldBob()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
customRenderItem.setRenderManager(RenderManager.instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
|
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i)
|
||||||
{
|
{
|
||||||
if (tileEntity instanceof TEPedestal)
|
if (tileEntity instanceof TEPedestal)
|
||||||
{
|
{
|
||||||
|
@ -54,7 +47,7 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
||||||
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||||
float displacement = 0.2F;
|
float displacement = 0.2F;
|
||||||
|
@ -68,7 +61,7 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
||||||
}
|
}
|
||||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||||
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
@ -93,52 +86,17 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
if (itemStack.getItem() instanceof ItemBlock)
|
if (itemStack.getItem() instanceof ItemBlock)
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
return 0.9f;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.90F;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.90F;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.90F;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.90F;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
return 0.80F;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.90F;
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
return 0.65f;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.65F;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.65F;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.65F;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.65F;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.65F;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return scaleFactor;
|
return scaleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection)
|
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, EnumFacing forgeDirection)
|
||||||
{
|
{
|
||||||
if (ghostItemStack != null)
|
if (ghostItemStack != null)
|
||||||
{
|
{
|
||||||
|
@ -182,11 +140,6 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UNKNOWN:
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -232,11 +185,6 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UNKNOWN:
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,21 @@
|
||||||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth;
|
import net.minecraft.client.Minecraft;
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
|
||||||
import net.minecraft.client.renderer.entity.RenderItem;
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth;
|
||||||
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||||
|
|
||||||
public class RenderPlinth extends TileEntitySpecialRenderer
|
public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
private ModelPlinth modelPlinth = new ModelPlinth();
|
private ModelPlinth modelPlinth = new ModelPlinth();
|
||||||
|
@ -21,19 +23,11 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
public RenderPlinth()
|
public RenderPlinth()
|
||||||
{
|
{
|
||||||
customRenderItem = new RenderItem()
|
customRenderItem = Minecraft.getMinecraft().getRenderItem();
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean shouldBob()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
customRenderItem.setRenderManager(RenderManager.instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
|
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i)
|
||||||
{
|
{
|
||||||
if (tileEntity instanceof TEPlinth)
|
if (tileEntity instanceof TEPlinth)
|
||||||
{
|
{
|
||||||
|
@ -52,7 +46,7 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
if (tileAltar.getStackInSlot(0) != null)
|
if (tileAltar.getStackInSlot(0) != null)
|
||||||
{
|
{
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||||
float displacement = 0.2F;
|
float displacement = 0.2F;
|
||||||
|
@ -71,7 +65,7 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
|
GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
@ -86,52 +80,17 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
if (itemStack.getItem() instanceof ItemBlock)
|
if (itemStack.getItem() instanceof ItemBlock)
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
return 0.9f * scaleFactor;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.90F * scaleFactor / 2;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.90F * scaleFactor / 2;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.90F * scaleFactor / 2;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.90F * scaleFactor / 2;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
return 0.80F * scaleFactor / 2;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.90F * scaleFactor / 2;
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
return 0.65f * scaleFactor;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return scaleFactor;
|
return scaleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection)
|
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, EnumFacing forgeDirection)
|
||||||
{
|
{
|
||||||
if (ghostItemStack != null)
|
if (ghostItemStack != null)
|
||||||
{
|
{
|
||||||
|
@ -175,11 +134,6 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UNKNOWN:
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -225,11 +179,6 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UNKNOWN:
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||||
|
|
||||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable;
|
|
||||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.entity.RenderItem;
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable;
|
||||||
|
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||||
|
|
||||||
public class RenderWritingTable extends TileEntitySpecialRenderer
|
public class RenderWritingTable extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
private ModelWritingTable modelWritingTable = new ModelWritingTable();
|
private ModelWritingTable modelWritingTable = new ModelWritingTable();
|
||||||
|
@ -23,19 +23,11 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
public RenderWritingTable()
|
public RenderWritingTable()
|
||||||
{
|
{
|
||||||
customRenderItem = new RenderItem()
|
customRenderItem = Minecraft.getMinecraft().getRenderItem();
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean shouldBob()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
customRenderItem.setRenderManager(RenderManager.instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
|
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int a)
|
||||||
{
|
{
|
||||||
if (tileEntity instanceof TEWritingTable)
|
if (tileEntity instanceof TEWritingTable)
|
||||||
{
|
{
|
||||||
|
@ -59,7 +51,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i));
|
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i));
|
||||||
float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0;
|
float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0;
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i));
|
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i));
|
||||||
float displacementX = getXDisplacementForSlot(i);
|
float displacementX = getXDisplacementForSlot(i);
|
||||||
|
@ -75,7 +67,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
||||||
}
|
}
|
||||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||||
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
@ -91,45 +83,10 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
if (itemStack.getItem() instanceof ItemBlock)
|
if (itemStack.getItem() instanceof ItemBlock)
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
return 0.9f * scaleFactor;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
return 0.80F * scaleFactor;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.90F * scaleFactor;
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
return 0.65F * scaleFactor;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.65F * scaleFactor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +165,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, ForgeDirection forgeDirection)
|
private void translateGhostItemByOrientation(ItemStack ghostItemStack, double x, double y, double z, EnumFacing forgeDirection)
|
||||||
{
|
{
|
||||||
if (ghostItemStack != null)
|
if (ghostItemStack != null)
|
||||||
{
|
{
|
||||||
|
@ -252,11 +209,6 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UNKNOWN:
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -302,11 +254,6 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case UNKNOWN:
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.entity.RenderItem;
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
|
@ -22,19 +21,11 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
public TEAltarRenderer()
|
public TEAltarRenderer()
|
||||||
{
|
{
|
||||||
customRenderItem = new RenderItem()
|
customRenderItem = Minecraft.getMinecraft().getRenderItem();
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean shouldBob()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
customRenderItem.setRenderManager(RenderManager.instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
|
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f, int i)
|
||||||
{
|
{
|
||||||
modelBloodAltar.renderBloodAltar((TEAltar) tileEntity, d0, d1, d2);
|
modelBloodAltar.renderBloodAltar((TEAltar) tileEntity, d0, d1, d2);
|
||||||
modelBloodAltar.renderBloodLevel((TEAltar) tileEntity, d0, d1, d2);
|
modelBloodAltar.renderBloodLevel((TEAltar) tileEntity, d0, d1, d2);
|
||||||
|
@ -48,7 +39,7 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
|
||||||
float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0;
|
float rotationAngle = Minecraft.getMinecraft().gameSettings.fancyGraphics ? (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL) : 0;
|
||||||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorld());
|
||||||
ghostEntityItem.hoverStart = 0.0F;
|
ghostEntityItem.hoverStart = 0.0F;
|
||||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||||
float displacement = 0.2F;
|
float displacement = 0.2F;
|
||||||
|
@ -62,7 +53,7 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
|
||||||
}
|
}
|
||||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||||
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
customRenderItem.func_175043_b(ghostEntityItem.getEntityItem()); //renderItemModel
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
@ -77,45 +68,10 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
if (itemStack.getItem() instanceof ItemBlock)
|
if (itemStack.getItem() instanceof ItemBlock)
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
return 0.9f;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.90F;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.90F;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.90F;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.90F;
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
return 0.80F;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.90F;
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
return 0.65f;
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
return 0.65F;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
return 0.65F;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
return 0.65F;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
return 0.65F;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return 0.65F;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue