fix: fallback to area QueueCoordinator if null passed

This commit is contained in:
Pierre Maurice Schwang 2024-01-20 20:34:55 +01:00
parent a1d94af242
commit 746bf93813
No known key found for this signature in database
GPG Key ID: 37E613079F3E5BB9

View File

@ -38,6 +38,7 @@ import com.sk89q.worldedit.world.biome.BiomeType;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Objects;
import java.util.Set;
public class FaweRegionManager extends BukkitRegionManager {
@ -59,7 +60,10 @@ public class FaweRegionManager extends BukkitRegionManager {
@Nullable PlotPlayer<?> actor,
@Nullable QueueCoordinator queue
) {
return delegate.setCuboids(area, regions, blocks, minY, maxY, queue.getCompleteTask());
return delegate.setCuboids(
area, regions, blocks, minY, maxY,
Objects.requireNonNullElseGet(queue, area::getQueue).getCompleteTask()
);
}
@Override