mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-20 20:12:30 +00:00
Sustained gas and fluid support for Chemical Washer, Chemical Crystallizer and Chemical Infuser
This commit is contained in:
1 parent
2876eb535d
commit
7ac7fbc5cc
2 files changed
+79
-4
No files matched your search
@@ -1140,11 +1140,11 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
||||
|
||||
if(tileEntity instanceof TileEntityChemicalOxidizer)
|
||||
{
|
||||
TileEntityChemicalOxidizer formulator = (TileEntityChemicalOxidizer)tileEntity;
|
||||
TileEntityChemicalOxidizer oxidizer = (TileEntityChemicalOxidizer)tileEntity;
|
||||
|
||||
if(formulator.gasTank.getGas() != null)
|
||||
if(oxidizer.gasTank.getGas() != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("gasTank", formulator.gasTank.getGas().write(new NBTTagCompound()));
|
||||
itemStack.stackTagCompound.setTag("gasTank", oxidizer.gasTank.getGas().write(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1164,7 +1164,52 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
||||
|
||||
if(infuser.centerTank.getGas() != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("leftTank", infuser.centerTank.getGas().write(new NBTTagCompound()));
|
||||
itemStack.stackTagCompound.setTag("centerTank", infuser.centerTank.getGas().write(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityChemicalDissolutionChamber)
|
||||
{
|
||||
TileEntityChemicalDissolutionChamber chamber = (TileEntityChemicalDissolutionChamber)tileEntity;
|
||||
|
||||
if(chamber.injectTank.getGas() != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("injectTank", chamber.injectTank.getGas().write(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
if(chamber.outputTank.getGas() != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("outputTank", chamber.outputTank.getGas().write(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityChemicalWasher)
|
||||
{
|
||||
TileEntityChemicalWasher washer = (TileEntityChemicalWasher)tileEntity;
|
||||
|
||||
if(washer.fluidTank.getFluid() != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("fluidTank", washer.fluidTank.getFluid().writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
if(washer.inputTank.getGas() != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("inputTank", washer.inputTank.getGas().write(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
if(washer.outputTank.getGas() != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("outputTank", washer.outputTank.getGas().write(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityChemicalCrystallizer)
|
||||
{
|
||||
TileEntityChemicalCrystallizer crystallizer = (TileEntityChemicalCrystallizer)tileEntity;
|
||||
|
||||
if(crystallizer.inputTank.getGas() != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("inputTank", crystallizer.inputTank.getGas().write(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,11 @@ import mekanism.common.miner.MinerFilter;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestMessage;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestPacketType;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
import mekanism.common.tile.TileEntityChemicalCrystallizer;
|
||||
import mekanism.common.tile.TileEntityChemicalDissolutionChamber;
|
||||
import mekanism.common.tile.TileEntityChemicalInfuser;
|
||||
import mekanism.common.tile.TileEntityChemicalOxidizer;
|
||||
import mekanism.common.tile.TileEntityChemicalWasher;
|
||||
import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.tile.TileEntityElectricBlock;
|
||||
import mekanism.common.tile.TileEntityElectricChest;
|
||||
@@ -381,6 +384,33 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityChemicalDissolutionChamber)
|
||||
{
|
||||
if(stack.stackTagCompound != null)
|
||||
{
|
||||
((TileEntityChemicalDissolutionChamber)tileEntity).injectTank.setGas(GasStack.readFromNBT(stack.stackTagCompound.getCompoundTag("injectTank")));
|
||||
((TileEntityChemicalDissolutionChamber)tileEntity).outputTank.setGas(GasStack.readFromNBT(stack.stackTagCompound.getCompoundTag("outputTank")));
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityChemicalWasher)
|
||||
{
|
||||
if(stack.stackTagCompound != null)
|
||||
{
|
||||
((TileEntityChemicalWasher)tileEntity).fluidTank.setFluid(FluidStack.loadFluidStackFromNBT(stack.stackTagCompound.getCompoundTag("fluidTank")));
|
||||
((TileEntityChemicalWasher)tileEntity).inputTank.setGas(GasStack.readFromNBT(stack.stackTagCompound.getCompoundTag("inputTank")));
|
||||
((TileEntityChemicalWasher)tileEntity).outputTank.setGas(GasStack.readFromNBT(stack.stackTagCompound.getCompoundTag("outputTank")));
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityChemicalCrystallizer)
|
||||
{
|
||||
if(stack.stackTagCompound != null)
|
||||
{
|
||||
((TileEntityChemicalCrystallizer)tileEntity).inputTank.setGas(GasStack.readFromNBT(stack.stackTagCompound.getCompoundTag("inputTank")));
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityElectrolyticSeparator)
|
||||
{
|
||||
if(stack.stackTagCompound != null)
|
||||
|
||||
Reference in new issue
Block a user