Merge branch 'development' of https://github.com/aidancbrady/Mekanism into development

This commit is contained in:
Aidan C. Brady 2014-02-05 13:39:29 -05:00
commit 879bc0e93d
8 changed files with 217 additions and 0 deletions

View file

@ -115,6 +115,21 @@ public class GasTank
return true; return true;
} }
/**
* If this GasTank can receive the specified type of gas. Will return TRUE if this tank does not need anymore gas.
* @param gas - gas to check
* @return if this GasTank can accept the defined gas
*/
public boolean canReceiveType(Gas gas)
{
if(stored != null && (gas != null && gas != stored.getGas()))
{
return false;
}
return true;
}
/** /**
* If this GasTank can be drawn of the specified type of gas. Will return false if this tank does not contain any gas. * If this GasTank can be drawn of the specified type of gas. Will return false if this tank does not contain any gas.
* @param gas - gas to check * @param gas - gas to check

View file

@ -339,6 +339,7 @@ public class ClientProxy extends CommonProxy
MinecraftForgeClient.registerItemRenderer(Mekanism.ScubaTank.itemID, handler); MinecraftForgeClient.registerItemRenderer(Mekanism.ScubaTank.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.Balloon.itemID, handler); MinecraftForgeClient.registerItemRenderer(Mekanism.Balloon.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.FrictionBoots.itemID, handler); MinecraftForgeClient.registerItemRenderer(Mekanism.FrictionBoots.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.AtomicDisassembler.itemID, handler);
//Register block handlers //Register block handlers
RenderingRegistry.registerBlockHandler(new MachineRenderingHandler()); RenderingRegistry.registerBlockHandler(new MachineRenderingHandler());

View file

@ -87,6 +87,9 @@ public class GuiElectrolyticSeparator extends GuiMekanism
name = tileEntity.dumpRight ? "Dumping..." : tileEntity.rightTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.rightTank.getGas().getGas().getLocalizedName(); name = tileEntity.dumpRight ? "Dumping..." : tileEntity.rightTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.rightTank.getGas().getGas().getLocalizedName();
fontRenderer.drawString(name, 156-fontRenderer.getStringWidth(name), 73, 0x404040); fontRenderer.drawString(name, 156-fontRenderer.getStringWidth(name), 73, 0x404040);
name = tileEntity.dumpExcess ? "Dumping Excess" : "Stop when full";
fontRenderer.drawString(name, 97, 6, 0x404040);
if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11 && yAxis <= 69) if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11 && yAxis <= 69)
{ {
drawCreativeTabHoveringText(tileEntity.fluidTank.getFluid() != null ? tileEntity.fluidTank.getFluid().getFluid().getLocalizedName() + ": " + tileEntity.fluidTank.getFluidAmount() + "mB" : MekanismUtils.localize("gui.empty"), xAxis, yAxis); drawCreativeTabHoveringText(tileEntity.fluidTank.getFluid() != null ? tileEntity.fluidTank.getFluid().getFluid().getLocalizedName() + ": " + tileEntity.fluidTank.getFluidAmount() + "mB" : MekanismUtils.localize("gui.empty"), xAxis, yAxis);
@ -124,6 +127,9 @@ public class GuiElectrolyticSeparator extends GuiMekanism
int rightDisplay = tileEntity.dumpRight ? 60 : 52; int rightDisplay = tileEntity.dumpRight ? 60 : 52;
drawTexturedModalRect(guiWidth + 160, guiHeight + 73, 176, rightDisplay, 8, 8); drawTexturedModalRect(guiWidth + 160, guiHeight + 73, 176, rightDisplay, 8, 8);
int dumpDisplay = tileEntity.dumpExcess ? 60 : 52;
drawTexturedModalRect(guiWidth + 84, guiHeight + 6, 176, dumpDisplay, 8, 8);
int displayInt; int displayInt;
if(tileEntity.fluidTank.getFluid() != null) if(tileEntity.fluidTank.getFluid() != null)

View file

@ -0,0 +1,165 @@
package mekanism.client.model;
import org.lwjgl.opengl.GL11;
import mekanism.client.render.MekanismRenderer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelAtomicDisassembler extends ModelBase
{
ModelRenderer Shape1;
ModelRenderer Shape2;
ModelRenderer Shape5;
ModelRenderer Shape6;
ModelRenderer Shape7;
ModelRenderer Shape9;
ModelRenderer Shape16;
ModelRenderer Shape10;
ModelRenderer Shape3;
ModelRenderer Shape11;
ModelRenderer Shape4;
ModelRenderer Shape12;
ModelRenderer Shape13;
ModelRenderer Shape14;
ModelRenderer Shape15;
ModelRenderer Shape8;
public ModelAtomicDisassembler()
{
textureWidth = 64;
textureHeight = 32;
Shape1 = new ModelRenderer(this, 0, 10);
Shape1.addBox(0F, -1F, -3F, 1, 16, 1);
Shape1.setRotationPoint(0F, 0F, 0F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
Shape2 = new ModelRenderer(this, 34, 9);
Shape2.addBox(-0.5F, -3.5F, -3.5F, 2, 5, 2);
Shape2.setRotationPoint(0F, 0F, 0F);
Shape2.setTextureSize(64, 32);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
Shape5 = new ModelRenderer(this, 42, 0);
Shape5.addBox(0F, -4F, -4F, 1, 2, 10);
Shape5.setRotationPoint(0F, 0F, 0F);
Shape5.setTextureSize(64, 32);
Shape5.mirror = true;
setRotation(Shape5, 0F, 0F, 0F);
Shape6 = new ModelRenderer(this, 24, 0);
Shape6.addBox(-5F, -5.7F, -5.5F, 3, 3, 6);
Shape6.setRotationPoint(0F, 0F, 0F);
Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0.7853982F);
Shape7 = new ModelRenderer(this, 0, 0);
Shape7.addBox(-0.5F, -6F, -7F, 2, 2, 8);
Shape7.setRotationPoint(0F, 0F, 0F);
Shape7.setTextureSize(64, 32);
Shape7.mirror = true;
setRotation(Shape7, 0F, 0F, 0F);
Shape9 = new ModelRenderer(this, 60, 0);
Shape9.addBox(0F, -0.5333334F, -9.6F, 1, 3, 1);
Shape9.setRotationPoint(0F, 0F, 0F);
Shape9.setTextureSize(64, 32);
Shape9.mirror = true;
setRotation(Shape9, -0.7853982F, 0F, 0F);
Shape16 = new ModelRenderer(this, 58, 0);
Shape16.addBox(0F, -9.58F, -4F, 1, 5, 2);
Shape16.setRotationPoint(0F, 0F, 0F);
Shape16.setTextureSize(64, 32);
Shape16.mirror = true;
setRotation(Shape16, 0.7853982F, 0F, 0F);
Shape10 = new ModelRenderer(this, 12, 0);
Shape10.addBox(-0.5F, -8.2F, -2.5F, 2, 1, 1);
Shape10.setRotationPoint(0F, 0F, 0F);
Shape10.setTextureSize(64, 32);
Shape10.mirror = true;
setRotation(Shape10, 0.7853982F, 0F, 0F);
Shape3 = new ModelRenderer(this, 56, 0);
Shape3.addBox(0F, -2.44F, -6.07F, 1, 2, 3);
Shape3.setRotationPoint(0F, 0F, 0F);
Shape3.setTextureSize(64, 32);
Shape3.mirror = true;
setRotation(Shape3, 0F, 0F, 0F);
Shape11 = new ModelRenderer(this, 42, 14);
Shape11.addBox(-0.5F, -0.5F, 3.5F, 2, 1, 1);
Shape11.setRotationPoint(0F, -4F, 0F);
Shape11.setTextureSize(64, 32);
Shape11.mirror = true;
setRotation(Shape11, 0F, 0F, 0F);
Shape4 = new ModelRenderer(this, 30, 16);
Shape4.addBox(-0.5F, -3.5F, -1.5F, 2, 1, 4);
Shape4.setRotationPoint(0F, 0F, 0F);
Shape4.setTextureSize(64, 32);
Shape4.mirror = true;
setRotation(Shape4, 0F, 0F, 0F);
Shape12 = new ModelRenderer(this, 42, 12);
Shape12.addBox(-0.5F, -4.5F, 1.5F, 2, 1, 1);
Shape12.setRotationPoint(0F, 0F, 0F);
Shape12.setTextureSize(64, 32);
Shape12.mirror = true;
setRotation(Shape12, 0F, 0F, 0F);
Shape13 = new ModelRenderer(this, 4, 10);
Shape13.addBox(0F, -5.3F, 0F, 1, 1, 7);
Shape13.setRotationPoint(0F, 0F, 0F);
Shape13.setTextureSize(64, 32);
Shape13.mirror = true;
setRotation(Shape13, 0F, 0F, 0F);
Shape14 = new ModelRenderer(this, 60, 0);
Shape14.addBox(0F, -4F, 6F, 1, 1, 1);
Shape14.setRotationPoint(0F, 0F, 0F);
Shape14.setTextureSize(64, 32);
Shape14.mirror = true;
setRotation(Shape14, 0F, 0F, 0F);
Shape15 = new ModelRenderer(this, 26, 9);
Shape15.addBox(-0.5F, 15F, -3.5F, 2, 4, 2);
Shape15.setRotationPoint(0F, 0F, 0F);
Shape15.setTextureSize(64, 32);
Shape15.mirror = true;
setRotation(Shape15, 0F, 0F, 0F);
Shape8 = new ModelRenderer(this, 37, 0);
Shape8.addBox(0F, -2F, -2F, 1, 4, 1);
Shape8.setRotationPoint(0F, 0F, 0F);
Shape8.setTextureSize(64, 32);
Shape8.mirror = true;
setRotation(Shape8, 0F, 0F, 0F);
}
public void render(float size)
{
GL11.glPushMatrix();
MekanismRenderer.glowOn();
Shape3.render(size);
Shape5.render(size);
Shape9.render(size);
Shape16.render(size);
Shape14.render(size);
MekanismRenderer.glowOff();
GL11.glPopMatrix();
Shape1.render(size);
Shape2.render(size);
Shape6.render(size);
Shape7.render(size);
Shape13.render(size);
Shape10.render(size);
Shape11.render(size);
Shape4.render(size);
Shape12.render(size);
Shape15.render(size);
Shape8.render(size);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -4,6 +4,7 @@ import mekanism.api.EnumColor;
import mekanism.api.energy.IEnergizedItem; import mekanism.api.energy.IEnergizedItem;
import mekanism.client.ClientProxy; import mekanism.client.ClientProxy;
import mekanism.client.MekanismClient; import mekanism.client.MekanismClient;
import mekanism.client.model.ModelAtomicDisassembler;
import mekanism.client.model.ModelEnergyCube; import mekanism.client.model.ModelEnergyCube;
import mekanism.client.model.ModelEnergyCube.ModelEnergyCore; import mekanism.client.model.ModelEnergyCube.ModelEnergyCore;
import mekanism.client.model.ModelFrictionBoots; import mekanism.client.model.ModelFrictionBoots;
@ -23,6 +24,7 @@ import mekanism.common.Mekanism;
import mekanism.common.Tier.EnergyCubeTier; import mekanism.common.Tier.EnergyCubeTier;
import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.inventory.InventoryBin; import mekanism.common.inventory.InventoryBin;
import mekanism.common.item.ItemAtomicDisassembler;
import mekanism.common.item.ItemBalloon; import mekanism.common.item.ItemBalloon;
import mekanism.common.item.ItemBlockBasic; import mekanism.common.item.ItemBlockBasic;
import mekanism.common.item.ItemBlockMachine; import mekanism.common.item.ItemBlockMachine;
@ -72,6 +74,7 @@ public class ItemRenderingHandler implements IItemRenderer
public ModelGasMask gasMask = new ModelGasMask(); public ModelGasMask gasMask = new ModelGasMask();
public ModelScubaTank scubaTank = new ModelScubaTank(); public ModelScubaTank scubaTank = new ModelScubaTank();
public ModelFrictionBoots frictionBoots = new ModelFrictionBoots(); public ModelFrictionBoots frictionBoots = new ModelFrictionBoots();
public ModelAtomicDisassembler atomicDisassembler = new ModelAtomicDisassembler();
private final RenderBalloon balloonRenderer = new RenderBalloon(); private final RenderBalloon balloonRenderer = new RenderBalloon();
private final RenderBin binRenderer = (RenderBin)TileEntityRenderer.instance.specialRendererMap.get(TileEntityBin.class); private final RenderBin binRenderer = (RenderBin)TileEntityRenderer.instance.specialRendererMap.get(TileEntityBin.class);
@ -368,6 +371,25 @@ public class ItemRenderingHandler implements IItemRenderer
balloonRenderer.render(((ItemBalloon)item.getItem()).getColor(item), 0, 1, 0); balloonRenderer.render(((ItemBalloon)item.getItem()).getColor(item), 0, 1, 0);
} }
} }
else if(item.getItem() instanceof ItemAtomicDisassembler)
{
if(type == ItemRenderType.EQUIPPED)
{
GL11.glRotatef(40, 0.0F, 1.0F, 0.0F);
}
if(type == ItemRenderType.INVENTORY)
{
}
GL11.glRotatef(180, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(40, 0.0F, 1.0F, 0.0F);
GL11.glScalef(1.4F, 1.4F, 1.4F);
GL11.glTranslatef(0.0F, -0.7F, 0.0F);
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "AtomicDisassembler.png"));
atomicDisassembler.render(0.0625F);
}
else if(item.getItem() instanceof ItemPartTransmitter) else if(item.getItem() instanceof ItemPartTransmitter)
{ {
GL11.glTranslated(-0.5, -0.5, -0.5); GL11.glTranslated(-0.5, -0.5, -0.5);

View file

@ -63,6 +63,9 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
/** Type type of gas this block is dumping. */ /** Type type of gas this block is dumping. */
public boolean dumpRight = false; public boolean dumpRight = false;
/** Whether to dump excess gas when a tank is full */
public boolean dumpExcess = true; // default to true until gui elements added
public TileEntityElectrolyticSeparator() public TileEntityElectrolyticSeparator()
{ {
super("ElectrolyticSeparator", MachineType.ELECTROLYTIC_SEPARATOR.baseEnergy); super("ElectrolyticSeparator", MachineType.ELECTROLYTIC_SEPARATOR.baseEnergy);
@ -199,6 +202,11 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
public boolean canFill(ChemicalPair gases) public boolean canFill(ChemicalPair gases)
{ {
if(dumpExcess)
{
return leftTank.canReceiveType(gases.leftGas.getGas()) && rightTank.canReceiveType(gases.rightGas.getGas());
}
return (leftTank.canReceive(gases.leftGas.getGas()) && leftTank.getNeeded() >= gases.leftGas.amount return (leftTank.canReceive(gases.leftGas.getGas()) && leftTank.getNeeded() >= gases.leftGas.amount
&& rightTank.canReceive(gases.rightGas.getGas()) && rightTank.getNeeded() >= gases.rightGas.amount); && rightTank.canReceive(gases.rightGas.getGas()) && rightTank.getNeeded() >= gases.rightGas.amount);
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB