Syncronized Update non-cached state fixed
This commit is contained in:
parent
65a50d30c0
commit
9eba342758
2 changed files with 6 additions and 12 deletions
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<groupId>de.jaschastarke</groupId>
|
||||
<artifactId>LimitedCreative</artifactId>
|
||||
<name>LimitedCreative</name>
|
||||
<version>2.1</version>
|
||||
<version>2.1.1-SNAPSHOT</version>
|
||||
<url>https://github.com/possi/LimitedCreative</url>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -135,21 +135,15 @@ public class SyncronizedModel extends AbstractModel implements DBModel {
|
|||
}
|
||||
public void setState(BlockState state) {
|
||||
Block block = state.getLocation().getBlock();
|
||||
boolean update = hasMetaBlock(block);
|
||||
boolean store = state.isRestricted() || mod.getConfig().getLogSurvival();
|
||||
boolean store = state != null && (state.isRestricted() || mod.getConfig().getLogSurvival());
|
||||
|
||||
setMetaBlock(block, store ? state : null);
|
||||
|
||||
try {
|
||||
if (update) {
|
||||
if (!store)
|
||||
q.delete(state);
|
||||
else if (!q.update(state))
|
||||
q.insert(state);
|
||||
} else {
|
||||
if (store)
|
||||
q.insert(state);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
mod.getLog().severe(e.getMessage());
|
||||
mod.getLog().warn("Failed to update BlockState in DB at " + block.getLocation().toString());
|
||||
|
|
Loading…
Reference in a new issue