Begin implementing that sexy model

don’t recommend this build for personal use
This commit is contained in:
Aidan Brady 2013-11-20 20:28:06 -05:00
parent 8ce5876200
commit 34f300cf6f
7 changed files with 393 additions and 11 deletions

View file

@ -42,6 +42,7 @@ import mekanism.client.render.item.ItemRenderingHandler;
import mekanism.client.render.tileentity.RenderBin;
import mekanism.client.render.tileentity.RenderChargepad;
import mekanism.client.render.tileentity.RenderConfigurableMachine;
import mekanism.client.render.tileentity.RenderDigitalMiner;
import mekanism.client.render.tileentity.RenderDynamicTank;
import mekanism.client.render.tileentity.RenderElectricChest;
import mekanism.client.render.tileentity.RenderElectricPump;
@ -106,7 +107,6 @@ import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -250,7 +250,7 @@ public class ClientProxy extends CommonProxy
ClientRegistry.registerTileEntity(TileEntityLogisticalTransporter.class, "LogisticalTransporter", new RenderLogisticalTransporter());
ClientRegistry.registerTileEntity(TileEntityLogisticalSorter.class, "LogisticalSorter", new RenderLogisticalSorter());
ClientRegistry.registerTileEntity(TileEntityBin.class, "Bin", new RenderBin());
GameRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner"); //TODO model
ClientRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner", new RenderDigitalMiner());
}
@Override

View file

@ -0,0 +1,338 @@
package mekanism.client.model;
import mekanism.client.render.MekanismRenderer;
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 ModelDigitalMiner extends ModelBase
{
ModelRenderer Base;
ModelRenderer Back;
ModelRenderer Panel;
ModelRenderer PanelStem;
ModelRenderer KeyboardStem;
ModelRenderer Keyboard;
ModelRenderer LaserBase;
ModelRenderer LegRight;
ModelRenderer UpperLegRight;
ModelRenderer ToeTopRight1;
ModelRenderer ToeTopRight2;
ModelRenderer ToeRight1;
ModelRenderer LegHoldRight1;
ModelRenderer LegHoldRight2;
ModelRenderer FootBaseRight;
ModelRenderer ToeRight2;
ModelRenderer FootBaseLeft;
ModelRenderer UpperLegLeft;
ModelRenderer LegHoldLeft1;
ModelRenderer ToeTopLeft2;
ModelRenderer ToeTopLeft1;
ModelRenderer LegHoldLeft2;
ModelRenderer ToeLeft1;
ModelRenderer ToeLeft2;
ModelRenderer LegLeft;
ModelRenderer RightAxil;
ModelRenderer RightBackUpperLeg;
ModelRenderer RightBackLowerLeg;
ModelRenderer RightBackFoot;
ModelRenderer LeftAxil;
ModelRenderer LeftBackUpperLeg;
ModelRenderer LeftBackLowerLeg;
ModelRenderer LeftBackFoot;
ModelRenderer Laser1;
ModelRenderer Laser2;
ModelRenderer Laser3;
ModelRenderer Laser4;
public ModelDigitalMiner()
{
textureWidth = 256;
textureHeight = 256;
Base = new ModelRenderer(this, 0, 0);
Base.addBox(0F, 0F, 0F, 18, 22, 20);
Base.setRotationPoint(-8F, -8F, -10F);
Base.setTextureSize(256, 256);
Base.mirror = true;
setRotation(Base, 0F, 0F, 0F);
Back = new ModelRenderer(this, 77, 0);
Back.addBox(0F, 0F, 0F, 17, 20, 18);
Back.setRotationPoint(7F, -7F, -9F);
Back.setTextureSize(256, 256);
Back.mirror = true;
setRotation(Back, 0F, 0F, 0F);
Panel = new ModelRenderer(this, 0, 43);
Panel.addBox(-2F, -8F, -7.5F, 2, 12, 15);
Panel.setRotationPoint(-13F, 2F, 0F);
Panel.setTextureSize(256, 256);
Panel.mirror = true;
setRotation(Panel, 0F, 0F, -0.2478574F);
PanelStem = new ModelRenderer(this, 0, 71);
PanelStem.addBox(-7F, 0F, 0F, 7, 4, 4);
PanelStem.setRotationPoint(-7F, -2F, -2F);
PanelStem.setTextureSize(256, 256);
PanelStem.mirror = true;
setRotation(PanelStem, 0F, 0F, -0.2230717F);
KeyboardStem = new ModelRenderer(this, 0, 80);
KeyboardStem.addBox(-7F, 0F, -2F, 7, 1, 4);
KeyboardStem.setRotationPoint(-7F, 8F, 0F);
KeyboardStem.setTextureSize(256, 256);
KeyboardStem.mirror = true;
setRotation(KeyboardStem, 0F, 0F, -0.3965719F);
Keyboard = new ModelRenderer(this, 0, 86);
Keyboard.addBox(-5F, 0F, -5F, 5, 1, 10);
Keyboard.setRotationPoint(-12F, 10.5F, 0F);
Keyboard.setTextureSize(256, 256);
Keyboard.mirror = true;
setRotation(Keyboard, 0F, 0F, -0.2230717F);
LaserBase = new ModelRenderer(this, 0, 98);
LaserBase.addBox(0F, 0F, 0F, 10, 5, 10);
LaserBase.setRotationPoint(-5F, 12F, -5F);
LaserBase.setTextureSize(256, 256);
LaserBase.mirror = true;
setRotation(LaserBase, 0F, 0F, 0F);
LegRight = new ModelRenderer(this, 0, 114);
LegRight.addBox(0F, 0F, 0F, 6, 26, 4);
LegRight.setRotationPoint(-3F, -4F, -23F);
LegRight.setTextureSize(256, 256);
LegRight.mirror = true;
setRotation(LegRight, 0F, 0F, 0F);
UpperLegRight = new ModelRenderer(this, 21, 114);
UpperLegRight.addBox(0F, 0F, 0F, 4, 5, 13);
UpperLegRight.setRotationPoint(-2F, 0F, -22F);
UpperLegRight.setTextureSize(256, 256);
UpperLegRight.mirror = true;
setRotation(UpperLegRight, 0F, 0F, 0F);
ToeTopRight1 = new ModelRenderer(this, 21, 134);
ToeTopRight1.addBox(0F, 0F, 0F, 3, 1, 3);
ToeTopRight1.setRotationPoint(-4F, 19F, -20.5F);
ToeTopRight1.setTextureSize(256, 256);
ToeTopRight1.mirror = true;
setRotation(ToeTopRight1, 0F, 0F, 0F);
ToeTopRight2 = new ModelRenderer(this, 21, 134);
ToeTopRight2.addBox(0F, 0F, 0F, 3, 1, 3);
ToeTopRight2.setRotationPoint(1.5F, 19F, -20.5F);
ToeTopRight2.setTextureSize(256, 256);
ToeTopRight2.mirror = true;
setRotation(ToeTopRight2, 0F, 0F, 0F);
ToeRight1 = new ModelRenderer(this, 35, 134);
ToeRight1.addBox(0F, 0F, 0F, 3, 6, 3);
ToeRight1.setRotationPoint(1.5F, 22F, -20.5F);
ToeRight1.setTextureSize(256, 256);
ToeRight1.mirror = true;
setRotation(ToeRight1, 1.047198F, 0.3490659F, 0F);
LegHoldRight1 = new ModelRenderer(this, 0, 146);
LegHoldRight1.addBox(0F, 0F, 0F, 2, 3, 12);
LegHoldRight1.setRotationPoint(2F, 2F, -18F);
LegHoldRight1.setTextureSize(256, 256);
LegHoldRight1.mirror = true;
setRotation(LegHoldRight1, 0.6543436F, 0F, 0F);
LegHoldRight2 = new ModelRenderer(this, 0, 146);
LegHoldRight2.addBox(0F, 0F, 0F, 2, 3, 12);
LegHoldRight2.setRotationPoint(-4F, 2F, -18F);
LegHoldRight2.setTextureSize(256, 256);
LegHoldRight2.mirror = true;
setRotation(LegHoldRight2, 0.6543436F, 0F, 0F);
FootBaseRight = new ModelRenderer(this, 0, 162);
FootBaseRight.addBox(0F, 0F, 0F, 8, 2, 7);
FootBaseRight.setRotationPoint(-4F, 22F, -24F);
FootBaseRight.setTextureSize(256, 256);
FootBaseRight.mirror = true;
setRotation(FootBaseRight, 0F, 0F, 0F);
ToeRight2 = new ModelRenderer(this, 35, 134);
ToeRight2.addBox(0F, 0F, 0F, 3, 6, 3);
ToeRight2.setRotationPoint(-4.5F, 22F, -20.5F);
ToeRight2.setTextureSize(256, 256);
ToeRight2.mirror = true;
setRotation(ToeRight2, 1.047198F, -0.3490659F, 0F);
FootBaseLeft = new ModelRenderer(this, 0, 178);
FootBaseLeft.addBox(0F, 0F, 0F, 8, 2, 7);
FootBaseLeft.setRotationPoint(-4F, 22F, 17F);
FootBaseLeft.setTextureSize(256, 256);
FootBaseLeft.mirror = true;
setRotation(FootBaseLeft, 0F, 0F, 0F);
UpperLegLeft = new ModelRenderer(this, 0, 189);
UpperLegLeft.addBox(0F, 0F, 0F, 4, 5, 13);
UpperLegLeft.setRotationPoint(-2F, 0F, 9F);
UpperLegLeft.setTextureSize(256, 256);
UpperLegLeft.mirror = true;
setRotation(UpperLegLeft, 0F, 0F, 0F);
LegHoldLeft1 = new ModelRenderer(this, 0, 208);
LegHoldLeft1.addBox(0F, 0F, -12F, 2, 3, 12);
LegHoldLeft1.setRotationPoint(2F, 2F, 18F);
LegHoldLeft1.setTextureSize(256, 256);
LegHoldLeft1.mirror = true;
setRotation(LegHoldLeft1, -0.6543414F, 0F, 0F);
ToeTopLeft2 = new ModelRenderer(this, 31, 178);
ToeTopLeft2.addBox(0F, 0F, 0F, 3, 1, 3);
ToeTopLeft2.setRotationPoint(1.5F, 19F, 17.5F);
ToeTopLeft2.setTextureSize(256, 256);
ToeTopLeft2.mirror = true;
setRotation(ToeTopLeft2, 0F, 0F, 0F);
ToeTopLeft1 = new ModelRenderer(this, 31, 178);
ToeTopLeft1.addBox(0F, 0F, 0F, 3, 1, 3);
ToeTopLeft1.setRotationPoint(-4F, 19F, 17.5F);
ToeTopLeft1.setTextureSize(256, 256);
ToeTopLeft1.mirror = true;
setRotation(ToeTopLeft1, 0F, 0F, 0F);
LegHoldLeft2 = new ModelRenderer(this, 0, 208);
LegHoldLeft2.addBox(0F, 0F, -12F, 2, 3, 12);
LegHoldLeft2.setRotationPoint(-4F, 2F, 18F);
LegHoldLeft2.setTextureSize(256, 256);
LegHoldLeft2.mirror = true;
setRotation(LegHoldLeft2, -0.6543414F, 0F, 0F);
ToeLeft1 = new ModelRenderer(this, 44, 178);
ToeLeft1.addBox(0F, 0F, -3F, 3, 6, 3);
ToeLeft1.setRotationPoint(1.5F, 22F, 20.5F);
ToeLeft1.setTextureSize(256, 256);
ToeLeft1.mirror = true;
setRotation(ToeLeft1, -1.047198F, -0.3490659F, 0F);
ToeLeft2 = new ModelRenderer(this, 44, 178);
ToeLeft2.addBox(0F, 0F, -3F, 3, 6, 3);
ToeLeft2.setRotationPoint(-4.5F, 22F, 20.5F);
ToeLeft2.setTextureSize(256, 256);
ToeLeft2.mirror = true;
setRotation(ToeLeft2, -1.047198F, 0.3490659F, 0F);
LegLeft = new ModelRenderer(this, 35, 189);
LegLeft.addBox(0F, 0F, 0F, 6, 26, 4);
LegLeft.setRotationPoint(-3F, -4F, 19F);
LegLeft.setTextureSize(256, 256);
LegLeft.mirror = true;
setRotation(LegLeft, 0F, 0F, 0F);
RightAxil = new ModelRenderer(this, 78, 43);
RightAxil.addBox(0F, 0F, 0F, 4, 4, 6);
RightAxil.setRotationPoint(17F, 7F, -15F);
RightAxil.setTextureSize(256, 256);
RightAxil.mirror = true;
setRotation(RightAxil, 0F, 0F, 0F);
RightBackUpperLeg = new ModelRenderer(this, 78, 54);
RightBackUpperLeg.addBox(-2.5F, -3F, 0F, 5, 12, 1);
RightBackUpperLeg.setRotationPoint(19F, 9F, -15.95556F);
RightBackUpperLeg.setTextureSize(256, 256);
RightBackUpperLeg.mirror = true;
setRotation(RightBackUpperLeg, 0F, 0F, 0F);
RightBackLowerLeg = new ModelRenderer(this, 78, 68);
RightBackLowerLeg.addBox(-2F, 7F, -0.5F, 4, 6, 2);
RightBackLowerLeg.setRotationPoint(19F, 9F, -16F);
RightBackLowerLeg.setTextureSize(256, 256);
RightBackLowerLeg.mirror = true;
setRotation(RightBackLowerLeg, 0F, 0F, 0F);
RightBackFoot = new ModelRenderer(this, 99, 43);
RightBackFoot.addBox(-3F, 0F, -2.5F, 8, 2, 5);
RightBackFoot.setRotationPoint(19F, 22F, -15.5F);
RightBackFoot.setTextureSize(256, 256);
RightBackFoot.mirror = true;
setRotation(RightBackFoot, 0F, 0F, 0F);
LeftAxil = new ModelRenderer(this, 78, 80);
LeftAxil.addBox(0F, 0F, 0F, 4, 4, 6);
LeftAxil.setRotationPoint(17F, 7F, 9F);
LeftAxil.setTextureSize(256, 256);
LeftAxil.mirror = true;
setRotation(LeftAxil, 0F, 0F, 0F);
LeftBackUpperLeg = new ModelRenderer(this, 78, 91);
LeftBackUpperLeg.addBox(-2.5F, -3F, 0F, 5, 12, 1);
LeftBackUpperLeg.setRotationPoint(19F, 9F, 15.04444F);
LeftBackUpperLeg.setTextureSize(256, 256);
LeftBackUpperLeg.mirror = true;
setRotation(LeftBackUpperLeg, 0F, 0F, 0F);
LeftBackLowerLeg = new ModelRenderer(this, 78, 105);
LeftBackLowerLeg.addBox(-2F, 7F, -0.5F, 4, 6, 2);
LeftBackLowerLeg.setRotationPoint(19F, 9F, 15F);
LeftBackLowerLeg.setTextureSize(256, 256);
LeftBackLowerLeg.mirror = true;
setRotation(LeftBackLowerLeg, 0F, 0F, 0F);
LeftBackFoot = new ModelRenderer(this, 99, 80);
LeftBackFoot.addBox(-3F, 0F, -2.5F, 8, 2, 5);
LeftBackFoot.setRotationPoint(19F, 22F, 15.5F);
LeftBackFoot.setTextureSize(256, 256);
LeftBackFoot.mirror = true;
setRotation(LeftBackFoot, 0F, 0F, 0F);
Laser1 = new ModelRenderer(this, 35, 43);
Laser1.addBox(0F, 0F, 0F, 2, 4, 2);
Laser1.setRotationPoint(2.5F, 17F, 2.5F);
Laser1.setTextureSize(256, 256);
Laser1.mirror = true;
setRotation(Laser1, 0F, 0F, 0F);
Laser2 = new ModelRenderer(this, 35, 43);
Laser2.addBox(0F, 0F, 0F, 2, 4, 2);
Laser2.setRotationPoint(2.5F, 17F, -4.5F);
Laser2.setTextureSize(256, 256);
Laser2.mirror = true;
setRotation(Laser2, 0F, 0F, 0F);
Laser3 = new ModelRenderer(this, 35, 43);
Laser3.addBox(0F, 0F, 0F, 2, 4, 2);
Laser3.setRotationPoint(-4.5F, 17F, 2.5F);
Laser3.setTextureSize(256, 256);
Laser3.mirror = true;
setRotation(Laser3, 0F, 0F, 0F);
Laser4 = new ModelRenderer(this, 35, 43);
Laser4.addBox(0F, 0F, 0F, 2, 4, 2);
Laser4.setRotationPoint(-4.5F, 17F, -4.5F);
Laser4.setTextureSize(256, 256);
Laser4.mirror = true;
setRotation(Laser4, 0F, 0F, 0F);
}
public void render(float size, boolean on)
{
Base.render(size);
Back.render(size);
if(on)
{
MekanismRenderer.glowOn();
}
Panel.render(size);
if(on)
{
MekanismRenderer.glowOff();
}
PanelStem.render(size);
KeyboardStem.render(size);
Keyboard.render(size);
LaserBase.render(size);
LegRight.render(size);
UpperLegRight.render(size);
ToeTopRight1.render(size);
ToeTopRight2.render(size);
ToeRight1.render(size);
LegHoldRight1.render(size);
LegHoldRight2.render(size);
FootBaseRight.render(size);
ToeRight2.render(size);
FootBaseLeft.render(size);
UpperLegLeft.render(size);
LegHoldLeft1.render(size);
ToeTopLeft2.render(size);
ToeTopLeft1.render(size);
LegHoldLeft2.render(size);
ToeLeft1.render(size);
ToeLeft2.render(size);
LegLeft.render(size);
RightAxil.render(size);
RightBackUpperLeg.render(size);
RightBackLowerLeg.render(size);
RightBackFoot.render(size);
LeftAxil.render(size);
LeftBackUpperLeg.render(size);
LeftBackLowerLeg.render(size);
LeftBackFoot.render(size);
Laser1.render(size);
Laser2.render(size);
Laser3.render(size);
Laser4.render(size);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -2,6 +2,7 @@ package mekanism.client.render.block;
import mekanism.client.ClientProxy;
import mekanism.client.model.ModelChargepad;
import mekanism.client.model.ModelDigitalMiner;
import mekanism.client.model.ModelElectricPump;
import mekanism.client.model.ModelLogisticalSorter;
import mekanism.client.model.ModelMetallurgicInfuser;
@ -27,6 +28,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
public ModelMetallurgicInfuser metallurgicInfuser = new ModelMetallurgicInfuser();
public ModelChargepad chargepad = new ModelChargepad();
public ModelLogisticalSorter logisticalSorter = new ModelLogisticalSorter();
public ModelDigitalMiner digitalMiner = new ModelDigitalMiner();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
@ -70,6 +72,11 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalSorter.png"));
logisticalSorter.render(0.0625F, false);
}
else if(metadata == MachineType.DIGITAL_MINER.meta)
{
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "DigitalMiner.png"));
digitalMiner.render(0.0625F, false);
}
else {
MekanismRenderer.renderItem(renderer, metadata, block);
}

View file

@ -0,0 +1,45 @@
package mekanism.client.render.tileentity;
import mekanism.client.model.ModelDigitalMiner;
import mekanism.common.tileentity.TileEntityDigitalMiner;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderDigitalMiner extends TileEntitySpecialRenderer
{
private ModelDigitalMiner model = new ModelDigitalMiner();
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
{
renderAModelAt((TileEntityDigitalMiner)tileEntity, x, y, z, partialTick);
}
private void renderAModelAt(TileEntityDigitalMiner tileEntity, double x, double y, double z, float partialTick)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "DigitalMiner" + (tileEntity.isActive ? "" : "On") + ".png"));
switch(tileEntity.facing)
{
case 2: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break;
case 3: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break;
case 4: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break;
case 5: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break;
}
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
model.render(0.0625F, true);
GL11.glPopMatrix();
}
}

View file

@ -362,10 +362,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
{
return icons[blockID][11][0];
}
else if(meta == 4)
{
return icons[blockID][0][2]; //TODO
}
}
return null;
@ -484,10 +480,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
{
return icons[blockID][11][0];
}
else if(metadata == 4)
{
return icons[blockID][0][2]; //TODO
}
return null;
}
@ -907,7 +899,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
OSMIUM_COMPRESSOR(Mekanism.machineBlockID, 1, "OsmiumCompressor", 4, Mekanism.osmiumCompressorUsage*400, TileEntityOsmiumCompressor.class, false),
COMBINER(Mekanism.machineBlockID, 2, "Combiner", 5, Mekanism.combinerUsage*400, TileEntityCombiner.class, false),
CRUSHER(Mekanism.machineBlockID, 3, "Crusher", 6, Mekanism.crusherUsage*400, TileEntityCrusher.class, false),
DIGITAL_MINER(Mekanism.machineBlockID, 4, "DigitalMiner", 2, 100000, TileEntityDigitalMiner.class, false),//TODO
DIGITAL_MINER(Mekanism.machineBlockID, 4, "DigitalMiner", 2, 100000, TileEntityDigitalMiner.class, true),
BASIC_FACTORY(Mekanism.machineBlockID, 5, "BasicFactory", 11, Mekanism.factoryUsage*3*400, TileEntityFactory.class, false),
ADVANCED_FACTORY(Mekanism.machineBlockID, 6, "AdvancedFactory", 11, Mekanism.factoryUsage*5*400, TileEntityAdvancedFactory.class, false),
ELITE_FACTORY(Mekanism.machineBlockID, 7, "EliteFactory", 11, Mekanism.factoryUsage*7*400, TileEntityEliteFactory.class, false),

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB