diff --git a/assets/hbm/textures/gui/gui_planner_alt.png b/assets/hbm/textures/gui/gui_planner_alt.png index fde189a33..5fc1db986 100644 Binary files a/assets/hbm/textures/gui/gui_planner_alt.png and b/assets/hbm/textures/gui/gui_planner_alt.png differ diff --git a/assets/hbm/textures/gui/gui_turbofan.png b/assets/hbm/textures/gui/gui_turbofan.png new file mode 100644 index 000000000..54fabca4c Binary files /dev/null and b/assets/hbm/textures/gui/gui_turbofan.png differ diff --git a/assets/hbm/textures/items/shimmer_sledge_hd.png b/assets/hbm/textures/items/shimmer_sledge_hd.png new file mode 100644 index 000000000..ef4a1478d Binary files /dev/null and b/assets/hbm/textures/items/shimmer_sledge_hd.png differ diff --git a/com/hbm/blocks/machine/MachineIGenerator.java b/com/hbm/blocks/machine/MachineIGenerator.java index 76371c227..8b48f6ee1 100644 --- a/com/hbm/blocks/machine/MachineIGenerator.java +++ b/com/hbm/blocks/machine/MachineIGenerator.java @@ -70,7 +70,7 @@ public class MachineIGenerator extends BlockContainer implements IMultiblock { } world.setBlock(x - 3, y, z, ModBlocks.dummy_port_igenerator); TileEntity te2 = world.getTileEntity(x - 3, y, z); - if(te instanceof TileEntityDummy) { + if(te2 instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te2; dummy.targetX = x; dummy.targetY = y; @@ -99,7 +99,7 @@ public class MachineIGenerator extends BlockContainer implements IMultiblock { } world.setBlock(x, y, z - 3, ModBlocks.dummy_port_igenerator); TileEntity te2 = world.getTileEntity(x, y, z - 3); - if(te instanceof TileEntityDummy) { + if(te2 instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te2; dummy.targetX = x; dummy.targetY = y; @@ -128,7 +128,7 @@ public class MachineIGenerator extends BlockContainer implements IMultiblock { } world.setBlock(x - 2, y, z, ModBlocks.dummy_port_igenerator); TileEntity te2 = world.getTileEntity(x - 2, y, z); - if(te instanceof TileEntityDummy) { + if(te2 instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te2; dummy.targetX = x; dummy.targetY = y; @@ -157,7 +157,7 @@ public class MachineIGenerator extends BlockContainer implements IMultiblock { } world.setBlock(x, y, z - 2, ModBlocks.dummy_port_igenerator); TileEntity te2 = world.getTileEntity(x, y, z - 2); - if(te instanceof TileEntityDummy) { + if(te2 instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te2; dummy.targetX = x; dummy.targetY = y; diff --git a/com/hbm/blocks/machine/MachinePumpjack.java b/com/hbm/blocks/machine/MachinePumpjack.java index 962b46e36..e5c711366 100644 --- a/com/hbm/blocks/machine/MachinePumpjack.java +++ b/com/hbm/blocks/machine/MachinePumpjack.java @@ -120,22 +120,38 @@ public class MachinePumpjack extends BlockContainer implements IMultiblock { // DummyBlockPumpjack.safeBreak = true; - world.setBlock(x + 2, y, z, ModBlocks.dummy_port_pumpjack); - TileEntity te = world.getTileEntity(x + 2, y, z); + world.setBlock(x - 2, y, z + 1, ModBlocks.dummy_port_pumpjack); + TileEntity te = world.getTileEntity(x + 2, y, z + 1); if(te instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te; dummy.targetX = x; dummy.targetY = y; dummy.targetZ = z; } - world.setBlock(x - 3, y, z, ModBlocks.dummy_port_pumpjack); - TileEntity te2 = world.getTileEntity(x - 3, y, z); - if(te instanceof TileEntityDummy) { + world.setBlock(x - 2, y, z - 1, ModBlocks.dummy_port_pumpjack); + TileEntity te2 = world.getTileEntity(x + 2, y, z - 1); + if(te2 instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te2; dummy.targetX = x; dummy.targetY = y; dummy.targetZ = z; } + world.setBlock(x - 3, y, z + 1, ModBlocks.dummy_port_pumpjack); + TileEntity te3 = world.getTileEntity(x + 3, y, z + 1); + if(te3 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te3; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x - 3, y, z - 1, ModBlocks.dummy_port_pumpjack); + TileEntity te4 = world.getTileEntity(x + 3, y, z - 1); + if(te4 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te4; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } DummyBlockPumpjack.safeBreak = false; // @@ -149,22 +165,38 @@ public class MachinePumpjack extends BlockContainer implements IMultiblock { // DummyBlockPumpjack.safeBreak = true; - world.setBlock(x, y, z + 2, ModBlocks.dummy_port_pumpjack); - TileEntity te = world.getTileEntity(x, y, z + 2); + world.setBlock(x + 1, y, z - 2, ModBlocks.dummy_port_pumpjack); + TileEntity te = world.getTileEntity(x + 1, y, z - 2); if(te instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te; dummy.targetX = x; dummy.targetY = y; dummy.targetZ = z; } - world.setBlock(x, y, z - 3, ModBlocks.dummy_port_pumpjack); - TileEntity te2 = world.getTileEntity(x, y, z - 3); - if(te instanceof TileEntityDummy) { + world.setBlock(x - 1, y, z - 2, ModBlocks.dummy_port_pumpjack); + TileEntity te2 = world.getTileEntity(x - 1, y, z - 2); + if(te2 instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te2; dummy.targetX = x; dummy.targetY = y; dummy.targetZ = z; } + world.setBlock(x + 1, y, z - 3, ModBlocks.dummy_port_pumpjack); + TileEntity te3 = world.getTileEntity(x + 1, y, z - 3); + if(te3 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te3; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x - 1, y, z - 3, ModBlocks.dummy_port_pumpjack); + TileEntity te4 = world.getTileEntity(x - 1, y, z - 3); + if(te4 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te4; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } DummyBlockPumpjack.safeBreak = false; // @@ -178,22 +210,38 @@ public class MachinePumpjack extends BlockContainer implements IMultiblock { // DummyBlockPumpjack.safeBreak = true; - world.setBlock(x + 3, y, z, ModBlocks.dummy_port_pumpjack); - TileEntity te = world.getTileEntity(x + 3, y, z); + world.setBlock(x + 2, y, z + 1, ModBlocks.dummy_port_pumpjack); + TileEntity te = world.getTileEntity(x + 2, y, z + 1); if(te instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te; dummy.targetX = x; dummy.targetY = y; dummy.targetZ = z; } - world.setBlock(x - 2, y, z, ModBlocks.dummy_port_pumpjack); - TileEntity te2 = world.getTileEntity(x - 2, y, z); - if(te instanceof TileEntityDummy) { + world.setBlock(x + 2, y, z - 1, ModBlocks.dummy_port_pumpjack); + TileEntity te2 = world.getTileEntity(x + 2, y, z - 1); + if(te2 instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te2; dummy.targetX = x; dummy.targetY = y; dummy.targetZ = z; } + world.setBlock(x + 3, y, z + 1, ModBlocks.dummy_port_pumpjack); + TileEntity te3 = world.getTileEntity(x + 3, y, z + 1); + if(te3 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te3; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x + 3, y, z - 1, ModBlocks.dummy_port_pumpjack); + TileEntity te4 = world.getTileEntity(x + 3, y, z - 1); + if(te4 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te4; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } DummyBlockPumpjack.safeBreak = false; // @@ -207,22 +255,38 @@ public class MachinePumpjack extends BlockContainer implements IMultiblock { // DummyBlockPumpjack.safeBreak = true; - world.setBlock(x, y, z + 3, ModBlocks.dummy_port_pumpjack); - TileEntity te = world.getTileEntity(x, y, z + 3); + world.setBlock(x + 1, y, z + 2, ModBlocks.dummy_port_pumpjack); + TileEntity te = world.getTileEntity(x + 1, y, z + 2); if(te instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te; dummy.targetX = x; dummy.targetY = y; dummy.targetZ = z; } - world.setBlock(x, y, z - 2, ModBlocks.dummy_port_pumpjack); - TileEntity te2 = world.getTileEntity(x, y, z - 2); - if(te instanceof TileEntityDummy) { + world.setBlock(x - 1, y, z + 2, ModBlocks.dummy_port_pumpjack); + TileEntity te2 = world.getTileEntity(x - 1, y, z + 2); + if(te2 instanceof TileEntityDummy) { TileEntityDummy dummy = (TileEntityDummy)te2; dummy.targetX = x; dummy.targetY = y; dummy.targetZ = z; } + world.setBlock(x + 1, y, z + 3, ModBlocks.dummy_port_pumpjack); + TileEntity te3 = world.getTileEntity(x + 1, y, z + 3); + if(te3 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te3; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } + world.setBlock(x - 1, y, z + 3, ModBlocks.dummy_port_pumpjack); + TileEntity te4 = world.getTileEntity(x - 1, y, z + 3); + if(te4 instanceof TileEntityDummy) { + TileEntityDummy dummy = (TileEntityDummy)te4; + dummy.targetX = x; + dummy.targetY = y; + dummy.targetZ = z; + } DummyBlockPumpjack.safeBreak = false; // diff --git a/com/hbm/entity/projectile/EntityRubble.java b/com/hbm/entity/projectile/EntityRubble.java index 5941ac5ea..8d9db3150 100644 --- a/com/hbm/entity/projectile/EntityRubble.java +++ b/com/hbm/entity/projectile/EntityRubble.java @@ -39,7 +39,7 @@ public class EntityRubble extends EntityThrowable { p_70184_1_.entityHit.attackEntityFrom(ModDamageSource.rubble, b0); } - if(this.ticksExisted > 5) { + if(this.ticksExisted > 2) { this.setDead(); if(!this.worldObj.isRemote) worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 0.1F, true); diff --git a/com/hbm/lib/Library.java b/com/hbm/lib/Library.java index 40f3b63fb..9546071bf 100644 --- a/com/hbm/lib/Library.java +++ b/com/hbm/lib/Library.java @@ -286,31 +286,9 @@ public class Library { world.getBlock(x, y, z) == ModBlocks.dummy_port_drill || world.getBlock(x, y, z) == ModBlocks.dummy_port_assembler || world.getBlock(x, y, z) == ModBlocks.dummy_port_chemplant || - world.getBlock(x, y, z) == ModBlocks.dummy_port_refinery) - { - return true; - } - return false; - } - - public static boolean checkOilConnectables(World world, int x, int y, int z) - { - TileEntity tileentity = world.getTileEntity(x, y, z); - if((tileentity != null && tileentity instanceof IOilDuct) || - world.getBlock(x, y, z) == ModBlocks.dummy_port_well || - world.getBlock(x, y, z) == ModBlocks.machine_refinery) - { - return true; - } - return false; - } - - public static boolean checkGasConnectables(World world, int x, int y, int z) - { - TileEntity tileentity = world.getTileEntity(x, y, z); - if((tileentity != null && tileentity instanceof IGasDuct) || - world.getBlock(x, y, z) == ModBlocks.dummy_port_well || - world.getBlock(x, y, z) == ModBlocks.dummy_port_flare) + world.getBlock(x, y, z) == ModBlocks.dummy_port_refinery || + world.getBlock(x, y, z) == ModBlocks.dummy_port_pumpjack || + world.getBlock(x, y, z) == ModBlocks.dummy_port_turbofan) { return true; } @@ -322,13 +300,23 @@ public class Library { TileEntity tileentity = world.getTileEntity(x, y, z); if(tileentity != null && tileentity instanceof TileEntityFluidDuct && ((TileEntityFluidDuct)tileentity).type == type) return true; + if(tileentity != null && tileentity instanceof TileEntityOilDuct && ((TileEntityOilDuct)tileentity).type == type) + return true; + if(tileentity != null && tileentity instanceof TileEntityGasDuct && ((TileEntityGasDuct)tileentity).type == type) + return true; + if(tileentity != null && tileentity instanceof TileEntityOilDuctSolid && ((TileEntityOilDuctSolid)tileentity).type == type) + return true; + if(tileentity != null && tileentity instanceof TileEntityGasDuctSolid && ((TileEntityGasDuctSolid)tileentity).type == type) + return true; if((tileentity != null && (tileentity instanceof IFluidAcceptor || tileentity instanceof IFluidSource)) || world.getBlock(x, y, z) == ModBlocks.dummy_port_well || world.getBlock(x, y, z) == ModBlocks.dummy_port_flare || world.getBlock(x, y, z) == ModBlocks.dummy_port_chemplant || world.getBlock(x, y, z) == ModBlocks.dummy_port_fluidtank || - world.getBlock(x, y, z) == ModBlocks.dummy_port_refinery) + world.getBlock(x, y, z) == ModBlocks.dummy_port_refinery || + world.getBlock(x, y, z) == ModBlocks.dummy_port_pumpjack || + world.getBlock(x, y, z) == ModBlocks.dummy_port_turbofan) { return true; } @@ -348,32 +336,6 @@ public class Library { return false; } - public static boolean checkOilUnionListForOil(List list, IOilSource that) { - - for(UnionOfTileEntitiesAndBooleansForOil union : list) - { - if(union.source == that) - { - return true; - } - } - - return false; - } - - public static boolean checkGasUnionListForGas(List list, IGasSource that) { - - for(UnionOfTileEntitiesAndBooleansForGas union : list) - { - if(union.source == that) - { - return true; - } - } - - return false; - } - public static boolean checkUnionListForFluids(List list, IFluidSource that) { for(UnionOfTileEntitiesAndBooleansForFluids union : list) @@ -869,6 +831,11 @@ public class Library { { tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ); } + //Pumpjack + if(block == ModBlocks.dummy_port_pumpjack) + { + tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ); + } if(tileentity instanceof IConductor) { @@ -983,195 +950,6 @@ public class Library { } } - public static void transmitOil(int x, int y, int z, boolean newTact, IOilSource that, World worldObj) { - Block block = worldObj.getBlock(x, y, z); - TileEntity tileentity = worldObj.getTileEntity(x, y, z); - - if(tileentity instanceof IOilDuct) - { - if(tileentity instanceof TileEntityOilDuct) - { - if(Library.checkOilUnionListForOil(((TileEntityOilDuct)tileentity).uoteab, that)) - { - for(int i = 0; i < ((TileEntityOilDuct)tileentity).uoteab.size(); i++) - { - if(((TileEntityOilDuct)tileentity).uoteab.get(i).source == that) - { - if(((TileEntityOilDuct)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityOilDuct)tileentity).uoteab.get(i).ticked = newTact; - that.fill(x, y + 1, z, that.getTact()); - that.fill(x, y - 1, z, that.getTact()); - that.fill(x - 1, y, z, that.getTact()); - that.fill(x + 1, y, z, that.getTact()); - that.fill(x, y, z - 1, that.getTact()); - that.fill(x, y, z + 1, that.getTact()); - } - } - } - } else { - ((TileEntityOilDuct)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForOil(that, newTact)); - } - } - if(tileentity instanceof TileEntityOilDuctSolid) - { - if(Library.checkOilUnionListForOil(((TileEntityOilDuctSolid)tileentity).uoteab, that)) - { - for(int i = 0; i < ((TileEntityOilDuctSolid)tileentity).uoteab.size(); i++) - { - if(((TileEntityOilDuctSolid)tileentity).uoteab.get(i).source == that) - { - if(((TileEntityOilDuctSolid)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityOilDuctSolid)tileentity).uoteab.get(i).ticked = newTact; - that.fill(x, y + 1, z, that.getTact()); - that.fill(x, y - 1, z, that.getTact()); - that.fill(x - 1, y, z, that.getTact()); - that.fill(x + 1, y, z, that.getTact()); - that.fill(x, y, z - 1, that.getTact()); - that.fill(x, y, z + 1, that.getTact()); - } - } - } - } else { - ((TileEntityOilDuctSolid)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForOil(that, newTact)); - } - } - } - - if(tileentity instanceof IOilAcceptor && newTact) - { - that.getList().add((IOilAcceptor)tileentity); - } - - if(!newTact) - { - int size = that.getList().size(); - if(size > 0) - { - int part = that.getSFill() / size; - for(IOilAcceptor consume : that.getList()) - { - if(consume.getFill() < consume.getMaxFill()) - { - if(consume.getMaxFill() - consume.getFill() >= part) - { - that.setSFill(that.getSFill()-part); - consume.setFill(consume.getFill() + part); - } else { - that.setSFill(that.getSFill() - (consume.getMaxFill() - consume.getFill())); - consume.setFill(consume.getMaxFill()); - } - } - } - } - that.clearList(); - } - } - - public static void transmitGas(int x, int y, int z, boolean newTact, IGasSource that, World worldObj) { - Block block = worldObj.getBlock(x, y, z); - TileEntity tileentity = worldObj.getTileEntity(x, y, z); - - if(block == ModBlocks.dummy_port_flare && worldObj.getBlock(x + 1, y, z) == ModBlocks.machine_flare) - { - tileentity = worldObj.getTileEntity(x + 1, y, z); - } - if(block == ModBlocks.dummy_port_flare && worldObj.getBlock(x - 1, y, z) == ModBlocks.machine_flare) - { - tileentity = worldObj.getTileEntity(x - 1, y, z); - } - if(block == ModBlocks.dummy_port_flare && worldObj.getBlock(x, y, z + 1) == ModBlocks.machine_flare) - { - tileentity = worldObj.getTileEntity(x, y, z + 1); - } - if(block == ModBlocks.dummy_port_flare && worldObj.getBlock(x, y, z - 1) == ModBlocks.machine_flare) - { - tileentity = worldObj.getTileEntity(x, y, z - 1); - } - - if(tileentity instanceof IGasDuct) - { - if(tileentity instanceof TileEntityGasDuct) - { - if(Library.checkGasUnionListForGas(((TileEntityGasDuct)tileentity).uoteab, that)) - { - for(int i = 0; i < ((TileEntityGasDuct)tileentity).uoteab.size(); i++) - { - if(((TileEntityGasDuct)tileentity).uoteab.get(i).source == that) - { - if(((TileEntityGasDuct)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityGasDuct)tileentity).uoteab.get(i).ticked = newTact; - that.fillGas(x, y + 1, z, that.getTact()); - that.fillGas(x, y - 1, z, that.getTact()); - that.fillGas(x - 1, y, z, that.getTact()); - that.fillGas(x + 1, y, z, that.getTact()); - that.fillGas(x, y, z - 1, that.getTact()); - that.fillGas(x, y, z + 1, that.getTact()); - } - } - } - } else { - ((TileEntityGasDuct)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForGas(that, newTact)); - } - } - if(tileentity instanceof TileEntityGasDuctSolid) - { - if(Library.checkGasUnionListForGas(((TileEntityGasDuctSolid)tileentity).uoteab, that)) - { - for(int i = 0; i < ((TileEntityGasDuctSolid)tileentity).uoteab.size(); i++) - { - if(((TileEntityGasDuctSolid)tileentity).uoteab.get(i).source == that) - { - if(((TileEntityGasDuctSolid)tileentity).uoteab.get(i).ticked != newTact) - { - ((TileEntityGasDuctSolid)tileentity).uoteab.get(i).ticked = newTact; - that.fillGas(x, y + 1, z, that.getTact()); - that.fillGas(x, y - 1, z, that.getTact()); - that.fillGas(x - 1, y, z, that.getTact()); - that.fillGas(x + 1, y, z, that.getTact()); - that.fillGas(x, y, z - 1, that.getTact()); - that.fillGas(x, y, z + 1, that.getTact()); - } - } - } - } else { - ((TileEntityGasDuctSolid)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForGas(that, newTact)); - } - } - } - - if(tileentity instanceof IGasAcceptor && newTact) - { - that.getGasList().add((IGasAcceptor)tileentity); - } - - if(!newTact) - { - int size = that.getGasList().size(); - if(size > 0) - { - int part = that.getGasFill() / size; - for(IGasAcceptor consume : that.getGasList()) - { - if(consume.getGasFill() < consume.getMaxGasFill()) - { - if(consume.getMaxGasFill() - consume.getGasFill() >= part) - { - that.setGasFill(that.getGasFill()-part); - consume.setGasFill(consume.getGasFill() + part); - } else { - that.setGasFill(that.getGasFill() - (consume.getMaxGasFill() - consume.getGasFill())); - consume.setGasFill(consume.getMaxGasFill()); - } - } - } - } - that.clearGasList(); - } - } - public static void transmitFluid(int x, int y, int z, boolean newTact, IFluidSource that, World worldObj, FluidType type) { Block block = worldObj.getBlock(x, y, z); TileEntity tileentity = worldObj.getTileEntity(x, y, z); @@ -1226,6 +1004,102 @@ public class Library { ((TileEntityFluidDuct)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForFluids(that, newTact)); } } + if(tileentity instanceof TileEntityGasDuct && ((TileEntityGasDuct)tileentity).type.name().equals(type.name())) + { + if(Library.checkUnionListForFluids(((TileEntityGasDuct)tileentity).uoteab, that)) + { + for(int i = 0; i < ((TileEntityGasDuct)tileentity).uoteab.size(); i++) + { + if(((TileEntityGasDuct)tileentity).uoteab.get(i).source == that) + { + if(((TileEntityGasDuct)tileentity).uoteab.get(i).ticked != newTact) + { + ((TileEntityGasDuct)tileentity).uoteab.get(i).ticked = newTact; + that.fillFluid(x, y + 1, z, that.getTact(), type); + that.fillFluid(x, y - 1, z, that.getTact(), type); + that.fillFluid(x - 1, y, z, that.getTact(), type); + that.fillFluid(x + 1, y, z, that.getTact(), type); + that.fillFluid(x, y, z - 1, that.getTact(), type); + that.fillFluid(x, y, z + 1, that.getTact(), type); + } + } + } + } else { + ((TileEntityGasDuct)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForFluids(that, newTact)); + } + } + if(tileentity instanceof TileEntityOilDuct && ((TileEntityOilDuct)tileentity).type.name().equals(type.name())) + { + if(Library.checkUnionListForFluids(((TileEntityOilDuct)tileentity).uoteab, that)) + { + for(int i = 0; i < ((TileEntityOilDuct)tileentity).uoteab.size(); i++) + { + if(((TileEntityOilDuct)tileentity).uoteab.get(i).source == that) + { + if(((TileEntityOilDuct)tileentity).uoteab.get(i).ticked != newTact) + { + ((TileEntityOilDuct)tileentity).uoteab.get(i).ticked = newTact; + that.fillFluid(x, y + 1, z, that.getTact(), type); + that.fillFluid(x, y - 1, z, that.getTact(), type); + that.fillFluid(x - 1, y, z, that.getTact(), type); + that.fillFluid(x + 1, y, z, that.getTact(), type); + that.fillFluid(x, y, z - 1, that.getTact(), type); + that.fillFluid(x, y, z + 1, that.getTact(), type); + } + } + } + } else { + ((TileEntityOilDuct)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForFluids(that, newTact)); + } + } + if(tileentity instanceof TileEntityGasDuctSolid && ((TileEntityGasDuctSolid)tileentity).type.name().equals(type.name())) + { + if(Library.checkUnionListForFluids(((TileEntityGasDuctSolid)tileentity).uoteab, that)) + { + for(int i = 0; i < ((TileEntityGasDuctSolid)tileentity).uoteab.size(); i++) + { + if(((TileEntityGasDuctSolid)tileentity).uoteab.get(i).source == that) + { + if(((TileEntityGasDuctSolid)tileentity).uoteab.get(i).ticked != newTact) + { + ((TileEntityGasDuctSolid)tileentity).uoteab.get(i).ticked = newTact; + that.fillFluid(x, y + 1, z, that.getTact(), type); + that.fillFluid(x, y - 1, z, that.getTact(), type); + that.fillFluid(x - 1, y, z, that.getTact(), type); + that.fillFluid(x + 1, y, z, that.getTact(), type); + that.fillFluid(x, y, z - 1, that.getTact(), type); + that.fillFluid(x, y, z + 1, that.getTact(), type); + } + } + } + } else { + ((TileEntityGasDuctSolid)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForFluids(that, newTact)); + } + } + if(tileentity instanceof TileEntityOilDuctSolid && ((TileEntityOilDuctSolid)tileentity).type.name().equals(type.name())) + { + if(Library.checkUnionListForFluids(((TileEntityOilDuctSolid)tileentity).uoteab, that)) + { + for(int i = 0; i < ((TileEntityOilDuctSolid)tileentity).uoteab.size(); i++) + { + if(((TileEntityOilDuctSolid)tileentity).uoteab.get(i).source == that) + { + if(((TileEntityOilDuctSolid)tileentity).uoteab.get(i).ticked != newTact) + { + ((TileEntityOilDuctSolid)tileentity).uoteab.get(i).ticked = newTact; + that.fillFluid(x, y + 1, z, that.getTact(), type); + that.fillFluid(x, y - 1, z, that.getTact(), type); + that.fillFluid(x - 1, y, z, that.getTact(), type); + that.fillFluid(x + 1, y, z, that.getTact(), type); + that.fillFluid(x, y, z - 1, that.getTact(), type); + that.fillFluid(x, y, z + 1, that.getTact(), type); + } + } + } + } else { + ((TileEntityOilDuctSolid)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleansForFluids(that, newTact)); + } + } } if(tileentity instanceof IFluidAcceptor && newTact && !(tileentity instanceof TileEntityMachineFluidTank && ((TileEntityMachineFluidTank)tileentity).dna())) diff --git a/com/hbm/lib/RefStrings.java b/com/hbm/lib/RefStrings.java index 697aec0bb..9b6c71e2d 100644 --- a/com/hbm/lib/RefStrings.java +++ b/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.26 BETA (Astatine-Actinium-X02)"; + public static final String VERSION = "1.0.26 BETA (Bromine-Lanthanium-X02)"; //HBM's Beta Naming Convention: //V T (X-Y-Z) //V -> next release version diff --git a/com/hbm/tileentity/TileEntityGasDuct.java b/com/hbm/tileentity/TileEntityGasDuct.java index be23f9a52..fa226cd5b 100644 --- a/com/hbm/tileentity/TileEntityGasDuct.java +++ b/com/hbm/tileentity/TileEntityGasDuct.java @@ -1,22 +1,29 @@ package com.hbm.tileentity; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids; import com.hbm.calc.UnionOfTileEntitiesAndBooleansForGas; +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.interfaces.IFluidDuct; import com.hbm.interfaces.IGasDuct; import com.hbm.lib.Library; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.TEFluidPipePacket; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityGasDuct extends TileEntity implements IGasDuct { +public class TileEntityGasDuct extends TileEntity implements IFluidDuct { public ForgeDirection[] connections = new ForgeDirection[6]; - - public List uoteab = new ArrayList(); + public FluidType type = FluidType.GAS; + public List uoteab = new ArrayList(); public TileEntityGasDuct() { @@ -24,28 +31,45 @@ public class TileEntityGasDuct extends TileEntity implements IGasDuct { @Override public void updateEntity() { + + if(!worldObj.isRemote) + PacketDispatcher.wrapper.sendToAll(new TEFluidPipePacket(xCoord, yCoord, zCoord, type)); + this.updateConnections(); } public void updateConnections() { - if(Library.checkGasConnectables(this.worldObj, xCoord, yCoord + 1, zCoord)) connections[0] = ForgeDirection.UP; + if(Library.checkFluidConnectables(this.worldObj, xCoord, yCoord + 1, zCoord, type)) connections[0] = ForgeDirection.UP; else connections[0] = null; - if(Library.checkGasConnectables(this.worldObj, xCoord, yCoord - 1, zCoord)) connections[1] = ForgeDirection.DOWN; + if(Library.checkFluidConnectables(this.worldObj, xCoord, yCoord - 1, zCoord, type)) connections[1] = ForgeDirection.DOWN; else connections[1] = null; - if(Library.checkGasConnectables(this.worldObj, xCoord, yCoord, zCoord - 1)) connections[2] = ForgeDirection.NORTH; + if(Library.checkFluidConnectables(this.worldObj, xCoord, yCoord, zCoord - 1, type)) connections[2] = ForgeDirection.NORTH; else connections[2] = null; - if(Library.checkGasConnectables(this.worldObj, xCoord + 1, yCoord, zCoord)) connections[3] = ForgeDirection.EAST; + if(Library.checkFluidConnectables(this.worldObj, xCoord + 1, yCoord, zCoord, type)) connections[3] = ForgeDirection.EAST; else connections[3] = null; - if(Library.checkGasConnectables(this.worldObj, xCoord, yCoord, zCoord + 1)) connections[4] = ForgeDirection.SOUTH; + if(Library.checkFluidConnectables(this.worldObj, xCoord, yCoord, zCoord + 1, type)) connections[4] = ForgeDirection.SOUTH; else connections[4] = null; - if(Library.checkGasConnectables(this.worldObj, xCoord - 1, yCoord, zCoord)) connections[5] = ForgeDirection.WEST; + if(Library.checkFluidConnectables(this.worldObj, xCoord - 1, yCoord, zCoord, type)) connections[5] = ForgeDirection.WEST; else connections[5] = null; } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + type = FluidType.GAS; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + } @Override @SideOnly(Side.CLIENT) diff --git a/com/hbm/tileentity/TileEntityGasDuctSolid.java b/com/hbm/tileentity/TileEntityGasDuctSolid.java index 5b82052b2..01cf67f65 100644 --- a/com/hbm/tileentity/TileEntityGasDuctSolid.java +++ b/com/hbm/tileentity/TileEntityGasDuctSolid.java @@ -3,12 +3,16 @@ package com.hbm.tileentity; import java.util.ArrayList; import java.util.List; +import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids; import com.hbm.calc.UnionOfTileEntitiesAndBooleansForGas; +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.interfaces.IFluidDuct; import com.hbm.interfaces.IGasDuct; import net.minecraft.tileentity.TileEntity; -public class TileEntityGasDuctSolid extends TileEntity implements IGasDuct { +public class TileEntityGasDuctSolid extends TileEntity implements IFluidDuct { - public List uoteab = new ArrayList(); + public FluidType type = FluidType.GAS; + public List uoteab = new ArrayList(); } diff --git a/com/hbm/tileentity/TileEntityMachinePumpjack.java b/com/hbm/tileentity/TileEntityMachinePumpjack.java index 9a90dc695..7bc7cebae 100644 --- a/com/hbm/tileentity/TileEntityMachinePumpjack.java +++ b/com/hbm/tileentity/TileEntityMachinePumpjack.java @@ -466,10 +466,33 @@ public class TileEntityMachinePumpjack extends TileEntity implements ISidedInven @Override public void fillFluidInit(FluidType type) { - fillFluid(this.xCoord - 2, this.yCoord, this.zCoord, getTact(), type); - fillFluid(this.xCoord + 2, this.yCoord, this.zCoord, getTact(), type); - fillFluid(this.xCoord, this.yCoord, this.zCoord - 2, getTact(), type); - fillFluid(this.xCoord, this.yCoord, this.zCoord + 2, getTact(), type); + + int i = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + + if(i == 5) { + fillFluid(this.xCoord - 2, this.yCoord, this.zCoord + 2, getTact(), type); + fillFluid(this.xCoord - 2, this.yCoord, this.zCoord - 2, getTact(), type); + fillFluid(this.xCoord - 3, this.yCoord, this.zCoord + 2, getTact(), type); + fillFluid(this.xCoord - 3, this.yCoord, this.zCoord - 2, getTact(), type); + } + if(i == 3) { + fillFluid(this.xCoord + 2, this.yCoord, this.zCoord - 2, getTact(), type); + fillFluid(this.xCoord - 2, this.yCoord, this.zCoord - 2, getTact(), type); + fillFluid(this.xCoord + 2, this.yCoord, this.zCoord - 2, getTact(), type); + fillFluid(this.xCoord - 2, this.yCoord, this.zCoord - 2, getTact(), type); + } + if(i == 4) { + fillFluid(this.xCoord + 2, this.yCoord, this.zCoord + 2, getTact(), type); + fillFluid(this.xCoord + 2, this.yCoord, this.zCoord - 2, getTact(), type); + fillFluid(this.xCoord + 3, this.yCoord, this.zCoord + 2, getTact(), type); + fillFluid(this.xCoord + 3, this.yCoord, this.zCoord - 2, getTact(), type); + } + if(i == 2) { + fillFluid(this.xCoord + 2, this.yCoord, this.zCoord + 2, getTact(), type); + fillFluid(this.xCoord - 2, this.yCoord, this.zCoord + 2, getTact(), type); + fillFluid(this.xCoord + 2, this.yCoord, this.zCoord + 2, getTact(), type); + fillFluid(this.xCoord - 2, this.yCoord, this.zCoord + 2, getTact(), type); + } } @Override diff --git a/com/hbm/tileentity/TileEntityOilDuct.java b/com/hbm/tileentity/TileEntityOilDuct.java index 27db97e0c..02994dc1d 100644 --- a/com/hbm/tileentity/TileEntityOilDuct.java +++ b/com/hbm/tileentity/TileEntityOilDuct.java @@ -1,22 +1,29 @@ package com.hbm.tileentity; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids; import com.hbm.calc.UnionOfTileEntitiesAndBooleansForOil; +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.interfaces.IFluidDuct; import com.hbm.interfaces.IOilDuct; import com.hbm.lib.Library; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.TEFluidPipePacket; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityOilDuct extends TileEntity implements IOilDuct { +public class TileEntityOilDuct extends TileEntity implements IFluidDuct { public ForgeDirection[] connections = new ForgeDirection[6]; - - public List uoteab = new ArrayList(); + public FluidType type = FluidType.OIL; + public List uoteab = new ArrayList(); public TileEntityOilDuct() { @@ -24,28 +31,45 @@ public class TileEntityOilDuct extends TileEntity implements IOilDuct { @Override public void updateEntity() { + + if(!worldObj.isRemote) + PacketDispatcher.wrapper.sendToAll(new TEFluidPipePacket(xCoord, yCoord, zCoord, type)); + this.updateConnections(); } public void updateConnections() { - if(Library.checkOilConnectables(this.worldObj, xCoord, yCoord + 1, zCoord)) connections[0] = ForgeDirection.UP; + if(Library.checkFluidConnectables(this.worldObj, xCoord, yCoord + 1, zCoord, type)) connections[0] = ForgeDirection.UP; else connections[0] = null; - if(Library.checkOilConnectables(this.worldObj, xCoord, yCoord - 1, zCoord)) connections[1] = ForgeDirection.DOWN; + if(Library.checkFluidConnectables(this.worldObj, xCoord, yCoord - 1, zCoord, type)) connections[1] = ForgeDirection.DOWN; else connections[1] = null; - if(Library.checkOilConnectables(this.worldObj, xCoord, yCoord, zCoord - 1)) connections[2] = ForgeDirection.NORTH; + if(Library.checkFluidConnectables(this.worldObj, xCoord, yCoord, zCoord - 1, type)) connections[2] = ForgeDirection.NORTH; else connections[2] = null; - if(Library.checkOilConnectables(this.worldObj, xCoord + 1, yCoord, zCoord)) connections[3] = ForgeDirection.EAST; + if(Library.checkFluidConnectables(this.worldObj, xCoord + 1, yCoord, zCoord, type)) connections[3] = ForgeDirection.EAST; else connections[3] = null; - if(Library.checkOilConnectables(this.worldObj, xCoord, yCoord, zCoord + 1)) connections[4] = ForgeDirection.SOUTH; + if(Library.checkFluidConnectables(this.worldObj, xCoord, yCoord, zCoord + 1, type)) connections[4] = ForgeDirection.SOUTH; else connections[4] = null; - if(Library.checkOilConnectables(this.worldObj, xCoord - 1, yCoord, zCoord)) connections[5] = ForgeDirection.WEST; + if(Library.checkFluidConnectables(this.worldObj, xCoord - 1, yCoord, zCoord, type)) connections[5] = ForgeDirection.WEST; else connections[5] = null; } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + type = FluidType.OIL; + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + } @Override @SideOnly(Side.CLIENT) diff --git a/com/hbm/tileentity/TileEntityOilDuctSolid.java b/com/hbm/tileentity/TileEntityOilDuctSolid.java index 17fd647a0..aed0ee453 100644 --- a/com/hbm/tileentity/TileEntityOilDuctSolid.java +++ b/com/hbm/tileentity/TileEntityOilDuctSolid.java @@ -3,13 +3,17 @@ package com.hbm.tileentity; import java.util.ArrayList; import java.util.List; +import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids; import com.hbm.calc.UnionOfTileEntitiesAndBooleansForOil; +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.interfaces.IFluidDuct; import com.hbm.interfaces.IOilDuct; import net.minecraft.tileentity.TileEntity; -public class TileEntityOilDuctSolid extends TileEntity implements IOilDuct { - - public List uoteab = new ArrayList(); +public class TileEntityOilDuctSolid extends TileEntity implements IFluidDuct { + + public FluidType type = FluidType.OIL; + public List uoteab = new ArrayList(); }