diff --git a/changelog b/changelog index c0cb151c4..6f219b35c 100644 --- a/changelog +++ b/changelog @@ -20,9 +20,13 @@ * Launch pads now spawn launch smoke just like custom missile compact launchers * Remodeled all tier 0 missiles * Tier 0 missiles now have a much thinner contrail to match their size better +* Covneyor ejectors can now eject sulfur out of the side ports of refineries ## Fixed * Fixed dupe caused by shift-clicking ashes out of the bricked furnace * Fixed missiles jerkingly rotating when launching, they should now smoothly transition from being part of the launch pad to being an entity * Fixed missile control and launch smoke shifting around when the player is moving -* Fixed fast-moving missiles spawning too few particles, causing holes in the contrail \ No newline at end of file +* Fixed fast-moving missiles spawning too few particles, causing holes in the contrail +* Fixed coker units creating soot when not processing anything +* Foundry molds can no longer be removed from basins when there's still material in them, fixing a bug where doing so would void the material +* Fixed molds not saving when cooling off, allowing to dupe metal when leaving and rejoining \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/machine/FoundryCastingBase.java b/src/main/java/com/hbm/blocks/machine/FoundryCastingBase.java index 1ced99e75..661bab7cd 100644 --- a/src/main/java/com/hbm/blocks/machine/FoundryCastingBase.java +++ b/src/main/java/com/hbm/blocks/machine/FoundryCastingBase.java @@ -170,8 +170,8 @@ public abstract class FoundryCastingBase extends BlockContainer implements ICruc TileEntityFoundryCastingBase cast = (TileEntityFoundryCastingBase) world.getTileEntity(x, y, z); - if(cast.slots[0] == null) - return false; + if(cast.slots[0] == null) return false; + if(cast.amount > 0) return false; if(!player.inventory.addItemStackToInventory(cast.slots[0].copy())) { EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, cast.slots[0].copy()); diff --git a/src/main/java/com/hbm/blocks/machine/MachineRefinery.java b/src/main/java/com/hbm/blocks/machine/MachineRefinery.java index 4a720413d..fa7e8e6a6 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineRefinery.java +++ b/src/main/java/com/hbm/blocks/machine/MachineRefinery.java @@ -42,7 +42,7 @@ public class MachineRefinery extends BlockDummyable implements IPersistentInfoPr @Override public TileEntity createNewTileEntity(World world, int meta) { if(meta >= 12) return new TileEntityMachineRefinery(); - if(meta >= 6) return new TileEntityProxyCombo().fluid().power(); + if(meta >= 6) return new TileEntityProxyCombo().fluid().power().inventory(); return null; } diff --git a/src/main/java/com/hbm/inventory/fluid/Fluids.java b/src/main/java/com/hbm/inventory/fluid/Fluids.java index 527133b66..7a760f257 100644 --- a/src/main/java/com/hbm/inventory/fluid/Fluids.java +++ b/src/main/java/com/hbm/inventory/fluid/Fluids.java @@ -46,8 +46,12 @@ public class Fluids { public static FluidType OIL; public static FluidType CRACKOIL; public static FluidType COALOIL; + public static FluidType OIL_DS; + public static FluidType CRACKOIL_DS; public static FluidType HOTOIL; public static FluidType HOTCRACKOIL; + public static FluidType HOTOIL_DS; + public static FluidType HOTCRACKOIL_DS; public static FluidType HEAVYOIL; public static FluidType BITUMEN; public static FluidType SMEAR; @@ -56,10 +60,12 @@ public class Fluids { public static FluidType LUBRICANT; public static FluidType NAPHTHA; public static FluidType NAPHTHA_CRACK; + public static FluidType NAPHTHA_DS; public static FluidType DIESEL; public static FluidType DIESEL_CRACK; public static FluidType LIGHTOIL; public static FluidType LIGHTOIL_CRACK; + public static FluidType LIGHTOIL_DS; public static FluidType KEROSENE; public static FluidType GAS; public static FluidType PETROLEUM; @@ -334,6 +340,13 @@ public class Fluids { FULLERENE = new FluidType("FULLERENE", 0xFF7FED, 3, 3, 3, EnumSymbol.NONE).addTraits(LIQUID, new FT_Corrosive(65)); PHEROMONE = new FluidType("PHEROMONE", 0x5FA6E8, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, new FT_Pheromone(1)); PHEROMONE_M = new FluidType(132, "PHEROMONE_M", 0x48C9B0 , 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, new FT_Pheromone(2)); + OIL_DS = new FluidType("OIL_DS", 0x020202, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS); + HOTOIL_DS = new FluidType("HOTOIL_DS", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addTraits(LIQUID, VISCOUS); + CRACKOIL_DS = new FluidType("CRACKOIL_DS", 0x020202, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS); + HOTCRACKOIL_DS = new FluidType("HOTCRACKOIL_DS", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addTraits(LIQUID, VISCOUS); + NAPHTHA_DS = new FluidType("NAPHTHA_DS", 0x595744, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS); + LIGHTOIL_DS = new FluidType("LIGHTOIL_DS", 0x8c7451, 1, 2, 0, EnumSymbol.NONE).addTraits(LIQUID); + // ^ ^ ^ ^ ^ ^ ^ ^ //ADD NEW FLUIDS HERE @@ -384,18 +397,24 @@ public class Fluids { metaOrder.add(MERCURY); //oils, fuels metaOrder.add(OIL); + metaOrder.add(OIL_DS); metaOrder.add(CRACKOIL); + metaOrder.add(CRACKOIL_DS); metaOrder.add(COALOIL); metaOrder.add(OIL_COKER); metaOrder.add(HOTOIL); + metaOrder.add(HOTOIL_DS); metaOrder.add(HOTCRACKOIL); + metaOrder.add(HOTCRACKOIL_DS); metaOrder.add(HEAVYOIL); metaOrder.add(HEAVYOIL_VACUUM); metaOrder.add(NAPHTHA); + metaOrder.add(NAPHTHA_DS); metaOrder.add(NAPHTHA_CRACK); metaOrder.add(NAPHTHA_COKER); metaOrder.add(REFORMATE); metaOrder.add(LIGHTOIL); + metaOrder.add(LIGHTOIL_DS); metaOrder.add(LIGHTOIL_CRACK); metaOrder.add(LIGHTOIL_VACUUM); metaOrder.add(BITUMEN); diff --git a/src/main/java/com/hbm/inventory/recipes/CokerRecipes.java b/src/main/java/com/hbm/inventory/recipes/CokerRecipes.java index d6f9cf30d..944133896 100644 --- a/src/main/java/com/hbm/inventory/recipes/CokerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CokerRecipes.java @@ -38,12 +38,14 @@ public class CokerRecipes extends SerializableRecipe { registerAuto(HEATINGOIL_VACUUM, OIL_COKER); registerAuto(RECLAIMED, NAPHTHA_COKER); registerAuto(NAPHTHA, NAPHTHA_COKER); + registerAuto(NAPHTHA_DS, NAPHTHA_COKER); registerAuto(NAPHTHA_CRACK, NAPHTHA_COKER); registerAuto(DIESEL, NAPHTHA_COKER); registerAuto(DIESEL_REFORM, NAPHTHA_COKER); registerAuto(DIESEL_CRACK, GAS_COKER); registerAuto(DIESEL_CRACK_REFORM, GAS_COKER); registerAuto(LIGHTOIL, GAS_COKER); + registerAuto(LIGHTOIL_DS, GAS_COKER); registerAuto(LIGHTOIL_CRACK, GAS_COKER); registerAuto(LIGHTOIL_VACUUM, GAS_COKER); registerAuto(BIOFUEL, GAS_COKER); @@ -60,6 +62,7 @@ public class CokerRecipes extends SerializableRecipe { registerRecipe(BITUMEN, 16_000, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), new FluidStack(OIL_COKER, 1_600)); registerRecipe(LUBRICANT, 12_000, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), new FluidStack(OIL_COKER, 1_200)); registerRecipe(CALCIUM_SOLUTION, 125, new ItemStack(ModItems.powder_calcium), new FluidStack(SPENTSTEAM, 100)); + registerRecipe(SOURGAS, 250, new ItemStack(ModItems.sulfur), new FluidStack(GAS_COKER, 150)); } private static void registerAuto(FluidType fluid, FluidType type) { diff --git a/src/main/java/com/hbm/inventory/recipes/FractionRecipes.java b/src/main/java/com/hbm/inventory/recipes/FractionRecipes.java index b3b673a6a..e26769068 100644 --- a/src/main/java/com/hbm/inventory/recipes/FractionRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/FractionRecipes.java @@ -58,12 +58,11 @@ public class FractionRecipes extends SerializableRecipe { fractions.put(Fluids.HEAVYOIL_VACUUM, new Pair(new FluidStack(Fluids.SMEAR, hvac_frac_smear), new FluidStack(Fluids.HEATINGOIL_VACUUM, hvac_frac_heat))); fractions.put(Fluids.REFORMATE, new Pair(new FluidStack(Fluids.AROMATICS, reform_frac_arom), new FluidStack(Fluids.XYLENE, reform_frac_xyle))); fractions.put(Fluids.LIGHTOIL_VACUUM, new Pair(new FluidStack(Fluids.KEROSENE, lvac_frac_kero), new FluidStack(Fluids.REFORMGAS, lvac_frac_gas))); - fractions.put(Fluids.SOURGAS, new Pair(new FluidStack(Fluids.GAS, 30), new FluidStack(Fluids.PETROLEUM, 20))); fractions.put(Fluids.EGG, new Pair(new FluidStack(Fluids.CHOLESTEROL, 50), new FluidStack(Fluids.RADIOSOLVENT, 50))); fractions.put(Fluids.OIL_COKER, new Pair(new FluidStack(Fluids.CRACKOIL, 30), new FluidStack(Fluids.HEATINGOIL, 70))); fractions.put(Fluids.NAPHTHA_COKER, new Pair(new FluidStack(Fluids.NAPHTHA_CRACK, 75), new FluidStack(Fluids.LIGHTOIL_CRACK, 25))); fractions.put(Fluids.GAS_COKER, new Pair(new FluidStack(Fluids.AROMATICS, 25), new FluidStack(Fluids.CARBONDIOXIDE, 75))); - fractions.put(Fluids.CHLOROCALCITE_MIX, new Pair(new FluidStack(Fluids.CHLOROCALCITE_CLEANED, 50), new FluidStack(Fluids.COLLOID, 50))); + fractions.put(Fluids.CHLOROCALCITE_MIX, new Pair(new FluidStack(Fluids.CHLOROCALCITE_CLEANED, 50), new FluidStack(Fluids.COLLOID, 50))); } public static Pair getFractions(FluidType oil) { diff --git a/src/main/java/com/hbm/inventory/recipes/HydrotreatingRecipes.java b/src/main/java/com/hbm/inventory/recipes/HydrotreatingRecipes.java index 7d828e044..840840c24 100644 --- a/src/main/java/com/hbm/inventory/recipes/HydrotreatingRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/HydrotreatingRecipes.java @@ -23,6 +23,35 @@ public class HydrotreatingRecipes extends SerializableRecipe { @Override public void registerDefaults() { + recipes.put(Fluids.OIL, new Triplet( + new FluidStack(Fluids.HYDROGEN, 5), + new FluidStack(Fluids.OIL_DS, 90), + new FluidStack(Fluids.SOURGAS, 15) + )); + + recipes.put(Fluids.CRACKOIL, new Triplet( + new FluidStack(Fluids.HYDROGEN, 5), + new FluidStack(Fluids.CRACKOIL_DS, 90), + new FluidStack(Fluids.SOURGAS, 15) + )); + + recipes.put(Fluids.GAS, new Triplet( + new FluidStack(Fluids.HYDROGEN, 5), + new FluidStack(Fluids.PETROLEUM, 80), + new FluidStack(Fluids.SOURGAS, 15) + )); + + recipes.put(Fluids.DIESEL_CRACK, new Triplet( + new FluidStack(Fluids.HYDROGEN, 10), + new FluidStack(Fluids.DIESEL, 80), + new FluidStack(Fluids.SOURGAS, 15) + )); + + recipes.put(Fluids.DIESEL_CRACK_REFORM, new Triplet( + new FluidStack(Fluids.HYDROGEN, 10), + new FluidStack(Fluids.DIESEL_REFORM, 80), + new FluidStack(Fluids.SOURGAS, 15) + )); } public static Triplet getOutput(FluidType type) { diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityFoundryCastingBase.java b/src/main/java/com/hbm/tileentity/machine/TileEntityFoundryCastingBase.java index a4645bade..578565ae9 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityFoundryCastingBase.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityFoundryCastingBase.java @@ -54,6 +54,7 @@ public abstract class TileEntityFoundryCastingBase extends TileEntityFoundryBase } cooloff = 200; + this.markDirty(); } } else { diff --git a/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineCoker.java b/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineCoker.java index 8e812e5ac..cf90645d5 100644 --- a/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineCoker.java +++ b/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineCoker.java @@ -101,7 +101,7 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl } } - if(worldObj.getTotalWorldTime() % 20 == 0) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND * 20); + if(wasOn && worldObj.getTotalWorldTime() % 20 == 0) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND * 20); } for(DirPos pos : getConPos()) { diff --git a/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineRefinery.java b/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineRefinery.java index 4ee78cd48..d1b79b8ea 100644 --- a/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineRefinery.java +++ b/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineRefinery.java @@ -10,9 +10,6 @@ import com.hbm.handler.MultiblockHandlerXR; import com.hbm.handler.pollution.PollutionHandler; import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.interfaces.IControlReceiver; -import com.hbm.interfaces.IFluidAcceptor; -import com.hbm.interfaces.IFluidContainer; -import com.hbm.interfaces.IFluidSource; import com.hbm.inventory.FluidStack; import com.hbm.inventory.OreDictManager; import com.hbm.inventory.RecipesCommon.AStack; @@ -54,17 +51,13 @@ import net.minecraft.world.Explosion; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityMachineRefinery extends TileEntityMachineBase implements IEnergyUser, IFluidContainer, IFluidAcceptor, IFluidSource, IControlReceiver, IOverpressurable, IPersistentNBT, IRepairable, IFluidStandardTransceiver, IGUIProvider { +public class TileEntityMachineRefinery extends TileEntityMachineBase implements IEnergyUser, IControlReceiver, IOverpressurable, IPersistentNBT, IRepairable, IFluidStandardTransceiver, IGUIProvider { public long power = 0; public int sulfur = 0; public static final int maxSulfur = 100; public static final long maxPower = 1000; public FluidTank[] tanks; - public List list1 = new ArrayList(); - public List list2 = new ArrayList(); - public List list3 = new ArrayList(); - public List list4 = new ArrayList(); public boolean hasExploded = false; public boolean onFire = false; @@ -79,11 +72,11 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements public TileEntityMachineRefinery() { super(12); tanks = new FluidTank[5]; - tanks[0] = new FluidTank(Fluids.HOTOIL, 64_000, 0); - tanks[1] = new FluidTank(Fluids.HEAVYOIL, 24_000, 1); - tanks[2] = new FluidTank(Fluids.NAPHTHA, 24_000, 2); - tanks[3] = new FluidTank(Fluids.LIGHTOIL, 24_000, 3); - tanks[4] = new FluidTank(Fluids.PETROLEUM, 24_000, 4); + tanks[0] = new FluidTank(Fluids.HOTOIL, 64_000); + tanks[1] = new FluidTank(Fluids.HEAVYOIL, 24_000); + tanks[2] = new FluidTank(Fluids.NAPHTHA, 24_000); + tanks[3] = new FluidTank(Fluids.LIGHTOIL, 24_000); + tanks[4] = new FluidTank(Fluids.PETROLEUM, 24_000); } @Override @@ -164,14 +157,6 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements this.updateConnections(); power = Library.chargeTEFromItems(slots, 0, power, maxPower); - - if(worldObj.getTotalWorldTime() % 10 == 0) { - fillFluidInit(tanks[1].getTankType()); - fillFluidInit(tanks[2].getTankType()); - fillFluidInit(tanks[3].getTankType()); - fillFluidInit(tanks[4].getTankType()); - } - tanks[0].loadTank(1, 2, slots); refine(); @@ -373,88 +358,6 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements public long getMaxPower() { return maxPower; } - - @Override - public void fillFluidInit(FluidType type) { - fillFluid(this.xCoord + 1, this.yCoord, this.zCoord - 2, getTact(), type); - fillFluid(this.xCoord + 1, this.yCoord, this.zCoord + 2, getTact(), type); - fillFluid(this.xCoord - 1, this.yCoord, this.zCoord - 2, getTact(), type); - fillFluid(this.xCoord - 1, this.yCoord, this.zCoord + 2, getTact(), type); - - fillFluid(this.xCoord - 2, this.yCoord, this.zCoord + 1, getTact(), type); - fillFluid(this.xCoord + 2, this.yCoord, this.zCoord + 1, getTact(), type); - fillFluid(this.xCoord - 2, this.yCoord, this.zCoord - 1, getTact(), type); - fillFluid(this.xCoord + 2, this.yCoord, this.zCoord - 1, getTact(), type); - } - - @Override - public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) { - Library.transmitFluid(x, y, z, newTact, this, worldObj, type); - } - - @Override - public boolean getTact() { - return worldObj.getTotalWorldTime() % 20 < 10; - } - - @Override - public int getFluidFill(FluidType type) { - - for(int i = 0; i < 5; i++) { - if(type == tanks[i].getTankType()) { - return tanks[i].getFill(); - } - } - - return 0; - } - - @Override - public void setFluidFill(int fill, FluidType type) { - - for(int i = 0; i < 5; i++) { - if(type == tanks[i].getTankType()) { - tanks[i].setFill(fill); - } - } - } - - @Override - public List getFluidList(FluidType type) { - if(type == tanks[1].getTankType()) return list1; - if(type == tanks[2].getTankType()) return list2; - if(type == tanks[3].getTankType()) return list3; - if(type == tanks[4].getTankType()) return list4; - return new ArrayList(); - } - - @Override - public void clearFluidList(FluidType type) { - if(type == tanks[1].getTankType()) list1.clear(); - if(type == tanks[2].getTankType()) list2.clear(); - if(type == tanks[3].getTankType()) list3.clear(); - if(type == tanks[4].getTankType()) list4.clear(); - } - - @Override - public int getMaxFluidFill(FluidType type) { - if(type == tanks[0].getTankType()) - return tanks[0].getMaxFill(); - else - return 0; - } - - @Override - public void setFillForSync(int fill, int index) { - if(index < 5 && tanks[index] != null) - tanks[index].setFill(fill); - } - - @Override - public void setTypeForSync(FluidType type, int index) { - if(index < 5 && tanks[index] != null) - tanks[index].setTankType(type); - } @Override public AxisAlignedBB getRenderBoundingBox() {