diff --git a/src/main/java/com/hbm/blocks/machine/MachineHephaestus.java b/src/main/java/com/hbm/blocks/machine/MachineHephaestus.java index e2e0f28ea..951b076b3 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineHephaestus.java +++ b/src/main/java/com/hbm/blocks/machine/MachineHephaestus.java @@ -1,10 +1,12 @@ package com.hbm.blocks.machine; import com.hbm.blocks.BlockDummyable; +import com.hbm.tileentity.machine.TileEntityMachineHephaestus; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class MachineHephaestus extends BlockDummyable { @@ -14,7 +16,7 @@ public class MachineHephaestus extends BlockDummyable { @Override public TileEntity createNewTileEntity(World world, int meta) { - return null; + return new TileEntityMachineHephaestus(); } @Override @@ -26,4 +28,21 @@ public class MachineHephaestus extends BlockDummyable { public int getOffset() { return 1; } + + @Override + protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { + super.fillSpace(world, x, y, z, dir, o); + + x -= dir.offsetX; + z -= dir.offsetZ; + + this.makeExtra(world, x + 1, y, z); + this.makeExtra(world, x - 1, y, z); + this.makeExtra(world, x, y, z + 1); + this.makeExtra(world, x, y, z - 1); + this.makeExtra(world, x + 1, y + 11, z); + this.makeExtra(world, x - 1, y + 11, z); + this.makeExtra(world, x, y + 11, z + 1); + this.makeExtra(world, x, y + 11, z - 1); + } } diff --git a/src/main/java/com/hbm/render/block/RenderBoxDuct.java b/src/main/java/com/hbm/render/block/RenderBoxDuct.java index cee356687..eb0d53002 100644 --- a/src/main/java/com/hbm/render/block/RenderBoxDuct.java +++ b/src/main/java/com/hbm/render/block/RenderBoxDuct.java @@ -74,12 +74,12 @@ public class RenderBoxDuct implements ISimpleBlockRenderingHandler { } } - boolean pX = Library.canConnectFluid(world, x + 1, y, z, Library.NEG_X, type); - boolean nX = Library.canConnectFluid(world, x - 1, y, z, Library.POS_X, type); - boolean pY = Library.canConnectFluid(world, x, y + 1, z, Library.NEG_Y, type); - boolean nY = Library.canConnectFluid(world, x, y - 1, z, Library.POS_Y, type); - boolean pZ = Library.canConnectFluid(world, x, y, z + 1, Library.NEG_Z, type); - boolean nZ = Library.canConnectFluid(world, x, y, z - 1, Library.POS_Z, type); + boolean pX = Library.canConnectFluid(world, x + 1, y, z, Library.POS_X, type); + boolean nX = Library.canConnectFluid(world, x - 1, y, z, Library.NEG_X, type); + boolean pY = Library.canConnectFluid(world, x, y + 1, z, Library.POS_Y, type); + boolean nY = Library.canConnectFluid(world, x, y - 1, z, Library.NEG_Y, type); + boolean pZ = Library.canConnectFluid(world, x, y, z + 1, Library.POS_Z, type); + boolean nZ = Library.canConnectFluid(world, x, y, z - 1, Library.NEG_Z, type); int mask = 0 + (pX ? 32 : 0) + (nX ? 16 : 0) + (pY ? 8 : 0) + (nY ? 4 : 0) + (pZ ? 2 : 0) + (nZ ? 1 : 0); int count = 0 + (pX ? 1 : 0) + (nX ? 1 : 0) + (pY ? 1 : 0) + (nY ? 1 : 0) + (pZ ? 1 : 0) + (nZ ? 1 : 0); diff --git a/src/main/java/com/hbm/render/block/RenderCableClassic.java b/src/main/java/com/hbm/render/block/RenderCableClassic.java index 00c55223a..23259353e 100644 --- a/src/main/java/com/hbm/render/block/RenderCableClassic.java +++ b/src/main/java/com/hbm/render/block/RenderCableClassic.java @@ -163,12 +163,12 @@ public class RenderCableClassic implements ISimpleBlockRenderingHandler { tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); tessellator.setColorOpaque_F(1, 1, 1); - boolean pX = Library.canConnect(world, x + 1, y, z, Library.NEG_X); - boolean nX = Library.canConnect(world, x - 1, y, z, Library.POS_X); - boolean pY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y); - boolean nY = Library.canConnect(world, x, y - 1, z, Library.POS_Y); - boolean pZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z); - boolean nZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z); + boolean pX = Library.canConnect(world, x + 1, y, z, Library.POS_X); + boolean nX = Library.canConnect(world, x - 1, y, z, Library.NEG_X); + boolean pY = Library.canConnect(world, x, y + 1, z, Library.POS_Y); + boolean nY = Library.canConnect(world, x, y - 1, z, Library.NEG_Y); + boolean pZ = Library.canConnect(world, x, y, z + 1, Library.POS_Z); + boolean nZ = Library.canConnect(world, x, y, z - 1, Library.NEG_Z); double uv_cL = iicon.getMinU(); double uv_cR = iicon.getInterpolatedU(5); diff --git a/src/main/java/com/hbm/render/block/RenderDiode.java b/src/main/java/com/hbm/render/block/RenderDiode.java index 684db58fd..fb68b8dc4 100644 --- a/src/main/java/com/hbm/render/block/RenderDiode.java +++ b/src/main/java/com/hbm/render/block/RenderDiode.java @@ -122,12 +122,12 @@ public class RenderDiode implements ISimpleBlockRenderingHandler { tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); tessellator.setColorOpaque_F(1, 1, 1); - boolean pX = Library.canConnect(world, x + 1, y, z, Library.NEG_X); - boolean nX = Library.canConnect(world, x - 1, y, z, Library.POS_X); - boolean pY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y); - boolean nY = Library.canConnect(world, x, y - 1, z, Library.POS_Y); - boolean pZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z); - boolean nZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z); + boolean pX = Library.canConnect(world, x + 1, y, z, Library.POS_X); + boolean nX = Library.canConnect(world, x - 1, y, z, Library.NEG_X); + boolean pY = Library.canConnect(world, x, y + 1, z, Library.POS_Y); + boolean nY = Library.canConnect(world, x, y - 1, z, Library.NEG_Y); + boolean pZ = Library.canConnect(world, x, y, z + 1, Library.POS_Z); + boolean nZ = Library.canConnect(world, x, y, z - 1, Library.NEG_Z); tessellator.addTranslation(x + 0.5F, y + 0.5F, z + 0.5F); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityHeatBoiler.java b/src/main/java/com/hbm/tileentity/machine/TileEntityHeatBoiler.java index f93c6f8c9..a2325f6af 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityHeatBoiler.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityHeatBoiler.java @@ -20,7 +20,6 @@ import com.hbm.inventory.fluid.trait.FT_Heatable; import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingStep; import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType; import com.hbm.lib.Library; -import com.hbm.main.MainRegistry; import com.hbm.saveddata.TomSaveData; import com.hbm.tileentity.IConfigurableMachine; import com.hbm.tileentity.INBTPacketReceiver; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineHephaestus.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineHephaestus.java new file mode 100644 index 000000000..fe4f0e7d2 --- /dev/null +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineHephaestus.java @@ -0,0 +1,78 @@ +package com.hbm.tileentity.machine; + +import com.hbm.inventory.fluid.FluidType; +import com.hbm.inventory.fluid.Fluids; +import com.hbm.inventory.fluid.tank.FluidTank; +import com.hbm.lib.Library; +import com.hbm.tileentity.INBTPacketReceiver; +import com.hbm.tileentity.TileEntityLoadedBase; +import com.hbm.util.fauxpointtwelve.DirPos; + +import api.hbm.fluid.IFluidStandardTransceiver; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + +public class TileEntityMachineHephaestus extends TileEntityLoadedBase implements INBTPacketReceiver, IFluidStandardTransceiver { + + public FluidTank input; + public FluidTank output; + + public TileEntityMachineHephaestus() { + this.input = new FluidTank(Fluids.OIL, 24_000); + this.output = new FluidTank(Fluids.HOTOIL, 24_000); + } + + @Override + public void updateEntity() { + + if(!worldObj.isRemote) { + this.updateConnections(); + } + } + + @Override + public void networkUnpack(NBTTagCompound nbt) { + + } + + private void updateConnections() { + + for(DirPos pos : getConPos()) { + this.trySubscribe(input.getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); + } + } + + private DirPos[] getConPos() { + + return new DirPos[] { + new DirPos(xCoord + 1, yCoord, zCoord, Library.POS_X), + new DirPos(xCoord - 1, yCoord, zCoord, Library.NEG_X), + new DirPos(xCoord, yCoord, zCoord + 1, Library.POS_Z), + new DirPos(xCoord, yCoord, zCoord - 1, Library.NEG_Z), + new DirPos(xCoord + 1, yCoord + 11, zCoord, Library.POS_X), + new DirPos(xCoord - 1, yCoord + 11, zCoord, Library.NEG_X), + new DirPos(xCoord, yCoord + 11, zCoord + 1, Library.POS_Z), + new DirPos(xCoord, yCoord + 11, zCoord - 1, Library.NEG_Z) + }; + } + + @Override + public FluidTank[] getAllTanks() { + return new FluidTank[] {input, output}; + } + + @Override + public FluidTank[] getSendingTanks() { + return new FluidTank[] {output}; + } + + @Override + public FluidTank[] getReceivingTanks() { + return new FluidTank[] {input}; + } + + @Override + public boolean canConnect(FluidType type, ForgeDirection dir) { + return dir != ForgeDirection.UNKNOWN && dir != ForgeDirection.UP && dir != ForgeDirection.DOWN; + } +}