Small code quality changes

This commit is contained in:
MattBDev
2020-03-24 12:15:24 -04:00
parent 1577ef61d4
commit e648b35b95
13 changed files with 36 additions and 397 deletions

View File

@ -63,9 +63,6 @@ public interface IChunk extends Trimable, IChunkGet, IChunkSet {
// */
// void flood(Flood flood, FilterBlockMask mask, ChunkFilterBlock block);
@Override
CompoundTag getTile(int x, int y, int z);
@Override
default IChunk reset() {
return this;

View File

@ -26,23 +26,11 @@ public interface IChunkGet extends IBlocks, Trimable, InputExtent, ITileInput {
@Override
BlockState getBlock(int x, int y, int z);
@Override
Map<BlockVector3, CompoundTag> getTiles();
@Override
Set<CompoundTag> getEntities();
@Override
boolean trim(boolean aggressive);
default void optimize() {
}
<T extends Future<T>> T call(IChunkSet set, Runnable finalize);
@Override
char[] load(int layer);
CompoundTag getEntity(UUID uuid);
}

View File

@ -42,15 +42,6 @@ public interface IChunkSet extends IBlocks, OutputExtent {
return getBiomes() != null;
}
@Override
BiomeType getBiomeType(int x, int y, int z);
@Override
Map<BlockVector3, CompoundTag> getTiles();
@Override
Set<CompoundTag> getEntities();
@Override
IChunkSet reset();

View File

@ -41,11 +41,11 @@ public abstract class QueueHandler implements Trimable, Runnable {
private ForkJoinPool forkJoinPoolPrimary = new ForkJoinPool();
private ForkJoinPool forkJoinPoolSecondary = new ForkJoinPool();
private ThreadPoolExecutor blockingExecutor = FaweCache.IMP.newBlockingExecutor();
private ConcurrentLinkedQueue<FutureTask> syncTasks = new ConcurrentLinkedQueue<>();
private ConcurrentLinkedQueue<FutureTask> syncWhenFree = new ConcurrentLinkedQueue<>();
private final ConcurrentLinkedQueue<FutureTask> syncTasks = new ConcurrentLinkedQueue<>();
private final ConcurrentLinkedQueue<FutureTask> syncWhenFree = new ConcurrentLinkedQueue<>();
private Map<World, WeakReference<IChunkCache<IChunkGet>>> chunkGetCache = new HashMap<>();
private CleanableThreadLocal<IQueueExtent<IQueueChunk>> queuePool = new CleanableThreadLocal<>(QueueHandler.this::create);
private final Map<World, WeakReference<IChunkCache<IChunkGet>>> chunkGetCache = new HashMap<>();
private final CleanableThreadLocal<IQueueExtent<IQueueChunk>> queuePool = new CleanableThreadLocal<>(QueueHandler.this::create);
/**
* Used to calculate elapsed time in milliseconds and ensure block placement doesn't lag the
* server