mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
fix: always set createCopy status on chunk get as chunks are cached (#2567)
- fixes #2539
This commit is contained in:
parent
9ffe76dce3
commit
033b8e35d2
@ -148,6 +148,7 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
||||||
}
|
}
|
||||||
this.createCopy = createCopy;
|
this.createCopy = createCopy;
|
||||||
|
// Increment regardless of whether copy will be created or not to return null from getCopy()
|
||||||
return ++this.copyKey;
|
return ++this.copyKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,6 +153,7 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
||||||
}
|
}
|
||||||
this.createCopy = createCopy;
|
this.createCopy = createCopy;
|
||||||
|
// Increment regardless of whether copy will be created or not to return null from getCopy()
|
||||||
return ++this.copyKey;
|
return ++this.copyKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +156,7 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
||||||
}
|
}
|
||||||
this.createCopy = createCopy;
|
this.createCopy = createCopy;
|
||||||
|
// Increment regardless of whether copy will be created or not to return null from getCopy()
|
||||||
return ++this.copyKey;
|
return ++this.copyKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +156,7 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
||||||
}
|
}
|
||||||
this.createCopy = createCopy;
|
this.createCopy = createCopy;
|
||||||
|
// Increment regardless of whether copy will be created or not to return null from getCopy()
|
||||||
return ++this.copyKey;
|
return ++this.copyKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,7 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
||||||
}
|
}
|
||||||
this.createCopy = createCopy;
|
this.createCopy = createCopy;
|
||||||
|
// Increment regardless of whether copy will be created or not to return null from getCopy()
|
||||||
return ++this.copyKey;
|
return ++this.copyKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,7 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
throw new IllegalStateException("Attempting to set if chunk GET should create copy, but it is not call-locked.");
|
||||||
}
|
}
|
||||||
this.createCopy = createCopy;
|
this.createCopy = createCopy;
|
||||||
|
// Increment regardless of whether copy will be created or not to return null from getCopy()
|
||||||
return ++this.copyKey;
|
return ++this.copyKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1031,10 +1031,10 @@ public class ChunkHolder<T extends Future<T>> implements IQueueChunk<T> {
|
|||||||
try {
|
try {
|
||||||
get.lockCall();
|
get.lockCall();
|
||||||
boolean postProcess = !(getExtent().getPostProcessor() instanceof EmptyBatchProcessor);
|
boolean postProcess = !(getExtent().getPostProcessor() instanceof EmptyBatchProcessor);
|
||||||
|
final int copyKey = get.setCreateCopy(postProcess);
|
||||||
final IChunkSet iChunkSet = getExtent().processSet(this, get, set);
|
final IChunkSet iChunkSet = getExtent().processSet(this, get, set);
|
||||||
Runnable finalizer;
|
Runnable finalizer;
|
||||||
if (postProcess) {
|
if (postProcess) {
|
||||||
int copyKey = get.setCreateCopy(true);
|
|
||||||
finalizer = () -> {
|
finalizer = () -> {
|
||||||
getExtent().postProcess(this, get.getCopy(copyKey), iChunkSet);
|
getExtent().postProcess(this, get.getCopy(copyKey), iChunkSet);
|
||||||
finalize.run();
|
finalize.run();
|
||||||
|
Loading…
Reference in New Issue
Block a user