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
+8 -2
View File
@@ -55,6 +55,12 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
mySrc = fluids.changeSource = items.changeSource = new MachineSource( iHost ); mySrc = fluids.changeSource = items.changeSource = new MachineSource( iHost );
} }
@Override
public void saveChanges()
{
iHost.saveChanges();
}
private void readConfig() private void readConfig()
{ {
boolean hadConfig = hasConfig; boolean hadConfig = hasConfig;
@@ -354,8 +360,8 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
public boolean hasWorkToDo() public boolean hasWorkToDo()
{ {
return requireWork[0] != null || requireWork[1] != null || requireWork[2] != null || requireWork[3] != null || requireWork[4] != null return requireWork[0] != null || requireWork[1] != null || requireWork[2] != null || requireWork[3] != null || requireWork[4] != null || requireWork[5] != null
|| requireWork[5] != null || requireWork[6] != null || requireWork[7] != null; || requireWork[6] != null || requireWork[7] != null;
} }
private boolean updateStorage() private boolean updateStorage()
+2
View File
@@ -9,4 +9,6 @@ public interface IInterfaceHost extends IActionHost
DualityInterface getInterfaceDuality(); DualityInterface getInterfaceDuality();
TileEntity getTileEntity(); TileEntity getTileEntity();
void saveChanges();
} }
+4
View File
@@ -320,4 +320,8 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea
return what == BusSupport.CABLE; return what == BusSupport.CABLE;
} }
public void saveChanges()
{
host.markForSave();
}
} }
+6
View File
@@ -172,4 +172,10 @@ public class UpgradeInventory extends AppEngInternalInventory implements IAEAppE
parent.onChangeInventory( inv, slot, mc, removedStack, newStack ); parent.onChangeInventory( inv, slot, mc, removedStack, newStack );
} }
@Override
public void saveChanges()
{
parent.saveChanges();
}
} }
+6
View File
@@ -340,4 +340,10 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile
worldObj.destroyBlock( xCoord, yCoord, zCoord, true ); worldObj.destroyBlock( xCoord, yCoord, zCoord, true );
dropItems = false; dropItems = false;
} }
public void saveChanges()
{
super.onInventoryChanged();
}
} }
@@ -78,6 +78,7 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
te.onChangeInventory( this, slot, InvOperation.decrStackSize, ns, null ); te.onChangeInventory( this, slot, InvOperation.decrStackSize, ns, null );
} }
onInventoryChanged();
return ns; return ns;
} }
@@ -122,6 +123,8 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
} }
te.onChangeInventory( this, slot, InvOperation.setInventorySlotContents, removed, added ); te.onChangeInventory( this, slot, InvOperation.setInventorySlotContents, removed, added );
onInventoryChanged();
} }
} }
+2
View File
@@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack;
public interface IAEAppEngInventory public interface IAEAppEngInventory
{ {
void saveChanges();
void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack); void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack);
} }