API Sync, save drive and chests when modifications are made.

This commit is contained in:
AlgorithmX2
2014-07-28 00:11:34 -05:00
parent 4790ab51e0
commit ea5f49b80b
16 changed files with 68 additions and 32 deletions
+9 -2
View File
@@ -22,6 +22,7 @@ import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.MachineSource;
import appeng.api.networking.storage.IStorageGrid;
import appeng.api.storage.ICellHandler;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
@@ -218,7 +219,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
if ( handlersBySlot[x] != null )
{
IMEInventoryHandler cell = handlersBySlot[x].getCellInventory( is, StorageChannel.ITEMS );
IMEInventoryHandler cell = handlersBySlot[x].getCellInventory( is, this, StorageChannel.ITEMS );
if ( cell != null )
{
@@ -231,7 +232,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
}
else
{
cell = handlersBySlot[x].getCellInventory( is, StorageChannel.FLUIDS );
cell = handlersBySlot[x].getCellInventory( is, this, StorageChannel.FLUIDS );
if ( cell != null )
{
@@ -359,4 +360,10 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
{
return itemstack != null && AEApi.instance().registries().cell().isCellHandled( itemstack );
}
@Override
public void saveChanges(IMEInventory cellInventory)
{
worldObj.markTileEntityChunkModified( this.xCoord, this.yCoord, this.zCoord, this );
}
}