New Electric Pump model!
This commit is contained in:
parent
2ecc48021d
commit
c3fa020561
10 changed files with 129 additions and 155 deletions
|
@ -1,160 +1,109 @@
|
|||
package mekanism.client.model;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelElectricPump extends ModelBase
|
||||
{
|
||||
ModelRenderer COREBOX;
|
||||
ModelRenderer INPUTSLOT2;
|
||||
ModelRenderer INPUTSLOT3;
|
||||
ModelRenderer INPUTSLOT4;
|
||||
ModelRenderer INPUTSLOT5;
|
||||
ModelRenderer INPUTSLOT1;
|
||||
ModelRenderer PIPE3;
|
||||
ModelRenderer PIPE2;
|
||||
ModelRenderer TOPPIPE3;
|
||||
ModelRenderer PIPE1;
|
||||
ModelRenderer CORESLOT;
|
||||
ModelRenderer PIPE4;
|
||||
ModelRenderer TOPPIPE2;
|
||||
ModelRenderer DISPLAY2;
|
||||
ModelRenderer TOPPIPE1;
|
||||
ModelRenderer TOPPIPE4;
|
||||
ModelRenderer DISPLAY1;
|
||||
ModelRenderer PumpHead;
|
||||
ModelRenderer Connector;
|
||||
ModelRenderer Panel1;
|
||||
ModelRenderer Panel2;
|
||||
ModelRenderer Panel3;
|
||||
ModelRenderer Body;
|
||||
ModelRenderer Axil;
|
||||
ModelRenderer Axil2;
|
||||
ModelRenderer Ring1;
|
||||
ModelRenderer Ring2;
|
||||
ModelRenderer Plug;
|
||||
|
||||
public ModelElectricPump()
|
||||
{
|
||||
textureWidth = 128;
|
||||
textureHeight = 128;
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
|
||||
COREBOX = new ModelRenderer(this, 0, 0);
|
||||
COREBOX.addBox(0F, 0F, 0F, 12, 12, 12);
|
||||
COREBOX.setRotationPoint(-6F, 10F, -6F);
|
||||
COREBOX.setTextureSize(128, 128);
|
||||
COREBOX.mirror = true;
|
||||
setRotation(COREBOX, 0F, 0F, 0F);
|
||||
INPUTSLOT2 = new ModelRenderer(this, 0, 24);
|
||||
INPUTSLOT2.addBox(0F, 0F, 0F, 2, 6, 6);
|
||||
INPUTSLOT2.setRotationPoint(6F, 13F, -3F);
|
||||
INPUTSLOT2.setTextureSize(128, 128);
|
||||
INPUTSLOT2.mirror = true;
|
||||
setRotation(INPUTSLOT2, 0F, 0F, 0F);
|
||||
INPUTSLOT3 = new ModelRenderer(this, 16, 24);
|
||||
INPUTSLOT3.addBox(0F, 0F, 0F, 6, 6, 2);
|
||||
INPUTSLOT3.setRotationPoint(-3F, 13F, 6F);
|
||||
INPUTSLOT3.setTextureSize(128, 128);
|
||||
INPUTSLOT3.mirror = true;
|
||||
setRotation(INPUTSLOT3, 0F, 0F, 0F);
|
||||
INPUTSLOT4 = new ModelRenderer(this, 16, 24);
|
||||
INPUTSLOT4.addBox(0F, 0F, 0F, 6, 6, 2);
|
||||
INPUTSLOT4.setRotationPoint(-3F, 13F, -8F);
|
||||
INPUTSLOT4.setTextureSize(128, 128);
|
||||
INPUTSLOT4.mirror = true;
|
||||
setRotation(INPUTSLOT4, 0F, 0F, 0F);
|
||||
INPUTSLOT5 = new ModelRenderer(this, 0, 44);
|
||||
INPUTSLOT5.addBox(0F, 0F, 0F, 6, 2, 6);
|
||||
INPUTSLOT5.setRotationPoint(-3F, 22F, -3F);
|
||||
INPUTSLOT5.setTextureSize(128, 128);
|
||||
INPUTSLOT5.mirror = true;
|
||||
setRotation(INPUTSLOT5, 0F, 0F, 0F);
|
||||
INPUTSLOT1 = new ModelRenderer(this, 0, 24);
|
||||
INPUTSLOT1.addBox(0F, 0F, 0F, 2, 6, 6);
|
||||
INPUTSLOT1.setRotationPoint(-8F, 13F, -3F);
|
||||
INPUTSLOT1.setTextureSize(128, 128);
|
||||
INPUTSLOT1.mirror = true;
|
||||
setRotation(INPUTSLOT1, 0F, 0F, 0F);
|
||||
PIPE3 = new ModelRenderer(this, 48, 0);
|
||||
PIPE3.addBox(0F, 0F, 0F, 2, 4, 1);
|
||||
PIPE3.setRotationPoint(-1F, 9F, 6F);
|
||||
PIPE3.setTextureSize(128, 128);
|
||||
PIPE3.mirror = true;
|
||||
setRotation(PIPE3, 0F, 0F, 0F);
|
||||
PIPE2 = new ModelRenderer(this, 54, 0);
|
||||
PIPE2.addBox(0F, 0F, 0F, 1, 4, 2);
|
||||
PIPE2.setRotationPoint(6F, 9F, -1F);
|
||||
PIPE2.setTextureSize(128, 128);
|
||||
PIPE2.mirror = true;
|
||||
setRotation(PIPE2, 0F, 0F, 0F);
|
||||
TOPPIPE3 = new ModelRenderer(this, 60, 6);
|
||||
TOPPIPE3.addBox(0F, 0F, 0F, 2, 1, 3);
|
||||
TOPPIPE3.setRotationPoint(-1F, 9F, 3F);
|
||||
TOPPIPE3.setTextureSize(128, 128);
|
||||
TOPPIPE3.mirror = true;
|
||||
setRotation(TOPPIPE3, 0F, 0F, 0F);
|
||||
PIPE1 = new ModelRenderer(this, 54, 0);
|
||||
PIPE1.addBox(0F, 0F, 0F, 1, 4, 2);
|
||||
PIPE1.setRotationPoint(-7F, 9F, -1F);
|
||||
PIPE1.setTextureSize(128, 128);
|
||||
PIPE1.mirror = true;
|
||||
setRotation(PIPE1, 0F, 0F, 0F);
|
||||
CORESLOT = new ModelRenderer(this, 0, 52);
|
||||
CORESLOT.addBox(0F, 0F, 0F, 6, 2, 6);
|
||||
CORESLOT.setRotationPoint(-3F, 8F, -3F);
|
||||
CORESLOT.setTextureSize(128, 128);
|
||||
CORESLOT.mirror = true;
|
||||
setRotation(CORESLOT, 0F, 0F, 0F);
|
||||
PIPE4 = new ModelRenderer(this, 48, 0);
|
||||
PIPE4.addBox(0F, 0F, 0F, 2, 4, 1);
|
||||
PIPE4.setRotationPoint(-1F, 9F, -7F);
|
||||
PIPE4.setTextureSize(128, 128);
|
||||
PIPE4.mirror = true;
|
||||
setRotation(PIPE4, 0F, 0F, 0F);
|
||||
TOPPIPE2 = new ModelRenderer(this, 60, 0);
|
||||
TOPPIPE2.addBox(0F, 0F, 0F, 3, 1, 2);
|
||||
TOPPIPE2.setRotationPoint(3F, 9F, -1F);
|
||||
TOPPIPE2.setTextureSize(128, 128);
|
||||
TOPPIPE2.mirror = true;
|
||||
setRotation(TOPPIPE2, 0F, 0F, 0F);
|
||||
DISPLAY2 = new ModelRenderer(this, 70, 0);
|
||||
DISPLAY2.addBox(-4F, 0F, 0F, 3, 1, 10);
|
||||
DISPLAY2.setRotationPoint(6F, 9F, -5F);
|
||||
DISPLAY2.setTextureSize(128, 128);
|
||||
DISPLAY2.mirror = true;
|
||||
setRotation(DISPLAY2, 0F, 0F, 0F);
|
||||
TOPPIPE1 = new ModelRenderer(this, 60, 0);
|
||||
TOPPIPE1.addBox(0F, 0F, 0F, 3, 1, 2);
|
||||
TOPPIPE1.setRotationPoint(-6F, 9F, -1F);
|
||||
TOPPIPE1.setTextureSize(128, 128);
|
||||
TOPPIPE1.mirror = true;
|
||||
setRotation(TOPPIPE1, 0F, 0F, 0F);
|
||||
TOPPIPE4 = new ModelRenderer(this, 60, 6);
|
||||
TOPPIPE4.addBox(0F, 0F, 0F, 2, 1, 3);
|
||||
TOPPIPE4.setRotationPoint(-1F, 9F, -6F);
|
||||
TOPPIPE4.setTextureSize(128, 128);
|
||||
TOPPIPE4.mirror = true;
|
||||
setRotation(TOPPIPE4, 0F, 0F, 0F);
|
||||
DISPLAY1 = new ModelRenderer(this, 70, 0);
|
||||
DISPLAY1.addBox(-4F, 0F, 0F, 3, 1, 10);
|
||||
DISPLAY1.setRotationPoint(-1F, 9F, -5F);
|
||||
DISPLAY1.setTextureSize(128, 128);
|
||||
DISPLAY1.mirror = true;
|
||||
setRotation(DISPLAY1, 0F, 0F, 0F);
|
||||
PumpHead = new ModelRenderer(this, 33, 0);
|
||||
PumpHead.addBox(0F, 0F, 0F, 6, 3, 6);
|
||||
PumpHead.setRotationPoint(-3F, 19F, -3F);
|
||||
PumpHead.setTextureSize(64, 64);
|
||||
PumpHead.mirror = true;
|
||||
setRotation(PumpHead, 0F, 0F, 0F);
|
||||
Connector = new ModelRenderer(this, 33, 10);
|
||||
Connector.addBox(0F, 0F, 0F, 4, 1, 5);
|
||||
Connector.setRotationPoint(-2F, 14F, 2.5F);
|
||||
Connector.setTextureSize(64, 64);
|
||||
Connector.mirror = true;
|
||||
setRotation(Connector, 0F, 0F, 0F);
|
||||
Panel1 = new ModelRenderer(this, 0, 15);
|
||||
Panel1.addBox(-3F, -6F, 0F, 6, 6, 1);
|
||||
Panel1.setRotationPoint(0F, 21F, -3F);
|
||||
Panel1.setTextureSize(64, 64);
|
||||
Panel1.mirror = true;
|
||||
setRotation(Panel1, 0.5585054F, 0F, 0F);
|
||||
Panel2 = new ModelRenderer(this, 15, 15);
|
||||
Panel2.addBox(0F, -6F, -3F, 1, 6, 6);
|
||||
Panel2.setRotationPoint(-3F, 21F, 0F);
|
||||
Panel2.setTextureSize(64, 64);
|
||||
Panel2.mirror = true;
|
||||
setRotation(Panel2, 0F, 0F, -0.5585054F);
|
||||
Panel3 = new ModelRenderer(this, 15, 15);
|
||||
Panel3.addBox(-1F, -6F, -3F, 1, 6, 6);
|
||||
Panel3.setRotationPoint(3F, 21F, 0F);
|
||||
Panel3.setTextureSize(64, 64);
|
||||
Panel3.mirror = true;
|
||||
setRotation(Panel3, 0F, 0F, 0.5585054F);
|
||||
Body = new ModelRenderer(this, 30, 17);
|
||||
Body.addBox(0F, 0F, 0F, 6, 11, 6);
|
||||
Body.setRotationPoint(-3F, 8F, -3F);
|
||||
Body.setTextureSize(64, 64);
|
||||
Body.mirror = true;
|
||||
setRotation(Body, 0F, 0F, 0F);
|
||||
Axil = new ModelRenderer(this, 0, 28);
|
||||
Axil.addBox(0F, 0F, 0F, 9, 2, 4);
|
||||
Axil.setRotationPoint(-4.5F, 17F, -2F);
|
||||
Axil.setTextureSize(64, 64);
|
||||
Axil.mirror = true;
|
||||
setRotation(Axil, 0F, 0F, 0F);
|
||||
Axil2 = new ModelRenderer(this, 0, 0);
|
||||
Axil2.addBox(0F, 0F, 0F, 4, 2, 12);
|
||||
Axil2.setRotationPoint(-2F, 17F, -4.5F);
|
||||
Axil2.setTextureSize(64, 64);
|
||||
Axil2.mirror = true;
|
||||
setRotation(Axil2, 0F, 0F, 0F);
|
||||
Ring1 = new ModelRenderer(this, 0, 35);
|
||||
Ring1.addBox(0F, 0F, 0F, 8, 1, 8);
|
||||
Ring1.setRotationPoint(-4F, 12F, -4F);
|
||||
Ring1.setTextureSize(64, 64);
|
||||
Ring1.mirror = true;
|
||||
setRotation(Ring1, 0F, 0F, 0F);
|
||||
Ring2 = new ModelRenderer(this, 0, 35);
|
||||
Ring2.addBox(0F, 0F, 0F, 8, 1, 8);
|
||||
Ring2.setRotationPoint(-4F, 10F, -4F);
|
||||
Ring2.setTextureSize(64, 64);
|
||||
Ring2.mirror = true;
|
||||
setRotation(Ring2, 0F, 0F, 0F);
|
||||
Plug = new ModelRenderer(this, 0, 45);
|
||||
Plug.addBox(0F, 0F, 0F, 6, 6, 1);
|
||||
Plug.setRotationPoint(-3F, 13F, 7F);
|
||||
Plug.setTextureSize(64, 64);
|
||||
Plug.mirror = true;
|
||||
setRotation(Plug, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(float size)
|
||||
{
|
||||
COREBOX.render(size);
|
||||
INPUTSLOT2.render(size);
|
||||
INPUTSLOT3.render(size);
|
||||
INPUTSLOT4.render(size);
|
||||
INPUTSLOT5.render(size);
|
||||
INPUTSLOT1.render(size);
|
||||
PIPE3.render(size);
|
||||
PIPE2.render(size);
|
||||
TOPPIPE3.render(size);
|
||||
PIPE1.render(size);
|
||||
CORESLOT.render(size);
|
||||
PIPE4.render(size);
|
||||
TOPPIPE2.render(size);
|
||||
DISPLAY2.render(size);
|
||||
TOPPIPE1.render(size);
|
||||
TOPPIPE4.render(size);
|
||||
DISPLAY1.render(size);
|
||||
PumpHead.render(size);
|
||||
Connector.render(size);
|
||||
Panel1.render(size);
|
||||
Panel2.render(size);
|
||||
Panel3.render(size);
|
||||
Body.render(size);
|
||||
Axil.render(size);
|
||||
Axil2.render(size);
|
||||
Ring1.render(size);
|
||||
Ring2.render(size);
|
||||
Plug.render(size);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
|
|
|
@ -34,7 +34,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
|||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if(block == null || renderer == null)
|
||||
if(block == null || renderer == null || MachineType.getFromMetadata(metadata) == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
|||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(!MachineType.getFromMetadata(metadata).hasModel)
|
||||
if(MachineType.getFromMetadata(metadata) != null && !MachineType.getFromMetadata(metadata).hasModel)
|
||||
{
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
|
|
|
@ -29,6 +29,14 @@ public class RenderElectricPump extends TileEntitySpecialRenderer
|
|||
|
||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ElectricPump.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);
|
||||
GL11.glPopMatrix();
|
||||
|
|
|
@ -5,6 +5,7 @@ import ic2.api.energy.tile.IEnergySink;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -419,6 +420,12 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EnumSet<ForgeDirection> getConsumingSides()
|
||||
{
|
||||
return EnumSet.of(ForgeDirection.getOrientation(facing).getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
public double transferEnergyToAcceptor(double amount)
|
||||
{
|
||||
|
@ -440,7 +447,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
|||
@Override
|
||||
public boolean canReceiveEnergy(ForgeDirection side)
|
||||
{
|
||||
return true;
|
||||
return getConsumingSides().contains(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -478,7 +485,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
|||
@Override
|
||||
public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction)
|
||||
{
|
||||
return direction != ForgeDirection.getOrientation(facing);
|
||||
return getConsumingSides().contains(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -499,10 +506,15 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
|||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection direction)
|
||||
{
|
||||
if(direction == ForgeDirection.getOrientation(1))
|
||||
{
|
||||
return new FluidTankInfo[] {fluidTank.getInfo()};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidStack(FluidStack fluidStack, Object... data)
|
||||
{
|
||||
|
@ -524,7 +536,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
|||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
|
||||
{
|
||||
if(fluidTank.getFluid() != null && fluidTank.getFluid().getFluid() != resource.getFluid())
|
||||
if(fluidTank.getFluid() != null && fluidTank.getFluid().getFluid() != resource.getFluid() && from == ForgeDirection.getOrientation(1))
|
||||
{
|
||||
return drain(from, resource.amount, doDrain);
|
||||
}
|
||||
|
@ -540,10 +552,15 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
|||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
|
||||
{
|
||||
if(from == ForgeDirection.getOrientation(1))
|
||||
{
|
||||
return fluidTank.drain(maxDrain, doDrain);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ item.PortableTeleporter.name=Tragbarer Teleporter
|
|||
item.TeleportationCore.name=Teleportationskern
|
||||
item.Configurator.name=Konfigurator
|
||||
item.NetworkReader.name=Netzwerklesegerät
|
||||
item.MaganeseAlloy.name=Manganlegierung
|
||||
item.ManganeseAlloy.name=Manganlegierung
|
||||
item.WalkieTalkie.name=Walkie-Talkie
|
||||
|
||||
//Basic Block
|
||||
|
|
|
@ -23,7 +23,7 @@ item.PortableTeleporter.name=Portable Teleporter
|
|||
item.TeleportationCore.name=Teleportation Core
|
||||
item.Configurator.name=Configurator
|
||||
item.NetworkReader.name=Network Reader
|
||||
item.MaganeseAlloy.name=Manganese Alloy
|
||||
item.ManganeseAlloy.name=Manganese Alloy
|
||||
item.WalkieTalkie.name=Walkie-Talkie
|
||||
|
||||
//Basic Block
|
||||
|
|
|
@ -23,7 +23,7 @@ item.PortableTeleporter.name=Przenośny Teleporter
|
|||
item.TeleportationCore.name=Jądro Teleportacji
|
||||
item.Configurator.name=Konfigurator
|
||||
item.NetworkReader.name=Czytnik Sieci
|
||||
item.MaganeseAlloy.name=Stop Manganu
|
||||
item.ManganeseAlloy.name=Stop Manganu
|
||||
item.WalkieTalkie.name=Walkie-Talkie
|
||||
|
||||
//Basic Block
|
||||
|
|
|
@ -23,7 +23,7 @@ item.PortableTeleporter.name=便携传送器
|
|||
item.TeleportationCore.name=传送核心
|
||||
item.Configurator.name=调整器
|
||||
item.NetworkReader.name=网络读取器
|
||||
item.MaganeseAlloy.name=锰合金
|
||||
item.ManganeseAlloy.name=锰合金
|
||||
item.WalkieTalkie.name=步话机
|
||||
|
||||
//Basic Block
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 728 B After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in a new issue