Finished levitator render
This commit is contained in:
parent
4e15eb36ac
commit
ba7d489c50
7 changed files with 61 additions and 668 deletions
|
@ -27,26 +27,36 @@ public class RenderLevitator extends TileEntitySpecialRenderer implements ICusto
|
|||
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
||||
RenderUtility.rotateFaceBlockToSide(((TileLevitator) t).getDirection());
|
||||
|
||||
/**
|
||||
* if (((TileLevitator) t).suck)
|
||||
* this.bindTexture(TEXTURE_ON);
|
||||
* else
|
||||
* this.bindTexture(TEXTURE_PUSH);
|
||||
*/
|
||||
|
||||
if (((TileLevitator) t).canFunction())
|
||||
{
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||
RenderUtility.rotateFaceToSideNoTranslate(((TileLevitator) t).getDirection().getOpposite());
|
||||
TileLevitator tile = (TileLevitator) t;
|
||||
if (tile.canFunction())
|
||||
bindTexture(TEXTURE_ON);
|
||||
}
|
||||
else
|
||||
{
|
||||
bindTexture(TEXTURE_OFF);
|
||||
}
|
||||
|
||||
MODEL.renderAll();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(tile.renderRotation, 1, 0, 0);
|
||||
MODEL.renderOnly("ring1");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(-tile.renderRotation, 1, 0, 0);
|
||||
MODEL.renderOnly("ring2");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(tile.renderRotation, 0, 0, 1);
|
||||
MODEL.renderOnly("ring3");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(-tile.renderRotation, 0, 0, 1);
|
||||
MODEL.renderOnly("ring4");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
MODEL.renderAllExcept("ring1", "ring2", "ring3", "ring4");
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
@ -66,8 +76,7 @@ public class RenderLevitator extends TileEntitySpecialRenderer implements ICusto
|
|||
public void renderDynamic(TileEntity tile, Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.5f, 1.7f, 0.5f);
|
||||
GL11.glRotatef(180f, 0f, 0f, 1f);
|
||||
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_OFF);
|
||||
MODEL.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
|
|
|
@ -67,6 +67,11 @@ public class TileLevitator extends TileAdvanced implements IPacketReceiver, IPac
|
|||
private int dyeID = TileTesla.DEFAULT_COLOR;
|
||||
private Vector3 tempLinkVector;
|
||||
|
||||
/**
|
||||
* Client Side Only
|
||||
*/
|
||||
public float renderRotation = 0;
|
||||
|
||||
@Override
|
||||
public void initiate()
|
||||
{
|
||||
|
@ -96,24 +101,29 @@ public class TileLevitator extends TileAdvanced implements IPacketReceiver, IPac
|
|||
TileEntity inventoryTile = getLatched();
|
||||
IInventory inventory = (IInventory) inventoryTile;
|
||||
|
||||
if (!suck && pushDelay == 0)
|
||||
if (!suck)
|
||||
{
|
||||
ItemStack retrieved = InventoryUtility.takeTopItemFromInventory(inventory, getDirection().getOpposite().ordinal());
|
||||
|
||||
if (retrieved != null)
|
||||
renderRotation = Math.max(0, renderRotation - 0.8f);
|
||||
if (pushDelay == 0)
|
||||
{
|
||||
EntityItem item = getItemWithPosition(retrieved);
|
||||
ItemStack retrieved = InventoryUtility.takeTopItemFromInventory(inventory, getDirection().getOpposite().ordinal());
|
||||
|
||||
if (!worldObj.isRemote)
|
||||
if (retrieved != null)
|
||||
{
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
EntityItem item = getItemWithPosition(retrieved);
|
||||
|
||||
pushDelay = Settings.LEVITATOR_PUSH_DELAY;
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
|
||||
pushDelay = Settings.LEVITATOR_PUSH_DELAY;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (suck)
|
||||
{
|
||||
renderRotation = Math.min(20, renderRotation + 0.8f);
|
||||
if (suckBounds != null)
|
||||
{
|
||||
if (!worldObj.isRemote)
|
||||
|
|
|
@ -1,206 +0,0 @@
|
|||
package resonantinduction.electrical.tesla;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelTeslaBottom extends ModelBase
|
||||
{
|
||||
// fields
|
||||
ModelRenderer Base;
|
||||
ModelRenderer BackBottomSide;
|
||||
ModelRenderer FrontBottomSide;
|
||||
ModelRenderer SlantedFrontPanel;
|
||||
ModelRenderer SlantedPanelBase;
|
||||
ModelRenderer TopBase;
|
||||
ModelRenderer FrontTopPole;
|
||||
ModelRenderer SideTopPole;
|
||||
ModelRenderer LeftAntennae;
|
||||
ModelRenderer RightAntennae;
|
||||
ModelRenderer BackAntennae;
|
||||
ModelRenderer FrontAntennae;
|
||||
ModelRenderer TopBasePanel;
|
||||
ModelRenderer ChargePack;
|
||||
ModelRenderer WireLeftBottomPole;
|
||||
ModelRenderer WireLeftTopPole;
|
||||
ModelRenderer WireRightBottomPole;
|
||||
ModelRenderer WireRightTopPole;
|
||||
ModelRenderer BackRightConnector;
|
||||
ModelRenderer BackLeftConnector;
|
||||
ModelRenderer FrontLeftConnector;
|
||||
ModelRenderer FrontRightConnector;
|
||||
|
||||
public ModelTeslaBottom()
|
||||
{
|
||||
textureWidth = 128;
|
||||
textureHeight = 128;
|
||||
|
||||
Base = new ModelRenderer(this, 0, 0);
|
||||
Base.addBox(0F, 0F, 0F, 9, 10, 9);
|
||||
Base.setRotationPoint(-4.5F, 14F, -4.5F);
|
||||
Base.setTextureSize(128, 128);
|
||||
Base.mirror = true;
|
||||
setRotation(Base, 0F, 0F, 0F);
|
||||
BackBottomSide = new ModelRenderer(this, 38, 0);
|
||||
BackBottomSide.addBox(0F, 0F, 0F, 11, 7, 2);
|
||||
BackBottomSide.setRotationPoint(-5.5F, 17F, 1F);
|
||||
BackBottomSide.setTextureSize(128, 128);
|
||||
BackBottomSide.mirror = true;
|
||||
setRotation(BackBottomSide, 0F, 0F, 0F);
|
||||
FrontBottomSide = new ModelRenderer(this, 38, 0);
|
||||
FrontBottomSide.addBox(0F, 0F, 0F, 11, 7, 2);
|
||||
FrontBottomSide.setRotationPoint(-5.5F, 17F, -3F);
|
||||
FrontBottomSide.setTextureSize(128, 128);
|
||||
FrontBottomSide.mirror = true;
|
||||
setRotation(FrontBottomSide, 0F, 0F, 0F);
|
||||
SlantedFrontPanel = new ModelRenderer(this, 38, 10);
|
||||
SlantedFrontPanel.addBox(0F, 0F, 0F, 4, 6, 2);
|
||||
SlantedFrontPanel.setRotationPoint(-2F, 17F, -4F);
|
||||
SlantedFrontPanel.setTextureSize(128, 128);
|
||||
SlantedFrontPanel.mirror = true;
|
||||
setRotation(SlantedFrontPanel, -0.4234231F, 0F, 0F);
|
||||
SlantedPanelBase = new ModelRenderer(this, 51, 10);
|
||||
SlantedPanelBase.addBox(0F, 0F, 0F, 6, 3, 2);
|
||||
SlantedPanelBase.setRotationPoint(-3F, 21F, -6.5F);
|
||||
SlantedPanelBase.setTextureSize(128, 128);
|
||||
SlantedPanelBase.mirror = true;
|
||||
setRotation(SlantedPanelBase, 0F, 0F, 0F);
|
||||
TopBase = new ModelRenderer(this, 0, 20);
|
||||
TopBase.addBox(0F, 0F, 0F, 6, 5, 6);
|
||||
TopBase.setRotationPoint(-3F, 9F, -3F);
|
||||
TopBase.setTextureSize(128, 128);
|
||||
TopBase.mirror = true;
|
||||
setRotation(TopBase, 0F, 0F, 0F);
|
||||
FrontTopPole = new ModelRenderer(this, 0, 32);
|
||||
FrontTopPole.addBox(0F, 0F, 0F, 2, 2, 8);
|
||||
FrontTopPole.setRotationPoint(-1F, 10F, -4F);
|
||||
FrontTopPole.setTextureSize(128, 128);
|
||||
FrontTopPole.mirror = true;
|
||||
setRotation(FrontTopPole, 0F, 0F, 0F);
|
||||
SideTopPole = new ModelRenderer(this, 0, 43);
|
||||
SideTopPole.addBox(0F, 0F, 0F, 8, 2, 2);
|
||||
SideTopPole.setRotationPoint(-4F, 10F, -1F);
|
||||
SideTopPole.setTextureSize(128, 128);
|
||||
SideTopPole.mirror = true;
|
||||
setRotation(SideTopPole, 0F, 0F, 0F);
|
||||
LeftAntennae = new ModelRenderer(this, 25, 20);
|
||||
LeftAntennae.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
LeftAntennae.setRotationPoint(-4.5F, 8.8F, -0.5F);
|
||||
LeftAntennae.setTextureSize(128, 128);
|
||||
LeftAntennae.mirror = true;
|
||||
setRotation(LeftAntennae, 0F, 0F, 0F);
|
||||
RightAntennae = new ModelRenderer(this, 30, 20);
|
||||
RightAntennae.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
RightAntennae.setRotationPoint(3.5F, 8.8F, -0.5F);
|
||||
RightAntennae.setTextureSize(128, 128);
|
||||
RightAntennae.mirror = true;
|
||||
setRotation(RightAntennae, 0F, 0F, 0F);
|
||||
BackAntennae = new ModelRenderer(this, 25, 25);
|
||||
BackAntennae.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
BackAntennae.setRotationPoint(-0.5F, 8.8F, 3.5F);
|
||||
BackAntennae.setTextureSize(128, 128);
|
||||
BackAntennae.mirror = true;
|
||||
setRotation(BackAntennae, 0F, 0F, 0F);
|
||||
FrontAntennae = new ModelRenderer(this, 30, 25);
|
||||
FrontAntennae.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
FrontAntennae.setRotationPoint(-0.5F, 8.8F, -4.5F);
|
||||
FrontAntennae.setTextureSize(128, 128);
|
||||
FrontAntennae.mirror = true;
|
||||
setRotation(FrontAntennae, 0F, 0F, 0F);
|
||||
TopBasePanel = new ModelRenderer(this, 36, 20);
|
||||
TopBasePanel.addBox(0F, 0F, 0F, 7, 1, 7);
|
||||
TopBasePanel.setRotationPoint(-3.5F, 13F, -3.5F);
|
||||
TopBasePanel.setTextureSize(128, 128);
|
||||
TopBasePanel.mirror = true;
|
||||
setRotation(TopBasePanel, 0F, 0F, 0F);
|
||||
ChargePack = new ModelRenderer(this, 37, 29);
|
||||
ChargePack.addBox(0F, 0F, 0F, 6, 7, 3);
|
||||
ChargePack.setRotationPoint(-3F, 17F, 3.5F);
|
||||
ChargePack.setTextureSize(128, 128);
|
||||
ChargePack.mirror = true;
|
||||
setRotation(ChargePack, 0F, 0F, 0F);
|
||||
WireLeftBottomPole = new ModelRenderer(this, 21, 32);
|
||||
WireLeftBottomPole.addBox(0F, 0F, 0F, 1, 10, 1);
|
||||
WireLeftBottomPole.setRotationPoint(-2F, 11.86667F, 6F);
|
||||
WireLeftBottomPole.setTextureSize(128, 128);
|
||||
WireLeftBottomPole.mirror = true;
|
||||
setRotation(WireLeftBottomPole, 0F, 0F, 0F);
|
||||
WireLeftTopPole = new ModelRenderer(this, 26, 32);
|
||||
WireLeftTopPole.addBox(0F, 0F, 0F, 1, 1, 4);
|
||||
WireLeftTopPole.setRotationPoint(-2F, 10.86667F, 3F);
|
||||
WireLeftTopPole.setTextureSize(128, 128);
|
||||
WireLeftTopPole.mirror = true;
|
||||
setRotation(WireLeftTopPole, 0F, 0F, 0F);
|
||||
WireRightBottomPole = new ModelRenderer(this, 21, 32);
|
||||
WireRightBottomPole.addBox(0F, 0F, 0F, 1, 10, 1);
|
||||
WireRightBottomPole.setRotationPoint(1F, 11.86667F, 6F);
|
||||
WireRightBottomPole.setTextureSize(128, 128);
|
||||
WireRightBottomPole.mirror = true;
|
||||
setRotation(WireRightBottomPole, 0F, 0F, 0F);
|
||||
WireRightTopPole = new ModelRenderer(this, 26, 38);
|
||||
WireRightTopPole.addBox(0F, 0F, 0F, 1, 1, 4);
|
||||
WireRightTopPole.setRotationPoint(1F, 10.86667F, 3F);
|
||||
WireRightTopPole.setTextureSize(128, 128);
|
||||
WireRightTopPole.mirror = true;
|
||||
setRotation(WireRightTopPole, 0F, 0F, 0F);
|
||||
BackRightConnector = new ModelRenderer(this, 65, 0);
|
||||
BackRightConnector.addBox(0F, 0F, 0F, 1, 1, 1);
|
||||
BackRightConnector.setRotationPoint(1F, 8F, 1.066667F);
|
||||
BackRightConnector.setTextureSize(128, 128);
|
||||
BackRightConnector.mirror = true;
|
||||
setRotation(BackRightConnector, 0F, 0F, 0F);
|
||||
BackLeftConnector = new ModelRenderer(this, 65, 0);
|
||||
BackLeftConnector.addBox(0F, 0F, 0F, 1, 1, 1);
|
||||
BackLeftConnector.setRotationPoint(-2F, 8F, 1F);
|
||||
BackLeftConnector.setTextureSize(128, 128);
|
||||
BackLeftConnector.mirror = true;
|
||||
setRotation(BackLeftConnector, 0F, 0F, 0F);
|
||||
FrontLeftConnector = new ModelRenderer(this, 65, 0);
|
||||
FrontLeftConnector.addBox(0F, 0F, 0F, 1, 1, 1);
|
||||
FrontLeftConnector.setRotationPoint(-2F, 8F, -2F);
|
||||
FrontLeftConnector.setTextureSize(128, 128);
|
||||
FrontLeftConnector.mirror = true;
|
||||
setRotation(FrontLeftConnector, 0F, 0F, 0F);
|
||||
FrontRightConnector = new ModelRenderer(this, 65, 0);
|
||||
FrontRightConnector.addBox(0F, 0F, 0F, 1, 1, 1);
|
||||
FrontRightConnector.setRotationPoint(1F, 8F, -2F);
|
||||
FrontRightConnector.setTextureSize(128, 128);
|
||||
FrontRightConnector.mirror = true;
|
||||
setRotation(FrontRightConnector, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(float f5)
|
||||
{
|
||||
Base.render(f5);
|
||||
BackBottomSide.render(f5);
|
||||
FrontBottomSide.render(f5);
|
||||
SlantedFrontPanel.render(f5);
|
||||
SlantedPanelBase.render(f5);
|
||||
TopBase.render(f5);
|
||||
FrontTopPole.render(f5);
|
||||
SideTopPole.render(f5);
|
||||
LeftAntennae.render(f5);
|
||||
RightAntennae.render(f5);
|
||||
BackAntennae.render(f5);
|
||||
FrontAntennae.render(f5);
|
||||
TopBasePanel.render(f5);
|
||||
ChargePack.render(f5);
|
||||
WireLeftBottomPole.render(f5);
|
||||
WireLeftTopPole.render(f5);
|
||||
WireRightBottomPole.render(f5);
|
||||
WireRightTopPole.render(f5);
|
||||
BackRightConnector.render(f5);
|
||||
BackLeftConnector.render(f5);
|
||||
FrontLeftConnector.render(f5);
|
||||
FrontRightConnector.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -1,215 +0,0 @@
|
|||
package resonantinduction.electrical.tesla;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelTeslaMiddle extends ModelBase
|
||||
{
|
||||
// fields
|
||||
ModelRenderer Base;
|
||||
ModelRenderer Collumn1;
|
||||
ModelRenderer Collumn2;
|
||||
ModelRenderer CrossCollumn1;
|
||||
ModelRenderer Collumn3;
|
||||
ModelRenderer Ball;
|
||||
ModelRenderer Plate;
|
||||
ModelRenderer TopBase;
|
||||
ModelRenderer FrontPole;
|
||||
ModelRenderer SidePole;
|
||||
ModelRenderer FrontAntennae;
|
||||
ModelRenderer BackAntennae;
|
||||
ModelRenderer LeftAntennae;
|
||||
ModelRenderer RightAntennae;
|
||||
ModelRenderer CrossCollumn2;
|
||||
ModelRenderer CrossCollumn3;
|
||||
ModelRenderer Collumn4;
|
||||
ModelRenderer CrossCollumn4;
|
||||
ModelRenderer BallStand;
|
||||
ModelRenderer FrontTopLeftPole;
|
||||
ModelRenderer FrontTopRightPole;
|
||||
ModelRenderer SideTopFirstPole;
|
||||
ModelRenderer SodeTopLastPole;
|
||||
|
||||
public ModelTeslaMiddle()
|
||||
{
|
||||
textureWidth = 128;
|
||||
textureHeight = 128;
|
||||
|
||||
Base = new ModelRenderer(this, 0, 0);
|
||||
Base.addBox(0F, 0F, 0F, 6, 6, 6);
|
||||
Base.setRotationPoint(-3F, 18F, -3F);
|
||||
Base.setTextureSize(128, 128);
|
||||
Base.mirror = true;
|
||||
setRotation(Base, 0F, 0F, 0F);
|
||||
Collumn1 = new ModelRenderer(this, 0, 20);
|
||||
Collumn1.addBox(0F, 0F, 0F, 1, 4, 1);
|
||||
Collumn1.setRotationPoint(-3F, 14F, -3F);
|
||||
Collumn1.setTextureSize(128, 128);
|
||||
Collumn1.mirror = true;
|
||||
setRotation(Collumn1, 0F, 0F, 0F);
|
||||
Collumn2 = new ModelRenderer(this, 0, 20);
|
||||
Collumn2.addBox(0F, 0F, 0F, 1, 4, 1);
|
||||
Collumn2.setRotationPoint(2F, 14F, -3F);
|
||||
Collumn2.setTextureSize(128, 128);
|
||||
Collumn2.mirror = true;
|
||||
setRotation(Collumn2, 0F, 0F, 0F);
|
||||
CrossCollumn1 = new ModelRenderer(this, 5, 20);
|
||||
CrossCollumn1.addBox(0F, 0F, 0F, 4, 1, 1);
|
||||
CrossCollumn1.setRotationPoint(-2F, 15.5F, -3F);
|
||||
CrossCollumn1.setTextureSize(128, 128);
|
||||
CrossCollumn1.mirror = true;
|
||||
setRotation(CrossCollumn1, 0F, 0F, 0F);
|
||||
Collumn3 = new ModelRenderer(this, 0, 20);
|
||||
Collumn3.addBox(0F, 0F, 0F, 1, 4, 1);
|
||||
Collumn3.setRotationPoint(2F, 14F, 2F);
|
||||
Collumn3.setTextureSize(128, 128);
|
||||
Collumn3.mirror = true;
|
||||
setRotation(Collumn3, 0F, 0F, 0F);
|
||||
Ball = new ModelRenderer(this, 0, 15);
|
||||
Ball.addBox(-1F, -1F, -1F, 2, 2, 2);
|
||||
Ball.setRotationPoint(0F, 16F, 0F);
|
||||
Ball.setTextureSize(128, 128);
|
||||
Ball.mirror = true;
|
||||
setRotation(Ball, 0F, 0F, 0F);
|
||||
Plate = new ModelRenderer(this, 25, 0);
|
||||
Plate.addBox(0F, 0F, 0F, 7, 1, 7);
|
||||
Plate.setRotationPoint(-3.5F, 13F, -3.5F);
|
||||
Plate.setTextureSize(128, 128);
|
||||
Plate.mirror = true;
|
||||
setRotation(Plate, 0F, 0F, 0F);
|
||||
TopBase = new ModelRenderer(this, 25, 9);
|
||||
TopBase.addBox(0F, 0F, 0F, 4, 5, 4);
|
||||
TopBase.setRotationPoint(-2F, 8F, -2F);
|
||||
TopBase.setTextureSize(128, 128);
|
||||
TopBase.mirror = true;
|
||||
setRotation(TopBase, 0F, 0F, 0F);
|
||||
FrontPole = new ModelRenderer(this, 0, 26);
|
||||
FrontPole.addBox(0F, 0F, 0F, 2, 2, 8);
|
||||
FrontPole.setRotationPoint(-1F, 20F, -4F);
|
||||
FrontPole.setTextureSize(128, 128);
|
||||
FrontPole.mirror = true;
|
||||
setRotation(FrontPole, 0F, 0F, 0F);
|
||||
SidePole = new ModelRenderer(this, 0, 37);
|
||||
SidePole.addBox(0F, 0F, 0F, 8, 2, 2);
|
||||
SidePole.setRotationPoint(-4F, 20F, -1F);
|
||||
SidePole.setTextureSize(128, 128);
|
||||
SidePole.mirror = true;
|
||||
setRotation(SidePole, 0F, 0F, 0F);
|
||||
FrontAntennae = new ModelRenderer(this, 25, 19);
|
||||
FrontAntennae.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
FrontAntennae.setRotationPoint(-0.5F, 18.8F, -4.466667F);
|
||||
FrontAntennae.setTextureSize(128, 128);
|
||||
FrontAntennae.mirror = true;
|
||||
setRotation(FrontAntennae, 0F, 0F, 0F);
|
||||
BackAntennae = new ModelRenderer(this, 25, 19);
|
||||
BackAntennae.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
BackAntennae.setRotationPoint(-0.5F, 18.8F, 3.533333F);
|
||||
BackAntennae.setTextureSize(128, 128);
|
||||
BackAntennae.mirror = true;
|
||||
setRotation(BackAntennae, 0F, 0F, 0F);
|
||||
LeftAntennae = new ModelRenderer(this, 25, 19);
|
||||
LeftAntennae.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
LeftAntennae.setRotationPoint(-4.5F, 18.8F, -0.5F);
|
||||
LeftAntennae.setTextureSize(128, 128);
|
||||
LeftAntennae.mirror = true;
|
||||
setRotation(LeftAntennae, 0F, 0F, 0F);
|
||||
RightAntennae = new ModelRenderer(this, 25, 19);
|
||||
RightAntennae.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
RightAntennae.setRotationPoint(3.5F, 18.8F, -0.5F);
|
||||
RightAntennae.setTextureSize(128, 128);
|
||||
RightAntennae.mirror = true;
|
||||
setRotation(RightAntennae, 0F, 0F, 0F);
|
||||
CrossCollumn2 = new ModelRenderer(this, 30, 19);
|
||||
CrossCollumn2.addBox(0F, 0F, 0F, 1, 1, 4);
|
||||
CrossCollumn2.setRotationPoint(2F, 15.5F, -2F);
|
||||
CrossCollumn2.setTextureSize(128, 128);
|
||||
CrossCollumn2.mirror = true;
|
||||
setRotation(CrossCollumn2, 0F, 0F, 0F);
|
||||
CrossCollumn3 = new ModelRenderer(this, 5, 20);
|
||||
CrossCollumn3.addBox(0F, 0F, 0F, 4, 1, 1);
|
||||
CrossCollumn3.setRotationPoint(-2F, 15.5F, 2F);
|
||||
CrossCollumn3.setTextureSize(128, 128);
|
||||
CrossCollumn3.mirror = true;
|
||||
setRotation(CrossCollumn3, 0F, 0F, 0F);
|
||||
Collumn4 = new ModelRenderer(this, 0, 20);
|
||||
Collumn4.addBox(0F, 0F, 0F, 1, 4, 1);
|
||||
Collumn4.setRotationPoint(-3F, 14F, 2F);
|
||||
Collumn4.setTextureSize(128, 128);
|
||||
Collumn4.mirror = true;
|
||||
setRotation(Collumn4, 0F, 0F, 0F);
|
||||
CrossCollumn4 = new ModelRenderer(this, 30, 19);
|
||||
CrossCollumn4.addBox(0F, 0F, 0F, 1, 1, 4);
|
||||
CrossCollumn4.setRotationPoint(-3F, 15.5F, -2F);
|
||||
CrossCollumn4.setTextureSize(128, 128);
|
||||
CrossCollumn4.mirror = true;
|
||||
setRotation(CrossCollumn4, 0F, 0F, 0F);
|
||||
BallStand = new ModelRenderer(this, 9, 16);
|
||||
BallStand.addBox(0F, 0F, 0F, 1, 1, 1);
|
||||
BallStand.setRotationPoint(-0.5F, 17F, -0.5F);
|
||||
BallStand.setTextureSize(128, 128);
|
||||
BallStand.mirror = true;
|
||||
setRotation(BallStand, 0F, 0F, 0F);
|
||||
FrontTopLeftPole = new ModelRenderer(this, 42, 9);
|
||||
FrontTopLeftPole.addBox(0F, 0F, 0F, 1, 4, 5);
|
||||
FrontTopLeftPole.setRotationPoint(-1.5F, 9F, -2.5F);
|
||||
FrontTopLeftPole.setTextureSize(128, 128);
|
||||
FrontTopLeftPole.mirror = true;
|
||||
setRotation(FrontTopLeftPole, 0F, 0F, 0F);
|
||||
FrontTopRightPole = new ModelRenderer(this, 42, 9);
|
||||
FrontTopRightPole.addBox(0F, 0F, 0F, 1, 4, 5);
|
||||
FrontTopRightPole.setRotationPoint(0.5F, 9F, -2.5F);
|
||||
FrontTopRightPole.setTextureSize(128, 128);
|
||||
FrontTopRightPole.mirror = true;
|
||||
setRotation(FrontTopRightPole, 0F, 0F, 0F);
|
||||
SideTopFirstPole = new ModelRenderer(this, 42, 19);
|
||||
SideTopFirstPole.addBox(0F, 0F, 0F, 5, 4, 1);
|
||||
SideTopFirstPole.setRotationPoint(-2.5F, 9F, -1.5F);
|
||||
SideTopFirstPole.setTextureSize(128, 128);
|
||||
SideTopFirstPole.mirror = true;
|
||||
setRotation(SideTopFirstPole, 0F, 0F, 0F);
|
||||
SodeTopLastPole = new ModelRenderer(this, 42, 19);
|
||||
SodeTopLastPole.addBox(0F, 0F, 0F, 5, 4, 1);
|
||||
SodeTopLastPole.setRotationPoint(-2.5F, 9F, 0.5F);
|
||||
SodeTopLastPole.setTextureSize(128, 128);
|
||||
SodeTopLastPole.mirror = true;
|
||||
setRotation(SodeTopLastPole, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(float f5)
|
||||
{
|
||||
Base.render(f5);
|
||||
Collumn1.render(f5);
|
||||
Collumn2.render(f5);
|
||||
CrossCollumn1.render(f5);
|
||||
Collumn3.render(f5);
|
||||
Ball.render(f5);
|
||||
Plate.render(f5);
|
||||
TopBase.render(f5);
|
||||
FrontPole.render(f5);
|
||||
SidePole.render(f5);
|
||||
FrontAntennae.render(f5);
|
||||
BackAntennae.render(f5);
|
||||
LeftAntennae.render(f5);
|
||||
RightAntennae.render(f5);
|
||||
CrossCollumn2.render(f5);
|
||||
CrossCollumn3.render(f5);
|
||||
Collumn4.render(f5);
|
||||
CrossCollumn4.render(f5);
|
||||
BallStand.render(f5);
|
||||
FrontTopLeftPole.render(f5);
|
||||
FrontTopRightPole.render(f5);
|
||||
SideTopFirstPole.render(f5);
|
||||
SodeTopLastPole.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,204 +0,0 @@
|
|||
package resonantinduction.electrical.tesla;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelTeslaTop extends ModelBase
|
||||
{
|
||||
// fields
|
||||
ModelRenderer Base;
|
||||
ModelRenderer Collumn1;
|
||||
ModelRenderer Collumn2;
|
||||
ModelRenderer Collumn3;
|
||||
ModelRenderer Collumn4;
|
||||
ModelRenderer CrossCollumn1;
|
||||
ModelRenderer CrossCollumn2;
|
||||
ModelRenderer CrossCollumn3;
|
||||
ModelRenderer CrossCollumn4;
|
||||
ModelRenderer CrossCollumn5;
|
||||
ModelRenderer CrossCollumn6;
|
||||
ModelRenderer CrossCollumn7;
|
||||
ModelRenderer CrossCollumn8;
|
||||
ModelRenderer HolderLeft;
|
||||
ModelRenderer FrontCoil;
|
||||
ModelRenderer RightCoil;
|
||||
ModelRenderer BackCoil;
|
||||
ModelRenderer LeftCoil;
|
||||
ModelRenderer LFSCoil;
|
||||
ModelRenderer RFSCoil;
|
||||
ModelRenderer RBSCoil;
|
||||
ModelRenderer LBSCoil;
|
||||
|
||||
public ModelTeslaTop()
|
||||
{
|
||||
textureWidth = 128;
|
||||
textureHeight = 128;
|
||||
|
||||
Base = new ModelRenderer(this, 0, 0);
|
||||
Base.addBox(0F, 0F, 0F, 4, 4, 4);
|
||||
Base.setRotationPoint(-2F, 20F, -2F);
|
||||
Base.setTextureSize(128, 128);
|
||||
Base.mirror = true;
|
||||
setRotation(Base, 0F, 0F, 0F);
|
||||
Collumn1 = new ModelRenderer(this, 0, 9);
|
||||
Collumn1.addBox(0F, 0F, 0F, 1, 6, 1);
|
||||
Collumn1.setRotationPoint(1F, 14F, 1F);
|
||||
Collumn1.setTextureSize(128, 128);
|
||||
Collumn1.mirror = true;
|
||||
setRotation(Collumn1, 0F, 0F, 0F);
|
||||
Collumn2 = new ModelRenderer(this, 0, 9);
|
||||
Collumn2.addBox(0F, 0F, 0F, 1, 6, 1);
|
||||
Collumn2.setRotationPoint(1F, 14F, -2F);
|
||||
Collumn2.setTextureSize(128, 128);
|
||||
Collumn2.mirror = true;
|
||||
setRotation(Collumn2, 0F, 0F, 0F);
|
||||
Collumn3 = new ModelRenderer(this, 0, 9);
|
||||
Collumn3.addBox(0F, 0F, 0F, 1, 6, 1);
|
||||
Collumn3.setRotationPoint(-2F, 14F, -2F);
|
||||
Collumn3.setTextureSize(128, 128);
|
||||
Collumn3.mirror = true;
|
||||
setRotation(Collumn3, 0F, 0F, 0F);
|
||||
Collumn4 = new ModelRenderer(this, 0, 9);
|
||||
Collumn4.addBox(0F, 0F, 0F, 1, 6, 1);
|
||||
Collumn4.setRotationPoint(-2F, 14F, 1F);
|
||||
Collumn4.setTextureSize(128, 128);
|
||||
Collumn4.mirror = true;
|
||||
setRotation(Collumn4, 0F, 0F, 0F);
|
||||
CrossCollumn1 = new ModelRenderer(this, 17, 0);
|
||||
CrossCollumn1.addBox(0F, 0F, 0F, 1, 1, 2);
|
||||
CrossCollumn1.setRotationPoint(-2F, 16.5F, -1F);
|
||||
CrossCollumn1.setTextureSize(128, 128);
|
||||
CrossCollumn1.mirror = true;
|
||||
setRotation(CrossCollumn1, 0F, 0F, 0F);
|
||||
CrossCollumn2 = new ModelRenderer(this, 17, 0);
|
||||
CrossCollumn2.addBox(0F, 0F, 0F, 2, 1, 1);
|
||||
CrossCollumn2.setRotationPoint(-1F, 15.5F, -2F);
|
||||
CrossCollumn2.setTextureSize(128, 128);
|
||||
CrossCollumn2.mirror = true;
|
||||
setRotation(CrossCollumn2, 0F, 0F, 0F);
|
||||
CrossCollumn3 = new ModelRenderer(this, 17, 0);
|
||||
CrossCollumn3.addBox(0F, 0F, 0F, 1, 1, 2);
|
||||
CrossCollumn3.setRotationPoint(-2F, 14.5F, -1F);
|
||||
CrossCollumn3.setTextureSize(128, 128);
|
||||
CrossCollumn3.mirror = true;
|
||||
setRotation(CrossCollumn3, 0F, 0F, 0F);
|
||||
CrossCollumn4 = new ModelRenderer(this, 17, 0);
|
||||
CrossCollumn4.addBox(0F, 0F, 0F, 1, 1, 2);
|
||||
CrossCollumn4.setRotationPoint(1F, 14.5F, -1F);
|
||||
CrossCollumn4.setTextureSize(128, 128);
|
||||
CrossCollumn4.mirror = true;
|
||||
setRotation(CrossCollumn4, 0F, 0F, 0F);
|
||||
CrossCollumn5 = new ModelRenderer(this, 17, 0);
|
||||
CrossCollumn5.addBox(0F, 0F, 0F, 1, 1, 2);
|
||||
CrossCollumn5.setRotationPoint(1F, 16.5F, -1F);
|
||||
CrossCollumn5.setTextureSize(128, 128);
|
||||
CrossCollumn5.mirror = true;
|
||||
setRotation(CrossCollumn5, 0F, 0F, 0F);
|
||||
CrossCollumn6 = new ModelRenderer(this, 17, 0);
|
||||
CrossCollumn6.addBox(0F, 0F, 0F, 2, 1, 1);
|
||||
CrossCollumn6.setRotationPoint(-1F, 15.5F, 1F);
|
||||
CrossCollumn6.setTextureSize(128, 128);
|
||||
CrossCollumn6.mirror = true;
|
||||
setRotation(CrossCollumn6, 0F, 0F, 0F);
|
||||
CrossCollumn7 = new ModelRenderer(this, 17, 0);
|
||||
CrossCollumn7.addBox(0F, 0F, 0F, 2, 1, 1);
|
||||
CrossCollumn7.setRotationPoint(-1F, 17.5F, -2F);
|
||||
CrossCollumn7.setTextureSize(128, 128);
|
||||
CrossCollumn7.mirror = true;
|
||||
setRotation(CrossCollumn7, 0F, 0F, 0F);
|
||||
CrossCollumn8 = new ModelRenderer(this, 17, 0);
|
||||
CrossCollumn8.addBox(0F, 0F, 0F, 2, 1, 1);
|
||||
CrossCollumn8.setRotationPoint(-1F, 17.5F, 1F);
|
||||
CrossCollumn8.setTextureSize(128, 128);
|
||||
CrossCollumn8.mirror = true;
|
||||
setRotation(CrossCollumn8, 0F, 0F, 0F);
|
||||
HolderLeft = new ModelRenderer(this, 5, 9);
|
||||
HolderLeft.addBox(0F, 0F, 0F, 2, 5, 2);
|
||||
HolderLeft.setRotationPoint(-1F, 10.5F, -1F);
|
||||
HolderLeft.setTextureSize(128, 128);
|
||||
HolderLeft.mirror = true;
|
||||
setRotation(HolderLeft, 0F, 0F, 0F);
|
||||
FrontCoil = new ModelRenderer(this, 26, 0);
|
||||
FrontCoil.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
FrontCoil.setRotationPoint(-3F, 11F, -4F);
|
||||
FrontCoil.setTextureSize(128, 128);
|
||||
FrontCoil.mirror = true;
|
||||
setRotation(FrontCoil, 0F, 0F, 0F);
|
||||
RightCoil = new ModelRenderer(this, 26, 4);
|
||||
RightCoil.addBox(0F, 0F, 0F, 1, 2, 6);
|
||||
RightCoil.setRotationPoint(3F, 11.02222F, -3F);
|
||||
RightCoil.setTextureSize(128, 128);
|
||||
RightCoil.mirror = true;
|
||||
setRotation(RightCoil, 0F, 0F, 0F);
|
||||
BackCoil = new ModelRenderer(this, 26, 0);
|
||||
BackCoil.addBox(0F, 0F, 0F, 6, 2, 1);
|
||||
BackCoil.setRotationPoint(-3F, 11F, 3F);
|
||||
BackCoil.setTextureSize(128, 128);
|
||||
BackCoil.mirror = true;
|
||||
setRotation(BackCoil, 0F, 0F, 0F);
|
||||
LeftCoil = new ModelRenderer(this, 26, 4);
|
||||
LeftCoil.addBox(0F, 0F, 0F, 1, 2, 6);
|
||||
LeftCoil.setRotationPoint(-4F, 11.02222F, -3F);
|
||||
LeftCoil.setTextureSize(128, 128);
|
||||
LeftCoil.mirror = true;
|
||||
setRotation(LeftCoil, 0F, 0F, 0F);
|
||||
LFSCoil = new ModelRenderer(this, 0, 20);
|
||||
LFSCoil.addBox(0F, 0F, 0F, 1, 2, 1);
|
||||
LFSCoil.setRotationPoint(-3F, 11F, -3F);
|
||||
LFSCoil.setTextureSize(128, 128);
|
||||
LFSCoil.mirror = true;
|
||||
setRotation(LFSCoil, 0F, 0F, 0F);
|
||||
RFSCoil = new ModelRenderer(this, 0, 20);
|
||||
RFSCoil.addBox(0F, 0F, 0F, 1, 2, 1);
|
||||
RFSCoil.setRotationPoint(2F, 11F, -3F);
|
||||
RFSCoil.setTextureSize(128, 128);
|
||||
RFSCoil.mirror = true;
|
||||
setRotation(RFSCoil, 0F, 0F, 0F);
|
||||
RBSCoil = new ModelRenderer(this, 0, 20);
|
||||
RBSCoil.addBox(0F, 0F, 0F, 1, 2, 1);
|
||||
RBSCoil.setRotationPoint(2F, 11F, 2F);
|
||||
RBSCoil.setTextureSize(128, 128);
|
||||
RBSCoil.mirror = true;
|
||||
setRotation(RBSCoil, 0F, 0F, 0F);
|
||||
LBSCoil = new ModelRenderer(this, 0, 20);
|
||||
LBSCoil.addBox(0F, 0F, 0F, 1, 2, 1);
|
||||
LBSCoil.setRotationPoint(-3F, 11F, 2F);
|
||||
LBSCoil.setTextureSize(128, 128);
|
||||
LBSCoil.mirror = true;
|
||||
setRotation(LBSCoil, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(float f5)
|
||||
{
|
||||
Base.render(f5);
|
||||
Collumn1.render(f5);
|
||||
Collumn2.render(f5);
|
||||
Collumn3.render(f5);
|
||||
Collumn4.render(f5);
|
||||
CrossCollumn1.render(f5);
|
||||
CrossCollumn2.render(f5);
|
||||
CrossCollumn3.render(f5);
|
||||
CrossCollumn4.render(f5);
|
||||
CrossCollumn5.render(f5);
|
||||
CrossCollumn6.render(f5);
|
||||
CrossCollumn7.render(f5);
|
||||
CrossCollumn8.render(f5);
|
||||
HolderLeft.render(f5);
|
||||
FrontCoil.render(f5);
|
||||
RightCoil.render(f5);
|
||||
BackCoil.render(f5);
|
||||
LeftCoil.render(f5);
|
||||
LFSCoil.render(f5);
|
||||
RFSCoil.render(f5);
|
||||
RBSCoil.render(f5);
|
||||
LBSCoil.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +1,10 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package resonantinduction.electrical.tesla;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
@ -23,32 +22,32 @@ public class RenderTesla extends TileEntitySpecialRenderer
|
|||
public static final ResourceLocation TEXTURE_BOTTOM = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "tesla_bottom.png");
|
||||
public static final ResourceLocation TEXTURE_MIDDLE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "tesla_middle.png");
|
||||
public static final ResourceLocation TEXTURE_TOP = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "tesla_top.png");
|
||||
public static final ModelTeslaBottom MODEL_BOTTOM = new ModelTeslaBottom();
|
||||
public static final ModelTeslaMiddle MODEL_MIDDLE = new ModelTeslaMiddle();
|
||||
public static final ModelTeslaTop MODEL_TOP = new ModelTeslaTop();
|
||||
|
||||
public static final IModelCustom MODEL_BOTTOM = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "teslaBottom.tcn");
|
||||
public static final IModelCustom MODEL_MIDDLE = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "teslaMiddle.tcn");
|
||||
public static final IModelCustom MODEL_TOP = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "teslaTop.tcn");
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||
|
||||
int facing = t.getBlockType() != null ? t.getBlockMetadata() : 0;
|
||||
int meta = t.getBlockType() != null ? t.getBlockMetadata() : 0;
|
||||
|
||||
switch (facing)
|
||||
switch (meta)
|
||||
{
|
||||
default:
|
||||
this.bindTexture(TEXTURE_BOTTOM);
|
||||
MODEL_BOTTOM.render(0.0625f);
|
||||
bindTexture(TEXTURE_BOTTOM);
|
||||
MODEL_BOTTOM.renderAll();
|
||||
break;
|
||||
case 1:
|
||||
this.bindTexture(TEXTURE_MIDDLE);
|
||||
MODEL_MIDDLE.render(0.0625f);
|
||||
bindTexture(TEXTURE_MIDDLE);
|
||||
MODEL_MIDDLE.renderAll();
|
||||
break;
|
||||
case 2:
|
||||
this.bindTexture(TEXTURE_TOP);
|
||||
MODEL_TOP.render(0.0625f);
|
||||
bindTexture(TEXTURE_TOP);
|
||||
MODEL_TOP.renderAll();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue