2021-07-23 15:48:51 +00:00
|
|
|
package com.fastasyncworldedit.core.extent.processor;
|
2020-09-17 20:31:55 +00:00
|
|
|
|
2021-07-23 15:48:51 +00:00
|
|
|
import com.fastasyncworldedit.core.queue.IBatchProcessor;
|
|
|
|
import com.fastasyncworldedit.core.queue.IChunk;
|
|
|
|
import com.fastasyncworldedit.core.queue.IChunkGet;
|
|
|
|
import com.fastasyncworldedit.core.queue.IChunkSet;
|
2020-09-17 20:31:55 +00:00
|
|
|
import com.sk89q.worldedit.extent.Extent;
|
|
|
|
|
2021-07-24 13:52:08 +00:00
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
import javax.annotation.Nullable;
|
2020-09-17 20:31:55 +00:00
|
|
|
|
2020-09-28 10:13:02 +00:00
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
import java.util.concurrent.Future;
|
|
|
|
|
2020-09-17 20:31:55 +00:00
|
|
|
public final class EmptyBatchProcessor implements IBatchProcessor {
|
|
|
|
private static final EmptyBatchProcessor instance = new EmptyBatchProcessor();
|
|
|
|
|
|
|
|
public static EmptyBatchProcessor getInstance() {
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
2021-07-24 13:52:08 +00:00
|
|
|
@Nonnull
|
2020-09-17 20:31:55 +00:00
|
|
|
public Extent construct(@Nullable Extent child) {
|
|
|
|
return child;
|
|
|
|
}
|
|
|
|
|
2021-07-24 13:52:08 +00:00
|
|
|
@Nonnull
|
2020-09-17 20:31:55 +00:00
|
|
|
public IChunkSet processSet(@Nullable IChunk chunk, @Nullable IChunkGet get, @Nullable IChunkSet set) {
|
|
|
|
return set;
|
|
|
|
}
|
|
|
|
|
2020-09-28 10:13:02 +00:00
|
|
|
@Override
|
2021-07-24 13:52:08 +00:00
|
|
|
@Nonnull
|
2020-09-28 10:13:02 +00:00
|
|
|
public Future<IChunkSet> postProcessSet(@Nullable IChunk chunk, @Nullable IChunkGet get, @Nullable IChunkSet set) {
|
|
|
|
// Doesn't need to do anything
|
|
|
|
return CompletableFuture.completedFuture(set);
|
|
|
|
}
|
|
|
|
|
2021-07-24 13:52:08 +00:00
|
|
|
@Nonnull
|
2020-09-17 20:31:55 +00:00
|
|
|
public IBatchProcessor join(@Nullable IBatchProcessor other) {
|
|
|
|
return other;
|
|
|
|
}
|
|
|
|
|
2021-07-24 13:52:08 +00:00
|
|
|
@Nonnull
|
2020-09-28 10:13:02 +00:00
|
|
|
public IBatchProcessor joinPost(@Nullable IBatchProcessor other) {
|
|
|
|
return other;
|
|
|
|
}
|
|
|
|
|
2020-09-17 20:31:55 +00:00
|
|
|
private EmptyBatchProcessor() {
|
|
|
|
}
|
|
|
|
|
2021-01-11 19:29:16 +00:00
|
|
|
@Override
|
|
|
|
public ProcessorScope getScope() {
|
|
|
|
return ProcessorScope.ADDING_BLOCKS;
|
|
|
|
}
|
|
|
|
|
2020-09-17 20:31:55 +00:00
|
|
|
}
|