renamed the block batch pool field

This commit is contained in:
themode 2020-10-03 22:07:21 +02:00
parent db90b5e22d
commit 39a9e5531d
3 changed files with 5 additions and 5 deletions

View File

@ -65,7 +65,7 @@ public class BlockBatch implements InstanceBatch {
for (Map.Entry<Chunk, List<BlockData>> entry : data.entrySet()) {
final Chunk chunk = entry.getKey();
final List<BlockData> dataList = entry.getValue();
batchesPool.execute(() -> {
BLOCK_BATCH_POOL.execute(() -> {
synchronized (chunk) {
if (!chunk.isLoaded())
return;

View File

@ -61,7 +61,7 @@ public class ChunkBatch implements InstanceBatch {
}
public void flushChunkGenerator(ChunkGenerator chunkGenerator, ChunkCallback callback) {
batchesPool.execute(() -> {
BLOCK_BATCH_POOL.execute(() -> {
final List<ChunkPopulator> populators = chunkGenerator.getPopulators();
final boolean hasPopulator = populators != null && !populators.isEmpty();
@ -88,7 +88,7 @@ public class ChunkBatch implements InstanceBatch {
* @param callback the callback to execute once the blocks are placed
*/
public void flush(ChunkCallback callback) {
batchesPool.execute(() -> singleThreadFlush(callback, true));
BLOCK_BATCH_POOL.execute(() -> singleThreadFlush(callback, true));
}
/**
@ -97,7 +97,7 @@ public class ChunkBatch implements InstanceBatch {
* @param callback the callback to execute once the blocks are placed
*/
public void unsafeFlush(ChunkCallback callback) {
batchesPool.execute(() -> singleThreadFlush(callback, false));
BLOCK_BATCH_POOL.execute(() -> singleThreadFlush(callback, false));
}
public void clearData() {

View File

@ -8,6 +8,6 @@ import java.util.concurrent.ExecutorService;
public interface InstanceBatch extends BlockModifier {
ExecutorService batchesPool = new MinestomThread(MinecraftServer.THREAD_COUNT_BLOCK_BATCH, MinecraftServer.THREAD_NAME_BLOCK_BATCH);
ExecutorService BLOCK_BATCH_POOL = new MinestomThread(MinecraftServer.THREAD_COUNT_BLOCK_BATCH, MinecraftServer.THREAD_NAME_BLOCK_BATCH);
}