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
@@ -14,12 +14,12 @@ import mekanism.common.IFactory.RecipeType;
|
||||
import mekanism.common.IInvConfiguration;
|
||||
import mekanism.common.IRedstoneControl;
|
||||
import mekanism.common.ISpecialBounds;
|
||||
import mekanism.common.ISustainedData;
|
||||
import mekanism.common.ISustainedInventory;
|
||||
import mekanism.common.ISustainedTank;
|
||||
import mekanism.common.IUpgradeManagement;
|
||||
import mekanism.common.ItemAttacher;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.miner.MinerFilter;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestMessage;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestPacketType;
|
||||
import mekanism.common.network.PacketLogisticalSorterGui.LogisticalSorterGuiMessage;
|
||||
@@ -1023,66 +1023,10 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
||||
itemStack.stackTagCompound.setByte("config"+i, config.getConfiguration()[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityDigitalMiner)
|
||||
|
||||
if(tileEntity instanceof ISustainedData)
|
||||
{
|
||||
TileEntityDigitalMiner miner = (TileEntityDigitalMiner)tileEntity;
|
||||
|
||||
itemStack.stackTagCompound.setBoolean("hasMinerConfig", true);
|
||||
|
||||
itemStack.stackTagCompound.setInteger("radius", miner.radius);
|
||||
itemStack.stackTagCompound.setInteger("minY", miner.minY);
|
||||
itemStack.stackTagCompound.setInteger("maxY", miner.maxY);
|
||||
itemStack.stackTagCompound.setBoolean("doEject", miner.doEject);
|
||||
itemStack.stackTagCompound.setBoolean("doPull", miner.doPull);
|
||||
itemStack.stackTagCompound.setBoolean("silkTouch", miner.silkTouch);
|
||||
itemStack.stackTagCompound.setBoolean("inverse", miner.inverse);
|
||||
|
||||
if(miner.replaceStack != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("replaceStack", miner.replaceStack.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
NBTTagList filterTags = new NBTTagList();
|
||||
|
||||
for(MinerFilter filter : miner.filters)
|
||||
{
|
||||
filterTags.appendTag(filter.write(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
if(filterTags.tagCount() != 0)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("filters", filterTags);
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityLogisticalSorter)
|
||||
{
|
||||
TileEntityLogisticalSorter sorter = (TileEntityLogisticalSorter)tileEntity;
|
||||
|
||||
itemStack.stackTagCompound.setBoolean("hasSorterConfig", true);
|
||||
|
||||
if(sorter.color != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setInteger("color", TransporterUtils.colors.indexOf(sorter.color));
|
||||
}
|
||||
|
||||
itemStack.stackTagCompound.setBoolean("autoEject", sorter.autoEject);
|
||||
itemStack.stackTagCompound.setBoolean("roundRobin", sorter.roundRobin);
|
||||
|
||||
NBTTagList filterTags = new NBTTagList();
|
||||
|
||||
for(TransporterFilter filter : sorter.filters)
|
||||
{
|
||||
NBTTagCompound tagCompound = new NBTTagCompound();
|
||||
filter.write(tagCompound);
|
||||
filterTags.appendTag(tagCompound);
|
||||
}
|
||||
|
||||
if(filterTags.tagCount() != 0)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("filters", filterTags);
|
||||
}
|
||||
((ISustainedData)tileEntity).writeSustainedData(itemStack);
|
||||
}
|
||||
|
||||
if(tileEntity instanceof IRedstoneControl)
|
||||
@@ -1128,16 +1072,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
||||
factoryItem.setRecipeType(((TileEntityFactory)tileEntity).recipeType, itemStack);
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityRotaryCondensentrator)
|
||||
{
|
||||
TileEntityRotaryCondensentrator condensentrator = (TileEntityRotaryCondensentrator)tileEntity;
|
||||
|
||||
if(condensentrator.gasTank.getGas() != null)
|
||||
{
|
||||
itemStack.stackTagCompound.setTag("gasStack", condensentrator.gasTank.getGas().write(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityChemicalOxidizer)
|
||||
{
|
||||
TileEntityChemicalOxidizer oxidizer = (TileEntityChemicalOxidizer)tileEntity;
|
||||
|
||||
Reference in new issue
Block a user