mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Manually fix some merge conflicts
This commit is contained in:
@ -43,15 +43,6 @@ import com.plotsquared.bukkit.listener.WorldEvents;
|
||||
import com.plotsquared.bukkit.placeholder.PlaceholderFormatter;
|
||||
import com.plotsquared.bukkit.placeholder.Placeholders;
|
||||
import com.plotsquared.bukkit.player.BukkitPlayerManager;
|
||||
import com.plotsquared.bukkit.queue.BukkitLocalQueue;
|
||||
import com.plotsquared.bukkit.schematic.BukkitSchematicHandler;
|
||||
import com.plotsquared.bukkit.util.BukkitChunkManager;
|
||||
import com.plotsquared.bukkit.util.BukkitEconHandler;
|
||||
import com.plotsquared.bukkit.util.BukkitInventoryUtil;
|
||||
import com.plotsquared.bukkit.util.BukkitPermHandler;
|
||||
import com.plotsquared.bukkit.util.BukkitRegionManager;
|
||||
import com.plotsquared.bukkit.util.BukkitSetupUtils;
|
||||
import com.plotsquared.bukkit.util.BukkitChatManager;
|
||||
import com.plotsquared.bukkit.util.BukkitTaskManager;
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.bukkit.util.BukkitWorld;
|
||||
@ -94,15 +85,12 @@ import com.plotsquared.core.plot.PlotAreaTerrainType;
|
||||
import com.plotsquared.core.plot.PlotAreaType;
|
||||
import com.plotsquared.core.plot.PlotId;
|
||||
import com.plotsquared.core.plot.comment.CommentManager;
|
||||
import com.plotsquared.core.plot.message.PlainChatManager;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import com.plotsquared.core.plot.world.SinglePlotArea;
|
||||
import com.plotsquared.core.plot.world.SinglePlotAreaManager;
|
||||
import com.plotsquared.core.queue.GlobalBlockQueue;
|
||||
import com.plotsquared.core.setup.PlotAreaBuilder;
|
||||
import com.plotsquared.core.setup.SettingsNodesWrapper;
|
||||
import com.plotsquared.core.util.ChunkManager;
|
||||
import com.plotsquared.core.util.ChatManager;
|
||||
import com.plotsquared.core.util.ConsoleColors;
|
||||
import com.plotsquared.core.util.EconHandler;
|
||||
import com.plotsquared.core.util.EventDispatcher;
|
||||
@ -120,7 +108,6 @@ import com.plotsquared.core.uuid.offline.OfflineModeUUIDService;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import io.papermc.lib.PaperLib;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -285,9 +272,6 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||
|
||||
plotSquared.startExpiryTasks();
|
||||
|
||||
// This is getting removed so I won't even bother migrating it
|
||||
ChatManager.manager = this.initChatManager();
|
||||
|
||||
// Do stuff that was previously done in PlotSquared
|
||||
// Kill entities
|
||||
if (Settings.Enabled_Components.KILL_ROAD_MOBS
|
||||
@ -1135,7 +1119,7 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||
return BukkitWorld.of(worldName);
|
||||
}
|
||||
|
||||
@Override @NotNull public Audience getConsoleAudience() {
|
||||
@Override @Nonnull public Audience getConsoleAudience() {
|
||||
return BukkitUtil.BUKKIT_AUDIENCES.audience(Bukkit.getConsoleSender());
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override public boolean hasPermission(@NotNull final String permission) {
|
||||
@Override public boolean hasPermission(@Nonnull final String permission) {
|
||||
if (this.offline && this.econHandler != null) {
|
||||
return this.econHandler.hasPermission(getName(), permission);
|
||||
}
|
||||
@ -228,7 +228,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
||||
return max;
|
||||
}
|
||||
|
||||
@Override public boolean isPermissionSet(@NotNull final String permission) {
|
||||
@Override public boolean isPermissionSet(@Nonnull final String permission) {
|
||||
return this.player.isPermissionSet(permission);
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
||||
return this.player.isBanned();
|
||||
}
|
||||
|
||||
@Override @NotNull public Audience getAudience() {
|
||||
@Override @Nonnull public Audience getAudience() {
|
||||
return BukkitUtil.BUKKIT_AUDIENCES.player(this.player);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
package com.plotsquared.bukkit.queue;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.plotsquared.bukkit.BukkitMain;
|
||||
import com.plotsquared.bukkit.BukkitPlatform;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import io.papermc.lib.PaperLib;
|
||||
import org.bukkit.Chunk;
|
||||
@ -34,8 +34,8 @@ import org.bukkit.World;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@ -87,9 +87,9 @@ public final class ChunkCoordinator extends BukkitRunnable {
|
||||
private int batchSize;
|
||||
|
||||
private ChunkCoordinator(final long maxIterationTime, final int initialBatchSize,
|
||||
@NotNull final Consumer<Chunk> chunkConsumer, @NotNull final World world,
|
||||
@NotNull final Collection<BlockVector2> requestedChunks, @NotNull final Runnable whenDone,
|
||||
@NotNull final Consumer<Throwable> throwableConsumer) {
|
||||
@Nonnull final Consumer<Chunk> chunkConsumer, @Nonnull final World world,
|
||||
@Nonnull final Collection<BlockVector2> requestedChunks, @Nonnull final Runnable whenDone,
|
||||
@Nonnull final Consumer<Throwable> throwableConsumer) {
|
||||
this.requestedChunks = new LinkedBlockingQueue<>(requestedChunks);
|
||||
this.availableChunks = new LinkedBlockingQueue<>();
|
||||
this.totalSize = requestedChunks.size();
|
||||
@ -100,7 +100,7 @@ public final class ChunkCoordinator extends BukkitRunnable {
|
||||
this.maxIterationTime = maxIterationTime;
|
||||
this.whenDone = whenDone;
|
||||
this.throwableConsumer = throwableConsumer;
|
||||
this.plugin = JavaPlugin.getPlugin(BukkitMain.class);
|
||||
this.plugin = JavaPlugin.getPlugin(BukkitPlatform.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -108,7 +108,7 @@ public final class ChunkCoordinator extends BukkitRunnable {
|
||||
*
|
||||
* @return Coordinator builder instance
|
||||
*/
|
||||
@NotNull public static ChunkCoordinatorBuilder builder() {
|
||||
@Nonnull public static ChunkCoordinatorBuilder builder() {
|
||||
return new ChunkCoordinatorBuilder();
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ public final class ChunkCoordinator extends BukkitRunnable {
|
||||
}
|
||||
}
|
||||
|
||||
private void processChunk(@NotNull final Chunk chunk) {
|
||||
private void processChunk(@Nonnull final Chunk chunk) {
|
||||
if (!chunk.isLoaded()) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Chunk %d;%d is is not loaded", chunk.getX(), chunk.getZ()));
|
||||
@ -195,7 +195,7 @@ public final class ChunkCoordinator extends BukkitRunnable {
|
||||
this.availableChunks.add(chunk);
|
||||
}
|
||||
|
||||
private void freeChunk(@NotNull final Chunk chunk) {
|
||||
private void freeChunk(@Nonnull final Chunk chunk) {
|
||||
if (!chunk.isLoaded()) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Chunk %d;%d is is not loaded", chunk.getX(), chunk.getZ()));
|
||||
@ -226,7 +226,7 @@ public final class ChunkCoordinator extends BukkitRunnable {
|
||||
*
|
||||
* @param subscriber Subscriber
|
||||
*/
|
||||
public void subscribeToProgress(@NotNull final ChunkCoordinator.ProgressSubscriber subscriber) {
|
||||
public void subscribeToProgress(@Nonnull final ChunkCoordinator.ProgressSubscriber subscriber) {
|
||||
this.progressSubscribers.add(subscriber);
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ public final class ChunkCoordinator extends BukkitRunnable {
|
||||
* @param coordinator Coordinator instance that triggered the notification
|
||||
* @param progress Progress in the range [0, 1]
|
||||
*/
|
||||
void notifyProgress(@NotNull final ChunkCoordinator coordinator, final float progress);
|
||||
void notifyProgress(@Nonnull final ChunkCoordinator coordinator, final float progress);
|
||||
|
||||
}
|
||||
|
||||
@ -259,58 +259,58 @@ public final class ChunkCoordinator extends BukkitRunnable {
|
||||
private ChunkCoordinatorBuilder() {
|
||||
}
|
||||
|
||||
@NotNull public ChunkCoordinatorBuilder inWorld(@NotNull final World world) {
|
||||
@Nonnull public ChunkCoordinatorBuilder inWorld(@Nonnull final World world) {
|
||||
this.world = Preconditions.checkNotNull(world, "World may not be null");
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ChunkCoordinatorBuilder withChunk(@NotNull final BlockVector2 chunkLocation) {
|
||||
@Nonnull
|
||||
public ChunkCoordinatorBuilder withChunk(@Nonnull final BlockVector2 chunkLocation) {
|
||||
this.requestedChunks
|
||||
.add(Preconditions.checkNotNull(chunkLocation, "Chunk location may not be null"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull public ChunkCoordinatorBuilder withChunks(
|
||||
@NotNull final Collection<BlockVector2> chunkLocations) {
|
||||
@Nonnull public ChunkCoordinatorBuilder withChunks(
|
||||
@Nonnull final Collection<BlockVector2> chunkLocations) {
|
||||
chunkLocations.forEach(this::withChunk);
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ChunkCoordinatorBuilder withConsumer(@NotNull final Consumer<Chunk> chunkConsumer) {
|
||||
@Nonnull
|
||||
public ChunkCoordinatorBuilder withConsumer(@Nonnull final Consumer<Chunk> chunkConsumer) {
|
||||
this.chunkConsumer =
|
||||
Preconditions.checkNotNull(chunkConsumer, "Chunk consumer may not be null");
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull public ChunkCoordinatorBuilder withFinalAction(@NotNull final Runnable whenDone) {
|
||||
@Nonnull public ChunkCoordinatorBuilder withFinalAction(@Nonnull final Runnable whenDone) {
|
||||
this.whenDone = Preconditions.checkNotNull(whenDone, "Final action may not be null");
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull public ChunkCoordinatorBuilder withMaxIterationTime(final long maxIterationTime) {
|
||||
@Nonnull public ChunkCoordinatorBuilder withMaxIterationTime(final long maxIterationTime) {
|
||||
Preconditions
|
||||
.checkArgument(maxIterationTime > 0, "Max iteration time must be positive");
|
||||
this.maxIterationTime = maxIterationTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull public ChunkCoordinatorBuilder withInitialBatchSize(final int initialBatchSize) {
|
||||
@Nonnull public ChunkCoordinatorBuilder withInitialBatchSize(final int initialBatchSize) {
|
||||
Preconditions
|
||||
.checkArgument(initialBatchSize > 0, "Initial batch size must be positive");
|
||||
this.initialBatchSize = initialBatchSize;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull public ChunkCoordinatorBuilder withThrowableConsumer(
|
||||
@NotNull final Consumer<Throwable> throwableConsumer) {
|
||||
@Nonnull public ChunkCoordinatorBuilder withThrowableConsumer(
|
||||
@Nonnull final Consumer<Throwable> throwableConsumer) {
|
||||
this.throwableConsumer =
|
||||
Preconditions.checkNotNull(throwableConsumer, "Throwable consumer may not be null");
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull public ChunkCoordinator build() {
|
||||
@Nonnull public ChunkCoordinator build() {
|
||||
Preconditions.checkNotNull(this.world, "No world was supplied");
|
||||
Preconditions.checkNotNull(this.chunkConsumer, "No chunk consumer was supplied");
|
||||
Preconditions.checkNotNull(this.whenDone, "No final action was supplied");
|
||||
|
Reference in New Issue
Block a user