Anti-comments sweep!
This commit is contained in:
parent
e6a10f3f06
commit
dea1f87078
454 changed files with 23594 additions and 26739 deletions
|
@ -1,5 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
||||
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;
|
||||
|
@ -12,21 +18,13 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
||||
{
|
||||
private final RenderItem customRenderItem;
|
||||
private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator();
|
||||
|
||||
|
||||
private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png");
|
||||
|
||||
public RenderAlchemicCalcinator()
|
||||
|
@ -50,25 +48,17 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
TEAlchemicCalcinator tileAltar = (TEAlchemicCalcinator) tileEntity;
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
// GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (tileAltar.getStackInSlot(1) != null)
|
||||
|
@ -77,7 +67,6 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||
ghostEntityItem.hoverStart = 0.0F;
|
||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(1));
|
||||
//translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN);
|
||||
float displacement = 0.2F;
|
||||
|
||||
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||
|
@ -85,10 +74,8 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F);
|
||||
} else
|
||||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f*2f);
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f * 2f);
|
||||
}
|
||||
|
||||
//GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F);
|
||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
|
||||
if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock))
|
||||
|
@ -98,7 +85,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
|
||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
|
@ -109,7 +96,6 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||
ghostEntityItem.hoverStart = 0.0F;
|
||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||
//translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN);
|
||||
float displacement = -0.5F;
|
||||
|
||||
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||
|
@ -117,10 +103,8 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F);
|
||||
} else
|
||||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f*2f);
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f * 2f);
|
||||
}
|
||||
|
||||
//GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F);
|
||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
|
||||
if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock))
|
||||
|
@ -130,57 +114,21 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
|
||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
if(info.length >= 1 && info[0] != null)
|
||||
{
|
||||
ReagentStack reagentStack = info[0].reagent;
|
||||
int capacity = info[0].capacity;
|
||||
if(reagentStack != null && reagentStack.reagent != null)
|
||||
{
|
||||
Reagent reagent = reagentStack.reagent;
|
||||
this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// for (int i = 0; i <= 1; i++)
|
||||
// {
|
||||
// GL11.glPushMatrix();
|
||||
//
|
||||
// if (tileAltar.getStackInSlot(i) != null)
|
||||
// {
|
||||
// float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i));
|
||||
// float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
||||
// EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||
// ghostEntityItem.hoverStart = 0.0F;
|
||||
// ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i));
|
||||
// //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN);
|
||||
// float displacementX = getXDisplacementForSlot(i);
|
||||
// float displacementY = getYDisplacementForSlot(i);
|
||||
// float displacementZ = getZDisplacementForSlot(i);
|
||||
//
|
||||
// if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||
// {
|
||||
// GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.7F, (float) d2 + 0.5F + displacementZ);
|
||||
// } else
|
||||
// {
|
||||
// GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.6F, (float) d2 + 0.5F + displacementZ);
|
||||
// }
|
||||
//
|
||||
// //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F);
|
||||
// GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
// GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||
// customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||
// }
|
||||
//
|
||||
// GL11.glPopMatrix();
|
||||
// }
|
||||
|
||||
ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
if (info.length >= 1 && info[0] != null)
|
||||
{
|
||||
ReagentStack reagentStack = info[0].reagent;
|
||||
int capacity = info[0].capacity;
|
||||
if (reagentStack != null && reagentStack.reagent != null)
|
||||
{
|
||||
Reagent reagent = reagentStack.reagent;
|
||||
this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
|
||||
}
|
||||
}
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
@ -188,68 +136,64 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
|
||||
private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
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_T, 10497.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
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_T, 10497.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity);
|
||||
|
||||
GL11.glTranslated(x+0.5, y+0.5, z+0.5);
|
||||
//GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis
|
||||
//GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically
|
||||
|
||||
tessellator.setBrightness(240);
|
||||
|
||||
double x1 = -7d/16d;
|
||||
double x2 = 7d/16d;
|
||||
double y1 = 1d/16d;
|
||||
double y2 = 5d/16d;
|
||||
double z1 = -7d/16d;
|
||||
double z2 = 7d/16d;
|
||||
|
||||
double resx1 = 0.0d;
|
||||
double resx2 = 0.0d;
|
||||
double resy1 = 1.0d;
|
||||
double resy2 = 1.0d;
|
||||
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2);
|
||||
tessellator.draw();
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity);
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||
tessellator.setBrightness(240);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
double x1 = -7d / 16d;
|
||||
double x2 = 7d / 16d;
|
||||
double y1 = 1d / 16d;
|
||||
double y2 = 5d / 16d;
|
||||
double z1 = -7d / 16d;
|
||||
double z2 = 7d / 16d;
|
||||
|
||||
double resx1 = 0.0d;
|
||||
double resx2 = 0.0d;
|
||||
double resy1 = 1.0d;
|
||||
double resy2 = 1.0d;
|
||||
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
private float getGhostItemScaleFactor(ItemStack itemStack)
|
||||
{
|
||||
float scaleFactor = 1.5F;
|
||||
|
@ -258,7 +202,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
{
|
||||
if (itemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1))
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.90F * scaleFactor;
|
||||
|
@ -280,7 +224,7 @@ public class RenderAlchemicCalcinator extends TileEntitySpecialRenderer
|
|||
}
|
||||
} else
|
||||
{
|
||||
switch (customRenderItem.getMiniItemCount(itemStack,(byte)1))
|
||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.65F * scaleFactor;
|
||||
|
|
|
@ -21,19 +21,13 @@ public class RenderConduit extends TileEntitySpecialRenderer
|
|||
TEConduit tileConduit = (TEConduit) tileEntity;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileConduit.getInputDirection(), tileConduit.getOutputDirection());
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
|
|
@ -1,30 +1,24 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
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.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelCrystalBelljar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderCrystalBelljar extends TileEntitySpecialRenderer
|
||||
{
|
||||
private ModelCrystalBelljar modelConduit = new ModelCrystalBelljar();
|
||||
|
||||
|
||||
private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png");
|
||||
|
||||
|
||||
|
@ -34,80 +28,30 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer
|
|||
if (tileEntity instanceof TEBellJar)
|
||||
{
|
||||
TEBellJar tileAltar = (TEBellJar) tileEntity;
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
// GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
|
||||
if(info.length >= 1 && info[0] != null)
|
||||
if (info.length >= 1 && info[0] != null)
|
||||
{
|
||||
ReagentStack reagentStack = info[0].reagent;
|
||||
int capacity = info[0].capacity;
|
||||
if(reagentStack != null && reagentStack.reagent != null)
|
||||
{
|
||||
Reagent reagent = reagentStack.reagent;
|
||||
ReagentStack reagentStack = info[0].reagent;
|
||||
int capacity = info[0].capacity;
|
||||
if (reagentStack != null && reagentStack.reagent != null)
|
||||
{
|
||||
Reagent reagent = reagentStack.reagent;
|
||||
this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// this.renderTankContents(d0, d1, d2, 255, 0, 0, 200);
|
||||
|
||||
|
||||
|
||||
|
||||
// for (int i = 0; i <= 1; i++)
|
||||
// {
|
||||
// GL11.glPushMatrix();
|
||||
//
|
||||
// if (tileAltar.getStackInSlot(i) != null)
|
||||
// {
|
||||
// float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(i));
|
||||
// float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
||||
// EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||
// ghostEntityItem.hoverStart = 0.0F;
|
||||
// ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i));
|
||||
// //translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN);
|
||||
// float displacementX = getXDisplacementForSlot(i);
|
||||
// float displacementY = getYDisplacementForSlot(i);
|
||||
// float displacementZ = getZDisplacementForSlot(i);
|
||||
//
|
||||
// if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||
// {
|
||||
// GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.7F, (float) d2 + 0.5F + displacementZ);
|
||||
// } else
|
||||
// {
|
||||
// GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.6F, (float) d2 + 0.5F + displacementZ);
|
||||
// }
|
||||
//
|
||||
// //GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F);
|
||||
// GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
// GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||
// customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||
// }
|
||||
//
|
||||
// GL11.glPopMatrix();
|
||||
// }
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
@ -115,70 +59,64 @@ public class RenderCrystalBelljar extends TileEntitySpecialRenderer
|
|||
|
||||
private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
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_T, 10497.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
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_T, 10497.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDepthMask(false);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity);
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||
tessellator.setBrightness(240);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity);
|
||||
|
||||
GL11.glTranslated(x+0.5, y+0.5, z+0.5);
|
||||
//GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis
|
||||
//GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically
|
||||
|
||||
tessellator.setBrightness(240);
|
||||
|
||||
double x1 = -4d/16d;
|
||||
double x2 = 4d/16d;
|
||||
double y1 = -6d/16d;
|
||||
double y2 = 4d/16d;
|
||||
double z1 = -4d/16d;
|
||||
double z2 = 4d/16d;
|
||||
|
||||
double resx1 = 0.0d;
|
||||
double resx2 = 0.0d;
|
||||
double resy1 = 1.0d;
|
||||
double resy2 = 1.0d;
|
||||
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.draw();
|
||||
double x1 = -4d / 16d;
|
||||
double x2 = 4d / 16d;
|
||||
double y1 = -6d / 16d;
|
||||
double y2 = 4d / 16d;
|
||||
double z1 = -4d / 16d;
|
||||
double z2 = 4d / 16d;
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
double resx1 = 0.0d;
|
||||
double resx2 = 0.0d;
|
||||
double resy1 = 1.0d;
|
||||
double resy2 = 1.0d;
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
|
@ -1,15 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.MRSRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderMasterStone extends TileEntitySpecialRenderer
|
||||
{
|
||||
|
@ -18,13 +13,13 @@ public class RenderMasterStone extends TileEntitySpecialRenderer
|
|||
{
|
||||
if (tileEntity instanceof TEMasterStone)
|
||||
{
|
||||
String str = ((TEMasterStone) tileEntity).getCurrentRitual();
|
||||
MRSRenderer renderer = Rituals.getRendererForKey(str);
|
||||
|
||||
if(renderer != null)
|
||||
{
|
||||
renderer.renderAt(((TEMasterStone) tileEntity), d0, d1, d2);
|
||||
}
|
||||
String str = ((TEMasterStone) tileEntity).getCurrentRitual();
|
||||
MRSRenderer renderer = Rituals.getRendererForKey(str);
|
||||
|
||||
if (renderer != null)
|
||||
{
|
||||
renderer.renderAt(((TEMasterStone) tileEntity), d0, d1, d2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
@ -9,16 +11,10 @@ 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.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class RenderPedestal extends TileEntitySpecialRenderer
|
||||
{
|
||||
private ModelPedestal modelPedestal = new ModelPedestal();
|
||||
|
@ -44,19 +40,13 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
|||
{
|
||||
TEPedestal tileAltar = (TEPedestal) tileEntity;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Pedestal.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelPedestal.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
|
@ -68,7 +58,6 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
|||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||
ghostEntityItem.hoverStart = 0.0F;
|
||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||
//translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN);
|
||||
float displacement = 0.2F;
|
||||
|
||||
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||
|
@ -78,8 +67,6 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
|||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F);
|
||||
}
|
||||
|
||||
//GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F);
|
||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||
|
@ -88,24 +75,21 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
|||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
// this.modelInputMirror.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +102,7 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
|||
{
|
||||
if (itemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1))
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.90F;
|
||||
|
@ -140,7 +124,7 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
|||
}
|
||||
} else
|
||||
{
|
||||
switch (customRenderItem.getMiniItemCount(itemStack,(byte)1))
|
||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.65F;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth;
|
||||
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.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
@ -10,13 +13,8 @@ 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;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelPlinth;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class RenderPlinth extends TileEntitySpecialRenderer
|
||||
{
|
||||
private ModelPlinth modelPlinth = new ModelPlinth();
|
||||
|
@ -42,19 +40,13 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
|||
{
|
||||
TEPlinth tileAltar = (TEPlinth) tileEntity;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Plinth.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelPlinth.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
|
@ -65,7 +57,6 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
|||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||
ghostEntityItem.hoverStart = 0.0F;
|
||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||
//translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN);
|
||||
float displacement = 0.2F;
|
||||
|
||||
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||
|
@ -75,8 +66,6 @@ public class RenderPlinth extends TileEntitySpecialRenderer
|
|||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.1875f);
|
||||
}
|
||||
|
||||
//GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F);
|
||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
|
||||
if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock))
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
|
||||
public class RenderReagentConduit extends TileEntitySpecialRenderer
|
||||
{
|
||||
{
|
||||
private static final ResourceLocation field_110629_a = new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png");
|
||||
|
||||
@Override
|
||||
|
@ -20,56 +18,44 @@ public class RenderReagentConduit extends TileEntitySpecialRenderer
|
|||
{
|
||||
if (tileEntity instanceof TEReagentConduit)
|
||||
{
|
||||
int renderCount = ((TEReagentConduit)tileEntity).renderCount;
|
||||
float key1 = (tileEntity.xCoord*54f - tileEntity.yCoord*38.72f + tileEntity.zCoord*10.432f);
|
||||
float key2 = (tileEntity.xCoord*21.43f - tileEntity.yCoord*9.96f + tileEntity.zCoord*12.8f);
|
||||
|
||||
Int3 colourMap = ((TEReagentConduit) tileEntity).getColour();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
this.bindTexture(field_110629_a);
|
||||
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.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
int renderCount = ((TEReagentConduit) tileEntity).renderCount;
|
||||
float key1 = (tileEntity.xCoord * 54f - tileEntity.yCoord * 38.72f + tileEntity.zCoord * 10.432f);
|
||||
float key2 = (tileEntity.xCoord * 21.43f - tileEntity.yCoord * 9.96f + tileEntity.zCoord * 12.8f);
|
||||
Int3 colourMap = ((TEReagentConduit) tileEntity).getColour();
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
this.bindTexture(field_110629_a);
|
||||
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.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDepthMask(false);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(colourMap.xCoord, colourMap.yCoord, colourMap.zCoord, 200);
|
||||
GL11.glTranslated(d0 + 0.5, d1 + 0.5, d2 + 0.5);
|
||||
GL11.glRotatef(tileEntity.getWorldObj().getWorldTime() / 3.0f, 0F, 1F, 0F); //Rotate on planar axis
|
||||
GL11.glRotatef(renderCount + key1, 0F, 0F, 1F); //Rotate vertical axis
|
||||
GL11.glRotatef(renderCount * 2f + key2, 1F, 0F, 0F); //Rotate cylindrically
|
||||
double offset = 0;
|
||||
tessellator.setBrightness(240);
|
||||
tessellator.addVertexWithUV(-0.5d, 0, -0.5d, 0.0d, 0.0d);
|
||||
tessellator.addVertexWithUV(0.5d, 0, -0.5d, 1.0d, 0.0d);
|
||||
tessellator.addVertexWithUV(0.5d, 0, 0.5d, 1.0d, 1.0d);
|
||||
tessellator.addVertexWithUV(-0.5d, 0, 0.5d, 0.0d, 1.0d);
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
tessellator.draw();
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(colourMap.xCoord, colourMap.yCoord, colourMap.zCoord, 200);
|
||||
//tessellator.setColorOpaque(255, 255, 255);
|
||||
|
||||
GL11.glTranslated(d0+0.5, d1+0.5, d2+0.5);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glRotatef(tileEntity.getWorldObj().getWorldTime()/3.0f, 0F, 1F, 0F); //Rotate on planar axis
|
||||
GL11.glRotatef(renderCount + key1, 0F, 0F, 1F); //Rotate vertical axis
|
||||
GL11.glRotatef(renderCount*2f + key2, 1F, 0F, 0F); //Rotate cylindrically
|
||||
|
||||
double offset = 0;
|
||||
|
||||
tessellator.setBrightness(240);
|
||||
// GL11.glTranslatef(0F, s, s);
|
||||
// GL11.glScalef(1F, s * 14F, s * 14F);
|
||||
tessellator.addVertexWithUV(-0.5d, 0, -0.5d, 0.0d, 0.0d);
|
||||
tessellator.addVertexWithUV(0.5d, 0, -0.5d, 1.0d, 0.0d);
|
||||
tessellator.addVertexWithUV(0.5d, 0, 0.5d, 1.0d, 1.0d);
|
||||
tessellator.addVertexWithUV(-0.5d, 0, 0.5d, 0.0d, 1.0d);
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderSpellEffectBlock extends TileEntitySpecialRenderer
|
||||
{
|
||||
|
@ -22,24 +20,17 @@ public class RenderSpellEffectBlock extends TileEntitySpecialRenderer
|
|||
{
|
||||
TESpellEffectBlock tileSpellBlock = (TESpellEffectBlock) tileEntity;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEffect.png");
|
||||
int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
String resource = tileSpellBlock.getResourceLocationForMeta(meta);
|
||||
test = new ResourceLocation(resource);
|
||||
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelSpellEffectBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEnhancementBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderSpellEnhancementBlock extends TileEntitySpecialRenderer
|
||||
{
|
||||
|
@ -22,24 +20,17 @@ public class RenderSpellEnhancementBlock extends TileEntitySpecialRenderer
|
|||
{
|
||||
TESpellEnhancementBlock tileSpellBlock = (TESpellEnhancementBlock) tileEntity;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEnhancementPower1.png");
|
||||
int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
String resource = tileSpellBlock.getResourceLocationForMeta(meta);
|
||||
test = new ResourceLocation(resource);
|
||||
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelSpellEnhancementBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellModifierBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderSpellModifierBlock extends TileEntitySpecialRenderer
|
||||
{
|
||||
|
@ -22,24 +20,17 @@ public class RenderSpellModifierBlock extends TileEntitySpecialRenderer
|
|||
{
|
||||
TESpellModifierBlock tileSpellBlock = (TESpellModifierBlock) tileEntity;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellModifier.png");
|
||||
int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
String resource = tileSpellBlock.getResourceLocationForMeta(meta);
|
||||
test = new ResourceLocation(resource);
|
||||
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelSpellModifierBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer
|
||||
{
|
||||
|
@ -22,24 +20,17 @@ public class RenderSpellParadigmBlock extends TileEntitySpecialRenderer
|
|||
{
|
||||
TESpellParadigmBlock tileSpellBlock = (TESpellParadigmBlock) tileEntity;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellParadigm.png");
|
||||
int meta = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
|
||||
String resource = tileSpellBlock.getResourceLocationForMeta(meta);
|
||||
test = new ResourceLocation(resource);
|
||||
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelSpellParadigmBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
@ -10,13 +13,8 @@ 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;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelWritingTable;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class RenderWritingTable extends TileEntitySpecialRenderer
|
||||
{
|
||||
private ModelWritingTable modelWritingTable = new ModelWritingTable();
|
||||
|
@ -42,16 +40,13 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
|||
{
|
||||
TEWritingTable tileAltar = (TEWritingTable) tileEntity;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/WritingTable.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelWritingTable.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
@ -66,7 +61,6 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
|||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||
ghostEntityItem.hoverStart = 0.0F;
|
||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(i));
|
||||
//translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN);
|
||||
float displacementX = getXDisplacementForSlot(i);
|
||||
float displacementY = getYDisplacementForSlot(i);
|
||||
float displacementZ = getZDisplacementForSlot(i);
|
||||
|
@ -78,8 +72,6 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
|||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F + displacementX, (float) d1 + displacementY + 0.6F, (float) d2 + 0.5F + displacementZ);
|
||||
}
|
||||
|
||||
//GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F);
|
||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||
|
@ -101,7 +93,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
|||
{
|
||||
if (itemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1))
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.90F * scaleFactor;
|
||||
|
@ -123,7 +115,7 @@ public class RenderWritingTable extends TileEntitySpecialRenderer
|
|||
}
|
||||
} else
|
||||
{
|
||||
switch (customRenderItem.getMiniItemCount(itemStack,(byte)1))
|
||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.65F * scaleFactor;
|
||||
|
|
|
@ -2,183 +2,195 @@
|
|||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
*
|
||||
* File Created @ [Apr 9, 2014, 11:20:26 PM (GMT)]
|
||||
*/
|
||||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.lwjgl.opengl.ARBFragmentShader;
|
||||
import org.lwjgl.opengl.ARBShaderObjects;
|
||||
import org.lwjgl.opengl.ARBVertexShader;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public final class ShaderHelper {
|
||||
public final class ShaderHelper
|
||||
{
|
||||
|
||||
private static final int VERT = ARBVertexShader.GL_VERTEX_SHADER_ARB;
|
||||
private static final int FRAG = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB;
|
||||
private static final int VERT = ARBVertexShader.GL_VERTEX_SHADER_ARB;
|
||||
private static final int FRAG = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB;
|
||||
|
||||
public static int beam = 0;
|
||||
|
||||
public static void initShaders() {
|
||||
// if(!useShaders())
|
||||
// return;
|
||||
|
||||
beam = createProgram(null, "/assets/alchemicalwizardry/shaders/beam.frag");
|
||||
}
|
||||
public static int beam = 0;
|
||||
|
||||
public static void useShaderWithProps(int shader, Object... props) {
|
||||
// if(!useShaders())
|
||||
// return;
|
||||
|
||||
ARBShaderObjects.glUseProgramObjectARB(shader);
|
||||
public static void initShaders()
|
||||
{
|
||||
beam = createProgram(null, "/assets/alchemicalwizardry/shaders/beam.frag");
|
||||
}
|
||||
|
||||
if(shader != 0 && props.length % 2 == 0) {
|
||||
int propCount = props.length / 2;
|
||||
for(int i = 0; i < propCount; i++) {
|
||||
String propName = (String) props[i * 2];
|
||||
Object propVal = props[i * 2 + 1];
|
||||
|
||||
int uniform = ARBShaderObjects.glGetUniformLocationARB(shader, propName);
|
||||
if(propVal instanceof Integer)
|
||||
ARBShaderObjects.glUniform1iARB(uniform, (Integer) propVal);
|
||||
if(propVal instanceof Float)
|
||||
ARBShaderObjects.glUniform1fARB(uniform, (Float) propVal);
|
||||
// Possible Vector2, Vector3 and Vector4, no need yet.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void useShader(int shader) {
|
||||
useShaderWithProps(shader);
|
||||
}
|
||||
public static void useShaderWithProps(int shader, Object... props)
|
||||
{
|
||||
ARBShaderObjects.glUseProgramObjectARB(shader);
|
||||
|
||||
public static void releaseShader() {
|
||||
useShader(0);
|
||||
}
|
||||
|
||||
public static boolean useShaders() {
|
||||
return true;//ConfigHandler.useShaders && OpenGlHelper.shadersSupported;
|
||||
}
|
||||
|
||||
// Most of the code taken from the LWJGL wiki
|
||||
// http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL
|
||||
if (shader != 0 && props.length % 2 == 0)
|
||||
{
|
||||
int propCount = props.length / 2;
|
||||
for (int i = 0; i < propCount; i++)
|
||||
{
|
||||
String propName = (String) props[i * 2];
|
||||
Object propVal = props[i * 2 + 1];
|
||||
|
||||
private static int createProgram(String vert, String frag) {
|
||||
int vertId = 0, fragId = 0, program = 0;
|
||||
if(vert != null)
|
||||
vertId = createShader(vert, VERT);
|
||||
if(frag != null)
|
||||
fragId = createShader(frag, FRAG);
|
||||
int uniform = ARBShaderObjects.glGetUniformLocationARB(shader, propName);
|
||||
if (propVal instanceof Integer)
|
||||
ARBShaderObjects.glUniform1iARB(uniform, (Integer) propVal);
|
||||
if (propVal instanceof Float)
|
||||
ARBShaderObjects.glUniform1fARB(uniform, (Float) propVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
program = ARBShaderObjects.glCreateProgramObjectARB();
|
||||
if(program == 0)
|
||||
return 0;
|
||||
public static void useShader(int shader)
|
||||
{
|
||||
useShaderWithProps(shader);
|
||||
}
|
||||
|
||||
if(vert != null)
|
||||
ARBShaderObjects.glAttachObjectARB(program, vertId);
|
||||
if(frag != null)
|
||||
ARBShaderObjects.glAttachObjectARB(program, fragId);
|
||||
public static void releaseShader()
|
||||
{
|
||||
useShader(0);
|
||||
}
|
||||
|
||||
ARBShaderObjects.glLinkProgramARB(program);
|
||||
if(ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) {
|
||||
// FMLLog.log(Level.WARNING, getLogInfo(program));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARBShaderObjects.glValidateProgramARB(program);
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) {
|
||||
// FMLLog.log(Level.WARNING, getLogInfo(program));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return program;
|
||||
}
|
||||
public static boolean useShaders()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private static int createShader(String filename, int shaderType){
|
||||
int shader = 0;
|
||||
try {
|
||||
shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType);
|
||||
// Most of the code taken from the LWJGL wiki
|
||||
// http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL
|
||||
private static int createProgram(String vert, String frag)
|
||||
{
|
||||
int vertId = 0, fragId = 0, program = 0;
|
||||
if (vert != null)
|
||||
vertId = createShader(vert, VERT);
|
||||
if (frag != null)
|
||||
fragId = createShader(frag, FRAG);
|
||||
|
||||
if(shader == 0)
|
||||
return 0;
|
||||
program = ARBShaderObjects.glCreateProgramObjectARB();
|
||||
if (program == 0)
|
||||
return 0;
|
||||
|
||||
ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename));
|
||||
ARBShaderObjects.glCompileShaderARB(shader);
|
||||
if (vert != null)
|
||||
ARBShaderObjects.glAttachObjectARB(program, vertId);
|
||||
if (frag != null)
|
||||
ARBShaderObjects.glAttachObjectARB(program, fragId);
|
||||
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE)
|
||||
throw new RuntimeException("Error creating shader: " + getLogInfo(shader));
|
||||
ARBShaderObjects.glLinkProgramARB(program);
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return shader;
|
||||
}
|
||||
catch(Exception e) {
|
||||
ARBShaderObjects.glDeleteObjectARB(shader);
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
ARBShaderObjects.glValidateProgramARB(program);
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static String getLogInfo(int obj) {
|
||||
return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));
|
||||
}
|
||||
return program;
|
||||
}
|
||||
|
||||
private static String readFileAsString(String filename) throws Exception {
|
||||
StringBuilder source = new StringBuilder();
|
||||
InputStream in = ShaderHelper.class.getResourceAsStream(filename);
|
||||
Exception exception = null;
|
||||
BufferedReader reader;
|
||||
private static int createShader(String filename, int shaderType)
|
||||
{
|
||||
int shader = 0;
|
||||
try
|
||||
{
|
||||
shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType);
|
||||
|
||||
if(in == null)
|
||||
return "";
|
||||
|
||||
try {
|
||||
reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
|
||||
if (shader == 0)
|
||||
return 0;
|
||||
|
||||
Exception innerExc= null;
|
||||
try {
|
||||
String line;
|
||||
while((line = reader.readLine()) != null)
|
||||
source.append(line).append('\n');
|
||||
} catch(Exception exc) {
|
||||
exception = exc;
|
||||
} finally {
|
||||
try {
|
||||
reader.close();
|
||||
} catch(Exception exc) {
|
||||
if(innerExc == null)
|
||||
innerExc = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
}
|
||||
ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename));
|
||||
ARBShaderObjects.glCompileShaderARB(shader);
|
||||
|
||||
if(innerExc != null)
|
||||
throw innerExc;
|
||||
} catch(Exception exc) {
|
||||
exception = exc;
|
||||
} finally {
|
||||
try {
|
||||
in.close();
|
||||
} catch(Exception exc) {
|
||||
if(exception == null)
|
||||
exception = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE)
|
||||
throw new RuntimeException("Error creating shader: " + getLogInfo(shader));
|
||||
|
||||
if(exception != null)
|
||||
throw exception;
|
||||
}
|
||||
return shader;
|
||||
} catch (Exception e)
|
||||
{
|
||||
ARBShaderObjects.glDeleteObjectARB(shader);
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return source.toString();
|
||||
}
|
||||
private static String getLogInfo(int obj)
|
||||
{
|
||||
return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));
|
||||
}
|
||||
|
||||
private static String readFileAsString(String filename) throws Exception
|
||||
{
|
||||
StringBuilder source = new StringBuilder();
|
||||
InputStream in = ShaderHelper.class.getResourceAsStream(filename);
|
||||
Exception exception = null;
|
||||
BufferedReader reader;
|
||||
|
||||
if (in == null)
|
||||
return "";
|
||||
|
||||
try
|
||||
{
|
||||
reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
|
||||
|
||||
Exception innerExc = null;
|
||||
try
|
||||
{
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null)
|
||||
source.append(line).append('\n');
|
||||
} catch (Exception exc)
|
||||
{
|
||||
exception = exc;
|
||||
} finally
|
||||
{
|
||||
try
|
||||
{
|
||||
reader.close();
|
||||
} catch (Exception exc)
|
||||
{
|
||||
if (innerExc == null)
|
||||
innerExc = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (innerExc != null)
|
||||
throw innerExc;
|
||||
} catch (Exception exc)
|
||||
{
|
||||
exception = exc;
|
||||
} finally
|
||||
{
|
||||
try
|
||||
{
|
||||
in.close();
|
||||
} catch (Exception exc)
|
||||
{
|
||||
if (exception == null)
|
||||
exception = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
|
||||
if (exception != null)
|
||||
throw exception;
|
||||
}
|
||||
|
||||
return source.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
@ -8,12 +10,8 @@ import net.minecraft.item.ItemBlock;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelBloodAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
|
||||
public class TEAltarRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
private ModelBloodAltar modelBloodAltar = new ModelBloodAltar();
|
||||
|
@ -42,10 +40,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
|
|||
{
|
||||
TEAltar tileAltar = (TEAltar) tileEntity;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
// GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (tileAltar.getStackInSlot(0) != null)
|
||||
|
@ -55,7 +49,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
|
|||
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
|
||||
ghostEntityItem.hoverStart = 0.0F;
|
||||
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
|
||||
//translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), d0, d1, d2, ForgeDirection.DOWN);
|
||||
float displacement = 0.2F;
|
||||
|
||||
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)
|
||||
|
@ -65,8 +58,6 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
|
|||
{
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.6F, (float) d2 + 0.5F);
|
||||
}
|
||||
|
||||
//GL11.glTranslatef((float) tileAltar.xCoord + 0.5F, (float) tileAltar.yCoord + 2.7F, (float) tileAltar.zCoord + 0.5F);
|
||||
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
|
||||
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
|
||||
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
|
||||
|
@ -86,7 +77,7 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
|
|||
{
|
||||
if (itemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack,(byte)1))
|
||||
switch (customRenderItem.getMiniBlockCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.90F;
|
||||
|
@ -108,7 +99,7 @@ public class TEAltarRenderer extends TileEntitySpecialRenderer
|
|||
}
|
||||
} else
|
||||
{
|
||||
switch (customRenderItem.getMiniItemCount(itemStack,(byte)1))
|
||||
switch (customRenderItem.getMiniItemCount(itemStack, (byte) 1))
|
||||
{
|
||||
case 1:
|
||||
return 0.65F;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
@ -7,89 +10,81 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelAlchemicalCalcinator;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer
|
||||
public class TEAlchemicalCalcinatorItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator();
|
||||
private ModelAlchemicalCalcinator modelConduit = new ModelAlchemicalCalcinator();
|
||||
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
Block block = ModBlocks.blockAlchemicCalcinator;
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ModBlocks.blockAlchemicCalcinator;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import net.minecraft.client.renderer.RenderBlocks;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TEAltarItemRenderer implements IItemRenderer
|
||||
|
@ -21,14 +20,12 @@ public class TEAltarItemRenderer implements IItemRenderer
|
|||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -36,22 +33,20 @@ public class TEAltarItemRenderer implements IItemRenderer
|
|||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
float scale = 0.08f;
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0, scale);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0.5f, scale);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, +0.5f, 0.5f, +0.5f, scale);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, -0.5f, -0.75f, -0.5f, scale);
|
||||
break;
|
||||
case ENTITY:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0, scale);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, 0, 0, 0.5f, scale);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, +0.5f, 0.5f, +0.5f, scale);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderBloodAltar((RenderBlocks) data[0], item, -0.5f, -0.75f, -0.5f, scale);
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
|
@ -63,16 +58,12 @@ public class TEAltarItemRenderer implements IItemRenderer
|
|||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glPushMatrix();
|
||||
// Disable Lighting Calculations
|
||||
GL11.glTranslatef(x, y, z);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glRotatef(180f, 0f, 1f, 0f);
|
||||
//FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/OBJTutorial/textures/models/TutBox.png");
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/altar.png");
|
||||
//FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
modelBloodAltar.renderBloodAltar();
|
||||
// Re-enable Lighting Calculations
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
|
|
@ -1,206 +1,195 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
||||
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelCrystalBelljar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TEBellJarItemRenderer implements IItemRenderer
|
||||
public class TEBellJarItemRenderer implements IItemRenderer
|
||||
{
|
||||
ItemRenderer d;
|
||||
private ModelCrystalBelljar modelConduit = new ModelCrystalBelljar();
|
||||
private ResourceLocation mainResource = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png");
|
||||
ItemRenderer d;
|
||||
private ModelCrystalBelljar modelConduit = new ModelCrystalBelljar();
|
||||
private ResourceLocation mainResource = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png");
|
||||
private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/Reagent.png");
|
||||
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
GL11.glDepthMask(false);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
GL11.glDepthMask(false);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(mainResource);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelConduit.renderSpecialItem((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, 0);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
ReagentContainerInfo[] info = TEBellJar.getContainerInfoFromItem(item);
|
||||
if(info.length >= 1 && info[0] != null)
|
||||
if (info.length >= 1 && info[0] != null)
|
||||
{
|
||||
ReagentStack reagentStack = info[0].reagent;
|
||||
int capacity = info[0].capacity;
|
||||
if(reagentStack != null && reagentStack.reagent != null)
|
||||
{
|
||||
Reagent reagent = reagentStack.reagent;
|
||||
ReagentStack reagentStack = info[0].reagent;
|
||||
int capacity = info[0].capacity;
|
||||
if (reagentStack != null && reagentStack.reagent != null)
|
||||
{
|
||||
Reagent reagent = reagentStack.reagent;
|
||||
this.renderTankContents(translateX, translateY, translateZ, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(mainResource);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelConduit.renderSpecialItem((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, 1);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
// GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
// GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
FMLClientHandler.instance().getClient().renderEngine.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_T, 10497.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity);
|
||||
|
||||
GL11.glTranslated(x+0.5, y+0.5, z+0.5);
|
||||
//GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis
|
||||
//GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically
|
||||
|
||||
tessellator.setBrightness(240);
|
||||
|
||||
double x1 = -4d/16d;
|
||||
double x2 = 4d/16d;
|
||||
double y1 = -6d/16d;
|
||||
double y2 = 4d/16d;
|
||||
double z1 = -4d/16d;
|
||||
double z2 = 4d/16d;
|
||||
|
||||
double resx1 = 0.0d;
|
||||
double resx2 = 0.0d;
|
||||
double resy1 = 1.0d;
|
||||
double resy2 = 1.0d;
|
||||
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void renderTankContents(double x, double y, double z, int colourRed, int colourGreen, int colourBlue, int colourIntensity)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
FMLClientHandler.instance().getClient().renderEngine.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_T, 10497.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity);
|
||||
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||
|
||||
tessellator.setBrightness(240);
|
||||
|
||||
double x1 = -4d / 16d;
|
||||
double x2 = 4d / 16d;
|
||||
double y1 = -6d / 16d;
|
||||
double y2 = 4d / 16d;
|
||||
double z1 = -4d / 16d;
|
||||
double z2 = 4d / 16d;
|
||||
|
||||
double resx1 = 0.0d;
|
||||
double resx2 = 0.0d;
|
||||
double resy1 = 1.0d;
|
||||
double resy2 = 1.0d;
|
||||
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y1, z2, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x2, y1, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y1, z2, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx1, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z1, resx1, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z1, resx2, resy1);
|
||||
tessellator.addVertexWithUV(x2, y2, z2, resx2, resy2);
|
||||
tessellator.addVertexWithUV(x1, y2, z2, resx1, resy2);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,96 +1,89 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class TEConduitItemRenderer implements IItemRenderer
|
||||
public class TEConduitItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelConduit modelConduit = new ModelConduit();
|
||||
private ModelConduit modelConduit = new ModelConduit();
|
||||
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
Block block = ModBlocks.blockConduit;
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ModBlocks.blockConduit;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
@ -8,101 +11,96 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class TESpellEffectBlockItemRenderer implements IItemRenderer
|
||||
public class TESpellEffectBlockItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelSpellEffectBlock modelSpellBlock = new ModelSpellEffectBlock();
|
||||
private ModelSpellEffectBlock modelSpellBlock = new ModelSpellEffectBlock();
|
||||
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
Block block = ModBlocks.blockSpellEffect;
|
||||
//Icon icon = item.getItem().getIconFromDamage(0);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ModBlocks.blockSpellEffect;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage()));
|
||||
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public String getResourceLocationForMeta(int meta)
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
switch(meta)
|
||||
{
|
||||
case 0: return "alchemicalwizardry:textures/models/SpellEffectFire.png";
|
||||
case 1: return "alchemicalwizardry:textures/models/SpellEffectIce.png";
|
||||
case 2: return "alchemicalwizardry:textures/models/SpellEffectWind.png";
|
||||
case 3: return "alchemicalwizardry:textures/models/SpellEffectEarth.png";
|
||||
}
|
||||
return "";
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public String getResourceLocationForMeta(int meta)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return "alchemicalwizardry:textures/models/SpellEffectFire.png";
|
||||
case 1:
|
||||
return "alchemicalwizardry:textures/models/SpellEffectIce.png";
|
||||
case 2:
|
||||
return "alchemicalwizardry:textures/models/SpellEffectWind.png";
|
||||
case 3:
|
||||
return "alchemicalwizardry:textures/models/SpellEffectEarth.png";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEnhancementBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
@ -8,107 +11,108 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEnhancementBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class TESpellEnhancementBlockItemRenderer implements IItemRenderer
|
||||
public class TESpellEnhancementBlockItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelSpellEnhancementBlock modelSpellBlock = new ModelSpellEnhancementBlock();
|
||||
private ModelSpellEnhancementBlock modelSpellBlock = new ModelSpellEnhancementBlock();
|
||||
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
Block block = ModBlocks.blockSpellEffect;
|
||||
//Icon icon = item.getItem().getIconFromDamage(0);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
Block block = ModBlocks.blockSpellEffect;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
*/
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage()));
|
||||
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public String getResourceLocationForMeta(int meta)
|
||||
{
|
||||
switch(meta)
|
||||
{
|
||||
case 0: return "alchemicalwizardry:textures/models/SpellEnhancementPower1.png";
|
||||
case 1: return "alchemicalwizardry:textures/models/SpellEnhancementPower2.png";
|
||||
case 2: return "alchemicalwizardry:textures/models/SpellEnhancementPower3.png";
|
||||
case 5: return "alchemicalwizardry:textures/models/SpellEnhancementCost1.png";
|
||||
case 6: return "alchemicalwizardry:textures/models/SpellEnhancementCost2.png";
|
||||
case 7: return "alchemicalwizardry:textures/models/SpellEnhancementCost3.png";
|
||||
case 10: return "alchemicalwizardry:textures/models/SpellEnhancementPotency1.png";
|
||||
case 11: return "alchemicalwizardry:textures/models/SpellEnhancementPotency2.png";
|
||||
case 12: return "alchemicalwizardry:textures/models/SpellEnhancementPotency3.png";
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementPower1.png";
|
||||
}
|
||||
public String getResourceLocationForMeta(int meta)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementPower1.png";
|
||||
case 1:
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementPower2.png";
|
||||
case 2:
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementPower3.png";
|
||||
case 5:
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementCost1.png";
|
||||
case 6:
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementCost2.png";
|
||||
case 7:
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementCost3.png";
|
||||
case 10:
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementPotency1.png";
|
||||
case 11:
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementPotency2.png";
|
||||
case 12:
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementPotency3.png";
|
||||
|
||||
}
|
||||
return "alchemicalwizardry:textures/models/SpellEnhancementPower1.png";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellModifierBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
@ -8,25 +11,19 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellModifierBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class TESpellModifierBlockItemRenderer implements IItemRenderer
|
||||
public class TESpellModifierBlockItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelSpellModifierBlock modelSpellBlock = new ModelSpellModifierBlock();
|
||||
private ModelSpellModifierBlock modelSpellBlock = new ModelSpellModifierBlock();
|
||||
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
Block block = ModBlocks.blockSpellEffect;
|
||||
//Icon icon = item.getItem().getIconFromDamage(0);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
Block block = ModBlocks.blockSpellEffect;
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
|
@ -34,75 +31,82 @@ public class TESpellModifierBlockItemRenderer implements IItemRenderer
|
|||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage()));
|
||||
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public String getResourceLocationForMeta(int meta)
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
switch(meta)
|
||||
{
|
||||
case 0: return "alchemicalwizardry:textures/models/SpellModifierDefault.png";
|
||||
case 1: return "alchemicalwizardry:textures/models/SpellModifierOffensive.png";
|
||||
case 2: return "alchemicalwizardry:textures/models/SpellModifierDefensive.png";
|
||||
case 3: return "alchemicalwizardry:textures/models/SpellModifierEnvironmental.png";
|
||||
}
|
||||
return "alchemicalwizardry:textures/models/SpellModifierDefault.png";
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public String getResourceLocationForMeta(int meta)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return "alchemicalwizardry:textures/models/SpellModifierDefault.png";
|
||||
case 1:
|
||||
return "alchemicalwizardry:textures/models/SpellModifierOffensive.png";
|
||||
case 2:
|
||||
return "alchemicalwizardry:textures/models/SpellModifierDefensive.png";
|
||||
case 3:
|
||||
return "alchemicalwizardry:textures/models/SpellModifierEnvironmental.png";
|
||||
}
|
||||
return "alchemicalwizardry:textures/models/SpellModifierDefault.png";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block.itemRender;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
|
@ -8,25 +11,18 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellParadigmBlock;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class TESpellParadigmBlockItemRenderer implements IItemRenderer
|
||||
public class TESpellParadigmBlockItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelSpellParadigmBlock modelSpellBlock = new ModelSpellParadigmBlock();
|
||||
private ModelSpellParadigmBlock modelSpellBlock = new ModelSpellParadigmBlock();
|
||||
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
Block block = ModBlocks.blockSpellEffect;
|
||||
//Icon icon = item.getItem().getIconFromDamage(0);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
Block block = ModBlocks.blockSpellEffect;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
/**
|
||||
* Render the ghost item inside of the Altar, slowly spinning
|
||||
|
@ -34,11 +30,9 @@ public class TESpellParadigmBlockItemRenderer implements IItemRenderer
|
|||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
|
||||
ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage()));
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
//GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F);
|
||||
//A reference to your Model file. Again, very important.
|
||||
this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.DOWN, ForgeDirection.UP);
|
||||
//Tell it to stop rendering for both the PushMatrix's
|
||||
|
@ -46,63 +40,72 @@ public class TESpellParadigmBlockItemRenderer implements IItemRenderer
|
|||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public String getResourceLocationForMeta(int meta)
|
||||
/**
|
||||
* IItemRenderer implementation *
|
||||
*/
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
switch(meta)
|
||||
{
|
||||
case 0: return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
||||
case 1: return "alchemicalwizardry:textures/models/SpellParadigmSelf.png";
|
||||
case 2: return "alchemicalwizardry:textures/models/SpellParadigmMelee.png";
|
||||
case 3: return "alchemicalwizardry:textures/models/SpellParadigmTool.png";
|
||||
}
|
||||
return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
return true;
|
||||
case EQUIPPED:
|
||||
return true;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f);
|
||||
break;
|
||||
case INVENTORY:
|
||||
renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public String getResourceLocationForMeta(int meta)
|
||||
{
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
||||
case 1:
|
||||
return "alchemicalwizardry:textures/models/SpellParadigmSelf.png";
|
||||
case 2:
|
||||
return "alchemicalwizardry:textures/models/SpellParadigmMelee.png";
|
||||
case 3:
|
||||
return "alchemicalwizardry:textures/models/SpellParadigmTool.png";
|
||||
}
|
||||
return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,24 +10,22 @@ import org.lwjgl.opengl.GL11;
|
|||
|
||||
public class TEWritingTableItemRenderer implements IItemRenderer
|
||||
{
|
||||
private ModelWritingTable modelBloodAltar;
|
||||
private ModelWritingTable model;
|
||||
|
||||
public TEWritingTableItemRenderer()
|
||||
{
|
||||
modelBloodAltar = new ModelWritingTable();
|
||||
model = new ModelWritingTable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -35,8 +33,6 @@ public class TEWritingTableItemRenderer implements IItemRenderer
|
|||
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
float scale = 0.08f;
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
switch (type)
|
||||
{
|
||||
case ENTITY:
|
||||
|
@ -70,11 +66,9 @@ public class TEWritingTableItemRenderer implements IItemRenderer
|
|||
GL11.glTranslatef(x, y, z);
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
GL11.glRotatef(180f, 0f, 1f, 0f);
|
||||
//FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/OBJTutorial/textures/models/TutBox.png");
|
||||
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/WritingTable.png");
|
||||
//FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/alchemicalwizardry/textures/models/altar.png");
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
modelBloodAltar.render((Entity) null, 0, 0, 0, 0, 0, 0);
|
||||
model.render((Entity) null, 0, 0, 0, 0, 0, 0);
|
||||
// Re-enable Lighting Calculations
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue