mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-19 19:49:50 +00:00
Started work on a new system of managing sustained data
This commit is contained in:
1 parent
7ac7fbc5cc
commit
94c3a6aa60
6 files changed
+155
-153
No files matched your search
@@ -18,6 +18,7 @@ import mekanism.common.IFactory;
|
||||
import mekanism.common.IInvConfiguration;
|
||||
import mekanism.common.IRedstoneControl;
|
||||
import mekanism.common.IRedstoneControl.RedstoneControl;
|
||||
import mekanism.common.ISustainedData;
|
||||
import mekanism.common.ISustainedInventory;
|
||||
import mekanism.common.ISustainedTank;
|
||||
import mekanism.common.IUpgradeManagement;
|
||||
@@ -25,7 +26,6 @@ import mekanism.common.Mekanism;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.integration.IC2ItemManager;
|
||||
import mekanism.common.inventory.InventoryElectricChest;
|
||||
import mekanism.common.miner.MinerFilter;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestMessage;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestPacketType;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
@@ -34,7 +34,6 @@ 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;
|
||||
import mekanism.common.tile.TileEntityElectrolyticSeparator;
|
||||
@@ -270,61 +269,12 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityDigitalMiner)
|
||||
|
||||
if(tileEntity instanceof ISustainedData)
|
||||
{
|
||||
TileEntityDigitalMiner miner = (TileEntityDigitalMiner)tileEntity;
|
||||
|
||||
if(stack.stackTagCompound != null && stack.stackTagCompound.hasKey("hasMinerConfig"))
|
||||
if(stack.stackTagCompound != null)
|
||||
{
|
||||
miner.radius = stack.stackTagCompound.getInteger("radius");
|
||||
miner.minY = stack.stackTagCompound.getInteger("minY");
|
||||
miner.maxY = stack.stackTagCompound.getInteger("maxY");
|
||||
miner.doEject = stack.stackTagCompound.getBoolean("doEject");
|
||||
miner.doPull = stack.stackTagCompound.getBoolean("doPull");
|
||||
miner.silkTouch = stack.stackTagCompound.getBoolean("silkTouch");
|
||||
miner.inverse = stack.stackTagCompound.getBoolean("inverse");
|
||||
|
||||
if(stack.stackTagCompound.hasKey("replaceStack"))
|
||||
{
|
||||
miner.replaceStack = ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("replaceStack"));
|
||||
}
|
||||
|
||||
if(stack.stackTagCompound.hasKey("filters"))
|
||||
{
|
||||
NBTTagList tagList = stack.stackTagCompound.getTagList("filters", NBT.TAG_COMPOUND);
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
miner.filters.add(MinerFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityLogisticalSorter)
|
||||
{
|
||||
TileEntityLogisticalSorter sorter = (TileEntityLogisticalSorter)tileEntity;
|
||||
|
||||
if(stack.stackTagCompound != null && stack.stackTagCompound.hasKey("hasSorterConfig"))
|
||||
{
|
||||
if(stack.stackTagCompound.hasKey("color"))
|
||||
{
|
||||
sorter.color = TransporterUtils.colors.get(stack.stackTagCompound.getInteger("color"));
|
||||
}
|
||||
|
||||
sorter.autoEject = stack.stackTagCompound.getBoolean("autoEject");
|
||||
sorter.roundRobin = stack.stackTagCompound.getBoolean("roundRobin");
|
||||
|
||||
if(stack.stackTagCompound.hasKey("filters"))
|
||||
{
|
||||
NBTTagList tagList = stack.stackTagCompound.getTagList("filters", NBT.TAG_COMPOUND);
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
sorter.filters.add(TransporterFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
((ISustainedData)tileEntity).readSustainedData(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,15 +307,6 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
((TileEntityElectricChest)tileEntity).password = getPassword(stack);
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityRotaryCondensentrator)
|
||||
{
|
||||
if(stack.stackTagCompound != null && stack.stackTagCompound.hasKey("gasStack"))
|
||||
{
|
||||
GasStack gasStack = GasStack.readFromNBT(stack.stackTagCompound.getCompoundTag("gasStack"));
|
||||
((TileEntityRotaryCondensentrator)tileEntity).gasTank.setGas(gasStack);
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityChemicalOxidizer)
|
||||
{
|
||||
if(stack.stackTagCompound != null)
|
||||
@@ -878,8 +819,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
|
||||
MachineType type = MachineType.get((ItemStack)data[0]);
|
||||
|
||||
return type == MachineType.ELECTRIC_PUMP || type == MachineType.ROTARY_CONDENSENTRATOR
|
||||
|| type == MachineType.PORTABLE_TANK || type == MachineType.FLUIDIC_PLENISHER;
|
||||
return type == MachineType.ELECTRIC_PUMP || type == MachineType.PORTABLE_TANK || type == MachineType.FLUIDIC_PLENISHER;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user