Don't resave cells on stopping creation, fixes #74

We was saving everything again when the players stop creating anything,
this was causing issues with duplicate cells when using any storage with
SQL (due to insert and no primary key).

Also, added a hasChanged to the cell class which will prevent resaving
things in sql if it hasn't changed.
This commit is contained in:
graywolf336
2015-05-26 14:57:38 -05:00
parent fd52be6972
commit 12f35a01bf
7 changed files with 75 additions and 12 deletions

View File

@@ -68,4 +68,15 @@ public interface ICell {
* @return true if there is a chest, false if there isn't.
*/
public boolean hasChest();
/**
* Sets whether this cell has been changed or not.
*
* @param changed true if we've changed it, mostly use if you want to force an update
* @return the resulting change, whether it is changed or not
*/
public boolean setChanged(boolean changed);
/** Gets whether the Cell has changed from the last save or not. */
public boolean hasChanged();
}