Tile Saving

This commit is contained in:
AlgorithmX2 2014-01-30 18:50:11 -06:00
parent 08e232ec63
commit ac365b28c6
7 changed files with 31 additions and 2 deletions

View file

@ -55,6 +55,12 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
mySrc = fluids.changeSource = items.changeSource = new MachineSource( iHost );
}
@Override
public void saveChanges()
{
iHost.saveChanges();
}
private void readConfig()
{
boolean hadConfig = hasConfig;
@ -354,8 +360,8 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
public boolean hasWorkToDo()
{
return requireWork[0] != null || requireWork[1] != null || requireWork[2] != null || requireWork[3] != null || requireWork[4] != null
|| requireWork[5] != null || requireWork[6] != null || requireWork[7] != null;
return requireWork[0] != null || requireWork[1] != null || requireWork[2] != null || requireWork[3] != null || requireWork[4] != null || requireWork[5] != null
|| requireWork[6] != null || requireWork[7] != null;
}
private boolean updateStorage()

View file

@ -9,4 +9,6 @@ public interface IInterfaceHost extends IActionHost
DualityInterface getInterfaceDuality();
TileEntity getTileEntity();
void saveChanges();
}

View file

@ -320,4 +320,8 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
return what == BusSupport.CABLE;
}
public void saveChanges()
{
host.markForSave();
}
}

View file

@ -172,4 +172,10 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
parent.onChangeInventory( inv, slot, mc, removedStack, newStack );
}
@Override
public void saveChanges()
{
parent.saveChanges();
}
}

View file

@ -340,4 +340,10 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile
worldObj.destroyBlock( xCoord, yCoord, zCoord, true );
dropItems = false;
}
public void saveChanges()
{
super.onInventoryChanged();
}
}

View file

@ -78,6 +78,7 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
te.onChangeInventory( this, slot, InvOperation.decrStackSize, ns, null );
}
onInventoryChanged();
return ns;
}
@ -122,6 +123,8 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
}
te.onChangeInventory( this, slot, InvOperation.setInventorySlotContents, removed, added );
onInventoryChanged();
}
}

View file

@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack;
public interface IAEAppEngInventory
{
void saveChanges();
void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack);
}