Worked on steam generator a bit

This commit is contained in:
Robert 2013-11-27 05:38:59 -05:00
parent ef70331d5f
commit 108a3b93ac
11 changed files with 260 additions and 176 deletions

BIN
models/SteamGenerator2.tcn Normal file

Binary file not shown.

View file

@ -177,10 +177,15 @@ tile.basaltcracked.name = Cracked Basalt Bricks
tile.BlockSolarPanel.0.name = Solar Panel
tile.BasicMachine.0.name = Coal Generator
tile.BasicMachine.4.name = Fuel Generator
tile.BasicMachine.8.name = Battery Box
tile.BasicMachine.12.name = Electric Furnace
tile.BasicMachine.0.name =
tile.BasicMachine.4.name =
tile.BasicMachine.8.name =
tile.BasicMachine.12.name =
tile.StarterSteamGen.0.name = Small Steam Turbine
tile.StarterSteamGen.4.name = Small Steam Piston
tile.StarterSteamGen.8.name = Small Coal Boiler
tile.StarterSteamGen.12.name = Small Fuel Boiler
tile.DMWire.0.name = Copper Wire

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 871 B

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -1,4 +1,4 @@
// Date: 11/26/2013 7:03:28 AM
// Date: 11/27/2013 5:36:07 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
@ -6,22 +6,11 @@
package dark.core.client.models;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelSteamGen extends ModelMachine
{
//fields
ModelRenderer body;
ModelRenderer top;
ModelRenderer bot;
ModelRenderer tank;
ModelRenderer tank2;
ModelRenderer tank3;
ModelRenderer tank4;
ModelRenderer tank5;
ModelRenderer tank6;
ModelRenderer face;
ModelRenderer grill;
ModelRenderer grill2;
@ -40,10 +29,17 @@ public class ModelSteamGen extends ModelMachine
ModelRenderer grill15;
ModelRenderer grill16;
ModelRenderer grill17;
ModelRenderer tank;
ModelRenderer tank2;
ModelRenderer tank3;
ModelRenderer tank4;
ModelRenderer tank5;
ModelRenderer tankTop;
ModelRenderer tankTop2;
ModelRenderer tankTop3;
ModelRenderer tankTop4;
ModelRenderer pipe;
ModelRenderer pipe2;
ModelRenderer pipe3;
ModelRenderer pipe4;
ModelRenderer gauge;
ModelRenderer gaugeNeedle;
@ -52,62 +48,8 @@ public class ModelSteamGen extends ModelMachine
textureWidth = 128;
textureHeight = 128;
body = new ModelRenderer(this, 0, 25);
body.addBox(-7.5F, 0F, -7.5F, 15, 9, 12);
body.setRotationPoint(0F, 10F, 3F);
body.setTextureSize(128, 128);
body.mirror = true;
setRotation(body, 0F, 0F, 0F);
top = new ModelRenderer(this, 0, 0);
top.addBox(-8F, 0F, -8F, 16, 2, 15);
top.setRotationPoint(0F, 8F, 1F);
top.setTextureSize(128, 128);
top.mirror = true;
setRotation(top, 0F, 0F, 0F);
bot = new ModelRenderer(this, 0, 97);
bot.addBox(-8F, 0F, -6F, 16, 5, 12);
bot.setRotationPoint(0F, 19F, 2F);
bot.setTextureSize(128, 128);
bot.mirror = true;
setRotation(bot, 0F, 0F, 0F);
tank = new ModelRenderer(this, 58, 81);
tank.addBox(-2F, 1F, -8.5F, 5, 5, 1);
tank.setRotationPoint(-3F, 11F, 3F);
tank.setTextureSize(128, 128);
tank.mirror = true;
setRotation(tank, 0F, 0F, 0F);
tank2 = new ModelRenderer(this, 72, 83);
tank2.addBox(0F, -1F, -8F, 1, 3, 1);
tank2.setRotationPoint(0F, 14F, 3F);
tank2.setTextureSize(128, 128);
tank2.mirror = true;
setRotation(tank2, 0F, 0F, 0F);
tank3 = new ModelRenderer(this, 60, 78);
tank3.addBox(-1F, 1F, -8F, 3, 1, 1);
tank3.setRotationPoint(-3F, 10F, 3F);
tank3.setTextureSize(128, 128);
tank3.mirror = true;
setRotation(tank3, 0F, 0F, 0F);
tank4 = new ModelRenderer(this, 60, 88);
tank4.addBox(-1F, 1F, -8F, 3, 1, 1);
tank4.setRotationPoint(-3F, 16F, 3F);
tank4.setTextureSize(128, 128);
tank4.mirror = true;
setRotation(tank4, 0F, 0F, 0F);
tank5 = new ModelRenderer(this, 52, 83);
tank5.addBox(0F, -1F, -8F, 1, 3, 1);
tank5.setRotationPoint(-6F, 14F, 3F);
tank5.setTextureSize(128, 128);
tank5.mirror = true;
setRotation(tank5, 0F, 0F, 0F);
tank6 = new ModelRenderer(this, 37, 81);
tank6.addBox(-1F, 2F, -8.8F, 3, 3, 1);
tank6.setRotationPoint(-3F, 11F, 3F);
tank6.setTextureSize(128, 128);
tank6.mirror = true;
setRotation(tank6, 0F, 0F, 0F);
face = new ModelRenderer(this, 20, 116);
face.addBox(-8F, 0F, -6F, 16, 6, 2);
face = new ModelRenderer(this, 20, 93);
face.addBox(-8F, 0F, -6F, 16, 6, 14);
face.setRotationPoint(0F, 18F, 0F);
face.setTextureSize(128, 128);
face.mirror = true;
@ -214,56 +156,88 @@ public class ModelSteamGen extends ModelMachine
grill17.setTextureSize(128, 128);
grill17.mirror = true;
setRotation(grill17, 0F, 0.7853982F, 0F);
pipe = new ModelRenderer(this, 0, 76);
pipe.addBox(0F, -1F, -8.35F, 8, 1, 1);
pipe.setRotationPoint(0F, 14F, 3F);
tank = new ModelRenderer(this, 22, 65);
tank.addBox(-5F, 0F, -5F, 10, 8, 10);
tank.setRotationPoint(0F, 10F, 2F);
tank.setTextureSize(128, 128);
tank.mirror = true;
setRotation(tank, 0F, 0F, 0F);
tank2 = new ModelRenderer(this, 0, 66);
tank2.addBox(-4F, 0F, -6F, 8, 8, 1);
tank2.setRotationPoint(0F, 10F, 2F);
tank2.setTextureSize(128, 128);
tank2.mirror = true;
setRotation(tank2, 0F, 0F, 0F);
tank3 = new ModelRenderer(this, 0, 65);
tank3.addBox(-4F, 0F, -6F, 8, 8, 1);
tank3.setRotationPoint(0F, 10F, 2F);
tank3.setTextureSize(128, 128);
tank3.mirror = true;
setRotation(tank3, 0F, 1.570796F, 0F);
tank4 = new ModelRenderer(this, 0, 65);
tank4.addBox(-4F, 0F, -6F, 8, 8, 1);
tank4.setRotationPoint(0F, 10F, 2F);
tank4.setTextureSize(128, 128);
tank4.mirror = true;
setRotation(tank4, 0F, 3.141593F, 0F);
tank5 = new ModelRenderer(this, 0, 65);
tank5.addBox(-4F, 0F, -6F, 8, 8, 1);
tank5.setRotationPoint(0F, 10F, 2F);
tank5.setTextureSize(128, 128);
tank5.mirror = true;
setRotation(tank5, 0F, -1.570796F, 0F);
tankTop = new ModelRenderer(this, 0, 11);
tankTop.addBox(0F, 0F, 0F, 16, 2, 4);
tankTop.setRotationPoint(-8F, 8F, -6F);
tankTop.setTextureSize(128, 128);
tankTop.mirror = true;
setRotation(tankTop, 0F, 0F, 0F);
tankTop2 = new ModelRenderer(this, 0, 18);
tankTop2.addBox(-4F, 0F, 2F, 8, 2, 4);
tankTop2.setRotationPoint(0F, 8F, 2F);
tankTop2.setTextureSize(128, 128);
tankTop2.mirror = true;
setRotation(tankTop2, 0F, 0F, 0F);
tankTop3 = new ModelRenderer(this, 29, 25);
tankTop3.addBox(0F, 0F, 0F, 4, 2, 10);
tankTop3.setRotationPoint(4F, 8F, -2F);
tankTop3.setTextureSize(128, 128);
tankTop3.mirror = true;
setRotation(tankTop3, 0F, 0F, 0F);
tankTop4 = new ModelRenderer(this, 0, 25);
tankTop4.addBox(0F, 0F, 0F, 4, 2, 10);
tankTop4.setRotationPoint(-8F, 8F, -2F);
tankTop4.setTextureSize(128, 128);
tankTop4.mirror = true;
setRotation(tankTop4, 0F, 0F, 0F);
pipe = new ModelRenderer(this, 10, 0);
pipe.addBox(0F, 0F, 0F, 2, 8, 2);
pipe.setRotationPoint(-7F, 10F, -5F);
pipe.setTextureSize(128, 128);
pipe.mirror = true;
setRotation(pipe, 0F, 0F, 0F);
pipe2 = new ModelRenderer(this, 0, 81);
pipe2.addBox(0F, -1F, -8.35F, 1, 1, 8);
pipe2.setRotationPoint(7F, 14F, 4F);
pipe2 = new ModelRenderer(this, 0, 0);
pipe2.addBox(0F, 0F, 0F, 2, 8, 2);
pipe2.setRotationPoint(5F, 10F, -5F);
pipe2.setTextureSize(128, 128);
pipe2.mirror = true;
setRotation(pipe2, 0F, 0F, 0F);
pipe3 = new ModelRenderer(this, 21, 81);
pipe3.addBox(0F, -1F, -8.35F, 1, 3, 1);
pipe3.setRotationPoint(7F, 11F, 11F);
pipe3.setTextureSize(128, 128);
pipe3.mirror = true;
setRotation(pipe3, 0F, 0F, 0F);
pipe4 = new ModelRenderer(this, 15, 59);
pipe4.addBox(0F, 0F, 0F, 1, 10, 1);
pipe4.setRotationPoint(4.4F, 9.5F, -4.8F);
pipe4.setTextureSize(128, 128);
pipe4.mirror = true;
setRotation(pipe4, 0F, 0F, 0F);
gauge = new ModelRenderer(this, 61, 56);
gauge.addBox(0F, 0F, 0F, 3, 3, 1);
gauge.setRotationPoint(1.4F, 14.5F, -5F);
gauge = new ModelRenderer(this, 59, 25);
gauge.addBox(0F, 0F, 0F, 4, 4, 1);
gauge.setRotationPoint(-2F, 12F, -4.5F);
gauge.setTextureSize(128, 128);
gauge.mirror = true;
setRotation(gauge, 0F, 0F, 0F);
gaugeNeedle = new ModelRenderer(this, 56, 56);
gaugeNeedle.addBox(0F, -2F, 0F, 1, 3, 0);
gaugeNeedle.setRotationPoint(2.4F, 16.5F, -5.1F);
gaugeNeedle = new ModelRenderer(this, 71, 25);
gaugeNeedle.addBox(-0.5F, -2F, -1F, 1, 3, 0);
gaugeNeedle.setRotationPoint(0F, 15F, -3.6F);
gaugeNeedle.setTextureSize(128, 128);
gaugeNeedle.mirror = true;
setRotation(gaugeNeedle, 0F, 0F, 0F);
setRotation(gaugeNeedle, -0.0174533F, 0F, -0.5759587F);
}
@Override
public void render(float f5)
{
body.render(f5);
top.render(f5);
bot.render(f5);
tank.render(f5);
tank2.render(f5);
tank3.render(f5);
tank4.render(f5);
tank5.render(f5);
tank6.render(f5);
face.render(f5);
grill.render(f5);
grill2.render(f5);
@ -282,11 +256,24 @@ public class ModelSteamGen extends ModelMachine
grill15.render(f5);
grill16.render(f5);
grill17.render(f5);
tank.render(f5);
tank2.render(f5);
tank3.render(f5);
tank4.render(f5);
tank5.render(f5);
tankTop.render(f5);
tankTop2.render(f5);
tankTop3.render(f5);
tankTop4.render(f5);
pipe.render(f5);
pipe2.render(f5);
pipe3.render(f5);
pipe4.render(f5);
gauge.render(f5);
}
public void renderGauge(float f5, float angle)
{
gaugeNeedle.rotateAngleZ = angle;
gaugeNeedle.render(f5);
}

View file

@ -13,7 +13,7 @@ import dark.core.client.models.ModelSteamTurbine;
import dark.core.client.models.ModelElecFurnace;
import dark.core.client.models.ModelMachine;
import dark.core.common.DarkMain;
import dark.core.common.machines.BlockBasicMachine;
import dark.core.common.machines.BlockSmallSteamGen;
import dark.core.prefab.ModPrefab;
import dark.core.prefab.machine.TileEntityMachine;
@ -21,10 +21,10 @@ import dark.core.prefab.machine.TileEntityMachine;
public class RenderBasicMachine extends RenderTileMachine
{
public static final ModelSteamTurbine TURBINE_MODEL = new ModelSteamTurbine();
public static final ModelSteamGen COAL_GEN_MODEL = new ModelSteamGen();
public static final ModelSteamGen STEAM_GEN_MODEL = new ModelSteamGen();
public static final ResourceLocation TURBINE_TEXTURE = new ResourceLocation(DarkMain.getInstance().DOMAIN, ModPrefab.MODEL_DIRECTORY + "SmallSteamFan.png");
public static final ResourceLocation COAL_GEN_TEXTURE = new ResourceLocation(DarkMain.getInstance().DOMAIN, ModPrefab.MODEL_DIRECTORY + "SteamGenerator.png");
public static final ResourceLocation STEAM_GEN_TEXTURE = new ResourceLocation(DarkMain.getInstance().DOMAIN, ModPrefab.MODEL_DIRECTORY + "SteamGenerator.png");
private static float rot1 = 0;
@Override
@ -38,54 +38,59 @@ public class RenderBasicMachine extends RenderTileMachine
ModelMachine model = null;
switch (type)
{
case 0:
bindTexture(COAL_GEN_TEXTURE);
model = COAL_GEN_MODEL;
break;
case 1:
bindTexture(COAL_GEN_TEXTURE);
model = COAL_GEN_MODEL;
break;
case 2:
bindTexture(TURBINE_TEXTURE);
model = TURBINE_MODEL;
break;
case 1:
bindTexture(TURBINE_TEXTURE);
model = TURBINE_MODEL;
break;
case 2:
bindTexture(STEAM_GEN_TEXTURE);
model = STEAM_GEN_MODEL;
break;
case 3:
bindTexture(STEAM_GEN_TEXTURE);
model = STEAM_GEN_MODEL;
break;
}
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
if (face == 1)
if (model != null)
{
GL11.glRotatef(180f, 0f, 1f, 0f);
}
if (face == 0)
{
GL11.glRotatef(0f, 0f, 1f, 0f);
}
else if (face == 3)
{
GL11.glRotatef(90f, 0f, 1f, 0f);
}
else if (face == 2)
{
GL11.glRotatef(270f, 0f, 1f, 0f);
}
model.render(0.0625F);
if (tileEntity instanceof TileEntityMachine)
{
if (model instanceof ModelSteamTurbine)
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
if (face == 0)
{
if (((TileEntityMachine) tileEntity).isFunctioning())
{
GL11.glRotatef(this.rot1, 0f, 1f, 0f);
}
((ModelSteamTurbine) model).renderFan(0.0625F);
GL11.glRotatef(180f, 0f, 1f, 0f);
}
if (face == 2)
{
GL11.glRotatef(0f, 0f, 1f, 0f);
}
else if (face == 3)
{
GL11.glRotatef(90f, 0f, 1f, 0f);
}
else if (face == 1)
{
GL11.glRotatef(270f, 0f, 1f, 0f);
}
model.render(0.0625F);
if (tileEntity instanceof TileEntityMachine)
{
if (model instanceof ModelSteamTurbine)
{
if (((TileEntityMachine) tileEntity).isFunctioning())
{
GL11.glRotatef(this.rot1, 0f, 1f, 0f);
}
((ModelSteamTurbine) model).renderFan(0.0625F);
}
}
GL11.glPopMatrix();
}
GL11.glPopMatrix();
}

View file

@ -54,7 +54,7 @@ import dark.core.common.items.ItemParts;
import dark.core.common.items.ItemParts.Parts;
import dark.core.common.items.ItemReadoutTools;
import dark.core.common.items.ItemWrench;
import dark.core.common.machines.BlockBasicMachine;
import dark.core.common.machines.BlockSmallSteamGen;
import dark.core.common.machines.BlockDebug;
import dark.core.common.machines.BlockSolarPanel;
import dark.core.common.transmit.BlockWire;
@ -268,7 +268,7 @@ public class DarkMain extends ModPrefab
{
blockMulti = (BlockMulti) m;
}
CoreRecipeLoader.basicMachine = ModObjectRegistry.createNewBlock("DMBlockBasicMachine", DarkMain.MOD_ID, BlockBasicMachine.class, ItemBlockHolder.class);
CoreRecipeLoader.basicMachine = ModObjectRegistry.createNewBlock("DMBlockBasicMachine", DarkMain.MOD_ID, BlockSmallSteamGen.class, ItemBlockHolder.class);
CoreRecipeLoader.blockOre = ModObjectRegistry.createNewBlock("DMBlockOre", DarkMain.MOD_ID, BlockOre.class, ItemBlockOre.class);
CoreRecipeLoader.blockWire = ModObjectRegistry.createNewBlock("DMBlockWire", DarkMain.MOD_ID, BlockWire.class, ItemBlockWire.class);
CoreRecipeLoader.blockDebug = ModObjectRegistry.createNewBlock("DMBlockDebug", DarkMain.MOD_ID, BlockDebug.class, ItemBlockHolder.class);

View file

@ -26,12 +26,18 @@ import dark.core.helpers.MathHelper;
import dark.core.prefab.machine.BlockMachine;
import dark.core.registration.ModObjectRegistry.BlockBuildData;
public class BlockBasicMachine extends BlockMachine
/** Starter power setup using steam generated by burning items or fuels. This setup takes two blocks.
* A) the generator B) the collector The generator creates the steam and burns the fuel. The
* collector uses the steam to generate a small amount of constant power. This setup is not very
* powerful but is easy to create and doesn't take much to keep running
*
* @author DarkGuardsman */
public class BlockSmallSteamGen extends BlockMachine
{
public BlockBasicMachine()
public BlockSmallSteamGen()
{
super(new BlockBuildData(BlockBasicMachine.class, "BasicMachine", UniversalElectricity.machine).setCreativeTab(DMCreativeTab.tabIndustrial));
super(new BlockBuildData(BlockSmallSteamGen.class, "StarterSteamGen", UniversalElectricity.machine).setCreativeTab(DMCreativeTab.tabIndustrial));
this.setStepSound(soundMetalFootstep);
}
@ -41,7 +47,7 @@ public class BlockBasicMachine extends BlockMachine
super.onBlockPlacedBy(world, x, y, z, entityLiving, itemStack);
int metadata = world.getBlockMetadata(x, y, z);
int angle = MathHelper.floor_double((entityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
world.setBlockMetadataWithNotify(x, y, z, (metadata / 4) + angle, 3);
world.setBlockMetadataWithNotify(x, y, z, ((metadata / 4) * 4) + angle, 3);
}
@Override
@ -105,6 +111,7 @@ public class BlockBasicMachine extends BlockMachine
{
list.add(new Pair<String, Class<? extends TileEntity>>("DCTileSteamFan", TileEntitySteamFan.class));
list.add(new Pair<String, Class<? extends TileEntity>>("DCTileSteamPiston", TileEntitySteamPiston.class));
list.add(new Pair<String, Class<? extends TileEntity>>("DCTileSteamGen", TileEntitySteamGen.class));
}
@Override
@ -113,6 +120,7 @@ public class BlockBasicMachine extends BlockMachine
{
list.add(new Pair(TileEntitySteamPiston.class, new RenderBasicMachine()));
list.add(new Pair(TileEntitySteamFan.class, new RenderBasicMachine()));
list.add(new Pair(TileEntitySteamGen.class, new RenderBasicMachine()));
}
@Override
@ -156,9 +164,9 @@ public class BlockBasicMachine extends BlockMachine
case 1:
return new TileEntitySteamPiston();
case 2:
return new TileEntitySteamFan();
return new TileEntitySteamGen();
case 3:
return new TileEntitySteamFan();
return new TileEntitySteamGen();
}
return super.createTileEntity(world, metadata);
@ -182,6 +190,6 @@ public class BlockBasicMachine extends BlockMachine
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
return new ItemStack(this, 1, world.getBlockMetadata(x, y, z) / 4);
return new ItemStack(this, 1, (world.getBlockMetadata(x, y, z) / 4) * 4);
}
}

View file

@ -11,7 +11,10 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import dark.core.prefab.machine.TileEntityMachine;
/** Simple steam gen designed to burn items to create steam to power a steam device directly above it
/** Simple steam gen designed to burn items to create steam to power a steam device directly above
* it. Doesn't actually make steam fluid but rather simple functions. The machines above it will
* need to call to this machines and do a check for steam. If this machines is creating steam then
* the machine above it should function
*
* @author DarkGuardsman */
public class TileEntitySteamGen extends TileEntityMachine implements IFluidHandler
@ -20,8 +23,8 @@ public class TileEntitySteamGen extends TileEntityMachine implements IFluidHandl
* burning for */
public int itemCookTime = 0;
protected final int HEAT_TIME = 100, WATER_CONSUME_TIME = 100, WATER_CONSUME_SUM = 10;
protected int heatTicks = 0, waterTicks = 0;
protected final int HEAT_TIME = 100;
protected int heatTicks = 0;
protected boolean steamMachineConnected = false, isHeated = false, creatingSteam = false;
@ -33,6 +36,9 @@ public class TileEntitySteamGen extends TileEntityMachine implements IFluidHandl
super.updateEntity();
TileEntity entity = this.worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord);
this.creatingSteam = false;
steamMachineConnected = false;
if (itemCookTime > 0)
{
itemCookTime--;
@ -46,7 +52,7 @@ public class TileEntitySteamGen extends TileEntityMachine implements IFluidHandl
steamMachineConnected = true;
if (itemCookTime < 10)
{
//TODO consume an item to keep us running
this.consumeFuel();
}
if (itemCookTime > 0 && this.heatTicks < HEAT_TIME)
{
@ -54,26 +60,28 @@ public class TileEntitySteamGen extends TileEntityMachine implements IFluidHandl
}
if (this.isFunctioning())
{
if (this.tank != null && this.tank.getFluid() != null && this.tank.getFluidAmount() > WATER_CONSUME_SUM && this.tank.getFluid().getFluid() == FluidRegistry.WATER)
if (this.tank != null && this.tank.getFluid() != null && this.tank.getFluidAmount() > 1 && this.tank.getFluid().getFluid() == FluidRegistry.WATER)
{
waterTicks++;
if (waterTicks % WATER_CONSUME_TIME == 0)
{
this.tank.drain(10, true);
}
this.tank.drain(1, true);
this.creatingSteam = true;
}
else
{
//TODO start heating up machine and blow it up if left without water for too long
this.tank.fill(new FluidStack(FluidRegistry.WATER, 1000), true);
}
}
}
else
{
steamMachineConnected = false;
}
}
/** Called when the generator is running low on energy and needs to burn more fuel to keep going */
public void consumeFuel()
{
//TODO consume an item to keep us running
itemCookTime += 20;
}
/** Is the machines running and making steam */
public boolean isCreatingSteam()
{
return creatingSteam;
@ -82,13 +90,14 @@ public class TileEntitySteamGen extends TileEntityMachine implements IFluidHandl
@Override
public boolean canFunction()
{
return super.canFunction() && itemCookTime > 0 && steamMachineConnected && isHeated;
TileEntity ent = this.worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord);
return super.canFunction() && ent instanceof TileEntitySteamPiston && this.itemCookTime > 0 && this.isHeated;
}
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
{
if(resource != null && resource.getFluid().equals(FluidRegistry.WATER))
if (resource != null && resource.getFluid().equals(FluidRegistry.WATER))
{
this.tank.fill(resource, doFill);
}

View file

@ -1,5 +1,9 @@
package dark.core.common.machines;
import java.util.EnumSet;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import dark.core.prefab.machine.TileEntityEnergyMachine;
public class TileEntitySteamPiston extends TileEntityEnergyMachine
@ -7,10 +11,76 @@ public class TileEntitySteamPiston extends TileEntityEnergyMachine
protected float wattPerSteam = 32.0f;
protected float maxWattOutput = 500f;
protected float maxSteamInput = 50f;
protected float wattsOut = 0;
protected int heatUpTime = 100;
protected int heatTicks = 0;
public TileEntitySteamPiston()
{
super(0, 0);
}
@Override
public void updateEntity()
{
super.updateEntity();
if (this.isFunctioning())
{
if (heatTicks < heatUpTime)
{
heatTicks++;
}
this.wattsOut = this.MAX_WATTS * (heatTicks / heatUpTime);
this.produceAllSides();
}
else
{
if (heatTicks > 0)
{
heatTicks--;
}
}
}
@Override
public float getRequest(ForgeDirection direction)
{
return 0;
}
@Override
public float getProvide(ForgeDirection direction)
{
return this.wattsOut;
}
public boolean consumePower(float watts, boolean doDrain)
{
return true;
}
@Override
public boolean canFunction()
{
TileEntity ent = this.worldObj.getBlockTileEntity(xCoord, yCoord - 1, zCoord);
return super.canFunction() && ent instanceof TileEntitySteamGen && ((TileEntitySteamGen) ent).isCreatingSteam();
}
protected void updateAnimation()
{
}
public EnumSet<ForgeDirection> getInputDirections()
{
return EnumSet.noneOf(ForgeDirection.class);
}
public EnumSet<ForgeDirection> getOutputDirections()
{
return EnumSet.allOf(ForgeDirection.class);
}
}