extends ILogger {
*
* @return Setup utils
*/
- @NotNull default SetupUtils getSetupUtils() {
+ @Nonnull default SetupUtils getSetupUtils() {
return getInjector().getInstance(SetupUtils.class);
}
/**
* Get the {@link EconHandler} implementation for the platform
- *
+ * *
* @return Econ handler
*/
- @NotNull default EconHandler getEconHandler() {
+ @Nullable default EconHandler getEconHandler() {
return getInjector().getInstance(EconHandler.class);
}
+ /**
+ * Get the {@link RegionManager} implementation for the platform
+ *
+ * @return Region manager
+ */
+ @Nonnull default RegionManager getRegionManager() {
+ return getInjector().getInstance(RegionManager.class);
+ }
+
+ /**
+ * Get the {@link ChunkManager} implementation for the platform
+ *
+ * @return Region manager
+ */
+ @Nonnull default ChunkManager getChunkManager() {
+ return getInjector().getInstance(ChunkManager.class);
+ }
+
}
diff --git a/Core/src/main/java/com/plotsquared/core/PlotSquared.java b/Core/src/main/java/com/plotsquared/core/PlotSquared.java
index 2c9bbdeec..ca899a8ca 100644
--- a/Core/src/main/java/com/plotsquared/core/PlotSquared.java
+++ b/Core/src/main/java/com/plotsquared/core/PlotSquared.java
@@ -26,7 +26,6 @@
package com.plotsquared.core;
import com.plotsquared.core.configuration.Caption;
-import com.plotsquared.core.configuration.CaptionUtility;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.ConfigurationUtil;
@@ -47,7 +46,6 @@ import com.plotsquared.core.generator.IndependentPlotGenerator;
import com.plotsquared.core.inject.factory.HybridPlotWorldFactory;
import com.plotsquared.core.listener.PlotListener;
import com.plotsquared.core.location.Location;
-import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.plot.BlockBucket;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
@@ -56,13 +54,11 @@ import com.plotsquared.core.plot.PlotAreaType;
import com.plotsquared.core.plot.PlotCluster;
import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.plot.PlotManager;
-import com.plotsquared.core.plot.comment.CommentManager;
import com.plotsquared.core.plot.expiration.ExpireManager;
import com.plotsquared.core.plot.expiration.ExpiryTask;
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.util.ChatManager;
import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.LegacyConverter;
import com.plotsquared.core.util.MainUtil;
@@ -77,9 +73,9 @@ import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.math.BlockVector2;
import lombok.Getter;
import lombok.Setter;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nullable;
+import javax.annotation.Nonnull;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
@@ -150,7 +146,6 @@ public class PlotSquared {
// Files and configuration
@Getter private File jarFile = null; // This file
private File storageFile;
- @Getter private PlotAreaManager plotAreaManager;
@Getter private EventDispatcher eventDispatcher;
@Getter private PlotListener plotListener;
@@ -195,6 +190,7 @@ public class PlotSquared {
if (!setupConfigs()) {
return;
}
+
this.translationFile = MainUtil.getFile(this.platform.getDirectory(),
Settings.Paths.TRANSLATIONS + File.separator + this.platform.getPluginName()
+ ".use_THIS.yml");
@@ -207,29 +203,6 @@ public class PlotSquared {
// Create plot listener
this.plotListener = new PlotListener(this.eventDispatcher);
- // Database
- if (Settings.Enabled_Components.DATABASE) {
- setupDatabase();
- }
-
- // Check if we need to convert old flag values, etc
- if (!getConfigurationVersion().equalsIgnoreCase("v5")) {
- // Perform upgrade
- if (DBFunc.dbManager.convertFlags()) {
- log(Captions.PREFIX.getTranslated() + "Flags were converted successfully!");
- // Update the config version
- setConfigurationVersion("v5");
- }
- }
-
- // Comments
- CommentManager.registerDefaultInboxes();
-
- startExpiryTasks();
-
- // This is getting removed so I won't even bother migrating it
- ChatManager.manager = this.platform.initChatManager();
-
// Copy files
copyFile("addplots.js", Settings.Paths.SCRIPTS);
copyFile("addsigns.js", Settings.Paths.SCRIPTS);
@@ -253,10 +226,15 @@ public class PlotSquared {
} catch (Throwable e) {
e.printStackTrace();
}
+ }
- PlotSquared.log(Captions.PREFIX + CaptionUtility
- .format(ConsolePlayer.getConsole(), Captions.ENABLED.getTranslated(),
- this.platform.getPluginName()));
+ /**
+ * Get the platform specific {@link PlotAreaManager} instance
+ *
+ * @return Plot area manager
+ */
+ @Nonnull public PlotAreaManager getPlotAreaManager() {
+ return this.platform.getInjector().getInstance(PlotAreaManager.class);
}
/**
@@ -273,7 +251,7 @@ public class PlotSquared {
*
* @return Platform implementation
*/
- @NotNull public static PlotPlatform> platform() {
+ @Nonnull public static PlotPlatform> platform() {
if (instance != null && instance.platform != null) {
return instance.platform;
}
@@ -315,12 +293,12 @@ public class PlotSquared {
}
}
- private void startExpiryTasks() {
+ public void startExpiryTasks() {
if (Settings.Enabled_Components.PLOT_EXPIRY) {
ExpireManager.IMP = new ExpireManager(this.eventDispatcher);
ExpireManager.IMP.runAutomatedTask();
for (Settings.Auto_Clear settings : Settings.AUTO_CLEAR.getInstances()) {
- ExpiryTask task = new ExpiryTask(settings, this.plotAreaManager);
+ ExpiryTask task = new ExpiryTask(settings, this.getPlotAreaManager());
ExpireManager.IMP.addTask(task);
}
}
@@ -412,7 +390,7 @@ public class PlotSquared {
cluster.setArea(plotArea);
}
}
- plotAreaManager.addPlotArea(plotArea);
+ getPlotAreaManager().addPlotArea(plotArea);
plotArea.setupBorder();
if (!Settings.Enabled_Components.PERSISTENT_ROAD_REGEN) {
return;
@@ -459,11 +437,11 @@ public class PlotSquared {
* @param area the {@code PlotArea} to remove
*/
public void removePlotArea(PlotArea area) {
- plotAreaManager.removePlotArea(area);
+ getPlotAreaManager().removePlotArea(area);
setPlotsTmp(area);
}
- public void removePlotAreas(@NotNull final String world) {
+ public void removePlotAreas(@Nonnull final String world) {
for (final PlotArea area : this.getPlotAreaManager().getPlotAreasSet(world)) {
if (area.getWorldName().equals(world)) {
removePlotArea(area);
@@ -486,7 +464,7 @@ public class PlotSquared {
this.clustersTmp.put(area.toString(), area.getClusters());
}
- public Set getClusters(@NotNull final String world) {
+ public Set getClusters(@Nonnull final String world) {
final Set set = new HashSet<>();
for (final PlotArea area : this.getPlotAreaManager().getPlotAreasSet(world)) {
set.addAll(area.getClusters());
@@ -695,13 +673,13 @@ public class PlotSquared {
// group by world
// sort each
HashMap> map = new HashMap<>();
- int totalSize = Arrays.stream(this.plotAreaManager.getAllPlotAreas()).mapToInt(PlotArea::getPlotCount).sum();
+ int totalSize = Arrays.stream(this.getPlotAreaManager().getAllPlotAreas()).mapToInt(PlotArea::getPlotCount).sum();
if (plots.size() == totalSize) {
- for (PlotArea area : plotAreaManager.getAllPlotAreas()) {
+ for (PlotArea area : getPlotAreaManager().getAllPlotAreas()) {
map.put(area, area.getPlots());
}
} else {
- for (PlotArea area : plotAreaManager.getAllPlotAreas()) {
+ for (PlotArea area : getPlotAreaManager().getAllPlotAreas()) {
map.put(area, new ArrayList<>(0));
}
Collection lastList = null;
@@ -716,7 +694,7 @@ public class PlotSquared {
}
}
}
- List areas = Arrays.asList(plotAreaManager.getAllPlotAreas());
+ List areas = Arrays.asList(getPlotAreaManager().getAllPlotAreas());
areas.sort((a, b) -> {
if (priorityArea != null) {
if (a.equals(priorityArea)) {
@@ -749,7 +727,7 @@ public class PlotSquared {
return toReturn;
}
- public void setPlots(@NotNull final Map> plots) {
+ public void setPlots(@Nonnull final Map> plots) {
if (this.plots_tmp == null) {
this.plots_tmp = new HashMap<>();
}
@@ -816,7 +794,7 @@ public class PlotSquared {
if (world.equals("CheckingPlotSquaredGenerator")) {
return;
}
- this.plotAreaManager.addWorld(world);
+ this.getPlotAreaManager().addWorld(world);
Set worlds;
if (this.worldConfiguration.contains("worlds")) {
worlds = this.worldConfiguration.getConfigurationSection("worlds").getKeys(false);
@@ -832,7 +810,7 @@ public class PlotSquared {
type = PlotAreaType.NORMAL;
}
if (type == PlotAreaType.NORMAL) {
- if (plotAreaManager.getPlotAreas(world, null).length != 0) {
+ if (getPlotAreaManager().getPlotAreas(world, null).length != 0) {
debug("World possibly already loaded: " + world);
return;
}
@@ -866,7 +844,7 @@ public class PlotSquared {
.log(Captions.PREFIX + "&3 - generator: &7" + baseGenerator + ">" + plotGenerator);
PlotSquared.log(Captions.PREFIX + "&3 - plotworld: &7" + plotArea.getClass().getName());
PlotSquared.log(
- Captions.PREFIX + "&3 - plotAreaManager: &7" + plotManager.getClass().getName());
+ Captions.PREFIX + "&3 - getPlotAreaManager(): &7" + plotManager.getClass().getName());
if (!this.worldConfiguration.contains(path)) {
this.worldConfiguration.createSection(path);
worldSection = this.worldConfiguration.getConfigurationSection(path);
@@ -887,7 +865,7 @@ public class PlotSquared {
}
ConfigurationSection areasSection = worldSection.getConfigurationSection("areas");
if (areasSection == null) {
- if (plotAreaManager.getPlotAreas(world, null).length != 0) {
+ if (getPlotAreaManager().getPlotAreas(world, null).length != 0) {
debug("World possibly already loaded: " + world);
return;
}
@@ -954,7 +932,7 @@ public class PlotSquared {
PlotSquared
.log(Captions.PREFIX + "&3 - generator: &7" + baseGenerator + ">" + areaGen);
PlotSquared.log(Captions.PREFIX + "&3 - plotworld: &7" + pa);
- PlotSquared.log(Captions.PREFIX + "&3 - plotAreaManager: &7" + pa.getPlotManager());
+ PlotSquared.log(Captions.PREFIX + "&3 - getPlotAreaManager(): &7" + pa.getPlotManager());
areaGen.getPlotGenerator().initialize(pa);
areaGen.augment(pa);
addPlotArea(pa);
@@ -1314,8 +1292,8 @@ public class PlotSquared {
}
DBFunc.dbManager = new SQLManager(database, Storage.PREFIX, this.eventDispatcher, this.plotListener, this.worldConfiguration);
this.plots_tmp = DBFunc.getPlots();
- if (plotAreaManager instanceof SinglePlotAreaManager) {
- SinglePlotArea area = ((SinglePlotAreaManager) plotAreaManager).getArea();
+ if (getPlotAreaManager() instanceof SinglePlotAreaManager) {
+ SinglePlotArea area = ((SinglePlotAreaManager) getPlotAreaManager()).getArea();
addPlotArea(area);
ConfigurationSection section = worldConfiguration.getConfigurationSection("worlds.*");
if (section == null) {
@@ -1556,7 +1534,7 @@ public class PlotSquared {
}
public void forEachPlotRaw(Consumer consumer) {
- for (final PlotArea area : this.plotAreaManager.getAllPlotAreas()) {
+ for (final PlotArea area : this.getPlotAreaManager().getAllPlotAreas()) {
area.getPlots().forEach(consumer);
}
if (this.plots_tmp != null) {
@@ -1573,10 +1551,10 @@ public class PlotSquared {
* @param chunkCoordinates Chunk coordinates
* @return True if the chunk uses non-standard generation, false if not
*/
- public boolean isNonStandardGeneration(@NotNull final String world,
- @NotNull final BlockVector2 chunkCoordinates) {
+ public boolean isNonStandardGeneration(@Nonnull final String world,
+ @Nonnull final BlockVector2 chunkCoordinates) {
final Location location = Location.at(world, chunkCoordinates.getBlockX() << 4, 64, chunkCoordinates.getBlockZ() << 4);
- final PlotArea area = plotAreaManager.getApplicablePlotArea(location);
+ final PlotArea area = getPlotAreaManager().getApplicablePlotArea(location);
if (area == null) {
return true;
}
diff --git a/Core/src/main/java/com/plotsquared/core/backup/Backup.java b/Core/src/main/java/com/plotsquared/core/backup/Backup.java
index a84fc497f..111edd8a7 100644
--- a/Core/src/main/java/com/plotsquared/core/backup/Backup.java
+++ b/Core/src/main/java/com/plotsquared/core/backup/Backup.java
@@ -28,7 +28,7 @@ package com.plotsquared.core.backup;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nullable;
import java.io.IOException;
import java.nio.file.Files;
diff --git a/Core/src/main/java/com/plotsquared/core/backup/BackupManager.java b/Core/src/main/java/com/plotsquared/core/backup/BackupManager.java
index 1a2aa5e9b..5ae0dcdfe 100644
--- a/Core/src/main/java/com/plotsquared/core/backup/BackupManager.java
+++ b/Core/src/main/java/com/plotsquared/core/backup/BackupManager.java
@@ -28,8 +28,8 @@ package com.plotsquared.core.backup;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.nio.file.Path;
import java.util.Objects;
@@ -45,7 +45,7 @@ public interface BackupManager {
* @param plot Plot to perform the automatic backup on
* @param whenDone Action that runs when the automatic backup has been completed
*/
- static void backup(@Nullable PlotPlayer player, @NotNull final Plot plot, @NotNull Runnable whenDone) {
+ static void backup(@Nullable PlotPlayer player, @Nonnull final Plot plot, @Nonnull Runnable whenDone) {
Objects.requireNonNull(PlotSquared.platform()).getBackupManager().automaticBackup(player, plot, whenDone);
}
@@ -56,7 +56,7 @@ public interface BackupManager {
* @param plot Plot to get the backup profile for
* @return Backup profile
*/
- @NotNull BackupProfile getProfile(@NotNull final Plot plot);
+ @Nonnull BackupProfile getProfile(@Nonnull final Plot plot);
/**
* This will perform an automatic backup of the plot iff the plot has an owner,
@@ -67,14 +67,14 @@ public interface BackupManager {
* @param plot Plot to perform the automatic backup on
* @param whenDone Action that runs when the automatic backup has been completed
*/
- void automaticBackup(@Nullable PlotPlayer player, @NotNull final Plot plot, @NotNull Runnable whenDone);
+ void automaticBackup(@Nullable PlotPlayer player, @Nonnull final Plot plot, @Nonnull Runnable whenDone);
/**
* Get the directory in which backups are stored
*
* @return Backup directory path
*/
- @NotNull Path getBackupPath();
+ @Nonnull Path getBackupPath();
/**
* Get the maximum amount of backups that may be stored for
diff --git a/Core/src/main/java/com/plotsquared/core/backup/BackupProfile.java b/Core/src/main/java/com/plotsquared/core/backup/BackupProfile.java
index 6664246e4..1a9dc7baa 100644
--- a/Core/src/main/java/com/plotsquared/core/backup/BackupProfile.java
+++ b/Core/src/main/java/com/plotsquared/core/backup/BackupProfile.java
@@ -25,7 +25,7 @@
*/
package com.plotsquared.core.backup;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.nio.file.Path;
import java.util.List;
@@ -38,7 +38,7 @@ public interface BackupProfile {
*
* @return Future that will be completed with available backups
*/
- @NotNull CompletableFuture> listBackups();
+ @Nonnull CompletableFuture> listBackups();
/**
* Remove all backups stored for this profile
@@ -51,7 +51,7 @@ public interface BackupProfile {
*
* @return Folder that contains the backups for this profile
*/
- @NotNull Path getBackupDirectory();
+ @Nonnull Path getBackupDirectory();
/**
* Create a backup of the plot. If the profile is at the
@@ -59,7 +59,7 @@ public interface BackupProfile {
*
* @return Future that completes with the created backup.
*/
- @NotNull CompletableFuture createBackup();
+ @Nonnull CompletableFuture createBackup();
/**
* Restore a backup
@@ -67,6 +67,6 @@ public interface BackupProfile {
* @param backup Backup to restore
* @return Future that completes when the backup has finished
*/
- @NotNull CompletableFuture restoreBackup(@NotNull final Backup backup);
+ @Nonnull CompletableFuture restoreBackup(@Nonnull final Backup backup);
}
diff --git a/Core/src/main/java/com/plotsquared/core/backup/NullBackupManager.java b/Core/src/main/java/com/plotsquared/core/backup/NullBackupManager.java
index fb0e33fda..c83a36c24 100644
--- a/Core/src/main/java/com/plotsquared/core/backup/NullBackupManager.java
+++ b/Core/src/main/java/com/plotsquared/core/backup/NullBackupManager.java
@@ -29,8 +29,8 @@ import com.google.inject.Singleton;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.nio.file.Path;
import java.util.Objects;
@@ -40,16 +40,16 @@ import java.util.Objects;
*/
@Singleton public class NullBackupManager implements BackupManager {
- @Override @NotNull public BackupProfile getProfile(@NotNull Plot plot) {
+ @Override @Nonnull public BackupProfile getProfile(@Nonnull Plot plot) {
return new NullBackupProfile();
}
@Override public void automaticBackup(@Nullable PlotPlayer plotPlayer,
- @NotNull Plot plot, @NotNull Runnable whenDone) {
+ @Nonnull Plot plot, @Nonnull Runnable whenDone) {
whenDone.run();
}
- @Override @NotNull public Path getBackupPath() {
+ @Override @Nonnull public Path getBackupPath() {
return Objects.requireNonNull(PlotSquared.platform()).getDirectory().toPath();
}
diff --git a/Core/src/main/java/com/plotsquared/core/backup/NullBackupProfile.java b/Core/src/main/java/com/plotsquared/core/backup/NullBackupProfile.java
index 39c833579..b16a589fc 100644
--- a/Core/src/main/java/com/plotsquared/core/backup/NullBackupProfile.java
+++ b/Core/src/main/java/com/plotsquared/core/backup/NullBackupProfile.java
@@ -25,7 +25,7 @@
*/
package com.plotsquared.core.backup;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.io.File;
import java.nio.file.Path;
@@ -39,22 +39,22 @@ import java.util.concurrent.CompletableFuture;
*/
public class NullBackupProfile implements BackupProfile {
- @Override @NotNull public CompletableFuture> listBackups() {
+ @Override @Nonnull public CompletableFuture> listBackups() {
return CompletableFuture.completedFuture(Collections.emptyList());
}
@Override public void destroy(){
}
- @Override @NotNull public Path getBackupDirectory() {
+ @Override @Nonnull public Path getBackupDirectory() {
return new File(".").toPath();
}
- @Override @NotNull public CompletableFuture createBackup() {
+ @Override @Nonnull public CompletableFuture createBackup() {
throw new UnsupportedOperationException("Cannot create backup of an unowned plot");
}
- @Override @NotNull public CompletableFuture restoreBackup(@NotNull final Backup backup) {
+ @Override @Nonnull public CompletableFuture restoreBackup(@Nonnull final Backup backup) {
return CompletableFuture.completedFuture(null);
}
diff --git a/Core/src/main/java/com/plotsquared/core/backup/PlayerBackupProfile.java b/Core/src/main/java/com/plotsquared/core/backup/PlayerBackupProfile.java
index 27e8b0071..e70ef4ac6 100644
--- a/Core/src/main/java/com/plotsquared/core/backup/PlayerBackupProfile.java
+++ b/Core/src/main/java/com/plotsquared/core/backup/PlayerBackupProfile.java
@@ -33,7 +33,7 @@ import com.plotsquared.core.plot.schematic.Schematic;
import com.plotsquared.core.util.SchematicHandler;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.io.IOException;
import java.nio.file.Files;
@@ -59,8 +59,8 @@ public class PlayerBackupProfile implements BackupProfile {
private final BackupManager backupManager;
private final SchematicHandler schematicHandler;
- @Inject public PlayerBackupProfile(@Assisted @NotNull final UUID owner, @Assisted @NotNull final Plot plot,
- @NotNull final BackupManager backupManager, @NotNull final SchematicHandler schematicHandler) {
+ @Inject public PlayerBackupProfile(@Assisted @Nonnull final UUID owner, @Assisted @Nonnull final Plot plot,
+ @Nonnull final BackupManager backupManager, @Nonnull final SchematicHandler schematicHandler) {
this.owner = owner;
this.plot = plot;
this.backupManager = backupManager;
@@ -70,12 +70,12 @@ public class PlayerBackupProfile implements BackupProfile {
private volatile List backupCache;
private final Object backupLock = new Object();
- private static boolean isValidFile(@NotNull final Path path) {
+ private static boolean isValidFile(@Nonnull final Path path) {
final String name = path.getFileName().toString();
return name.endsWith(".schem") || name.endsWith(".schematic");
}
- @Override @NotNull public CompletableFuture> listBackups() {
+ @Override @Nonnull public CompletableFuture> listBackups() {
synchronized (this.backupLock) {
if (this.backupCache != null) {
return CompletableFuture.completedFuture(backupCache);
@@ -121,12 +121,12 @@ public class PlayerBackupProfile implements BackupProfile {
});
}
- @NotNull public Path getBackupDirectory() {
+ @Nonnull public Path getBackupDirectory() {
return resolve(resolve(resolve(backupManager.getBackupPath(), Objects.requireNonNull(plot.getArea().toString(), "plot area id")),
Objects.requireNonNull(plot.getId().toDashSeparatedString(), "plot id")), Objects.requireNonNull(owner.toString(), "owner"));
}
- private static Path resolve(@NotNull final Path parent, final String child) {
+ private static Path resolve(@Nonnull final Path parent, final String child) {
Path path = parent;
try {
if (!Files.exists(parent)) {
@@ -142,7 +142,7 @@ public class PlayerBackupProfile implements BackupProfile {
return path;
}
- @Override @NotNull public CompletableFuture createBackup() {
+ @Override @Nonnull public CompletableFuture createBackup() {
final CompletableFuture future = new CompletableFuture<>();
this.listBackups().thenAcceptAsync(backups -> {
synchronized (this.backupLock) {
@@ -162,7 +162,7 @@ public class PlayerBackupProfile implements BackupProfile {
return future;
}
- @Override @NotNull public CompletableFuture restoreBackup(@NotNull final Backup backup) {
+ @Override @Nonnull public CompletableFuture restoreBackup(@Nonnull final Backup backup) {
final CompletableFuture future = new CompletableFuture<>();
if (backup.getFile() == null || !Files.exists(backup.getFile())) {
future.completeExceptionally(new IllegalArgumentException("The specific backup does not exist"));
diff --git a/Core/src/main/java/com/plotsquared/core/backup/SimpleBackupManager.java b/Core/src/main/java/com/plotsquared/core/backup/SimpleBackupManager.java
index 68d75e810..97bae8f1c 100644
--- a/Core/src/main/java/com/plotsquared/core/backup/SimpleBackupManager.java
+++ b/Core/src/main/java/com/plotsquared/core/backup/SimpleBackupManager.java
@@ -39,8 +39,8 @@ import com.plotsquared.core.util.task.TaskManager;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -60,7 +60,7 @@ import java.util.concurrent.TimeUnit;
.expireAfterAccess(3, TimeUnit.MINUTES).build();
private final PlayerBackupProfileFactory playerBackupProfileFactory;
- @Inject public SimpleBackupManager(@NotNull final PlayerBackupProfileFactory playerBackupProfileFactory) throws Exception {
+ @Inject public SimpleBackupManager(@Nonnull final PlayerBackupProfileFactory playerBackupProfileFactory) throws Exception {
this.playerBackupProfileFactory = playerBackupProfileFactory;
this.backupPath = Objects.requireNonNull(PlotSquared.platform()).getDirectory().toPath().resolve("backups");
if (!Files.exists(backupPath)) {
@@ -70,7 +70,7 @@ import java.util.concurrent.TimeUnit;
this.backupLimit = Settings.Backup.BACKUP_LIMIT;
}
- @Override @NotNull public BackupProfile getProfile(@NotNull final Plot plot) {
+ @Override @Nonnull public BackupProfile getProfile(@Nonnull final Plot plot) {
if (plot.hasOwner() && !plot.isMerged()) {
try {
return backupProfileCache.get(new PlotCacheKey(plot), () -> this.playerBackupProfileFactory.create(plot.getOwnerAbs(), plot));
@@ -83,7 +83,7 @@ import java.util.concurrent.TimeUnit;
return new NullBackupProfile();
}
- @Override public void automaticBackup(@Nullable PlotPlayer player, @NotNull final Plot plot, @NotNull Runnable whenDone) {
+ @Override public void automaticBackup(@Nullable PlotPlayer player, @Nonnull final Plot plot, @Nonnull Runnable whenDone) {
final BackupProfile profile;
if (!this.shouldAutomaticallyBackup() || (profile = getProfile(plot)) instanceof NullBackupProfile) {
whenDone.run();
diff --git a/Core/src/main/java/com/plotsquared/core/command/Add.java b/Core/src/main/java/com/plotsquared/core/command/Add.java
index f1eab4936..b1843fffd 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Add.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Add.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.player.PlotPlayer;
@@ -35,7 +36,7 @@ import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.TabCompletions;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Collections;
@@ -54,7 +55,7 @@ public class Add extends Command {
private final EventDispatcher eventDispatcher;
- public Add(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Add(@Nonnull final EventDispatcher eventDispatcher) {
super(MainCommand.getInstance(), true);
this.eventDispatcher = eventDispatcher;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Area.java b/Core/src/main/java/com/plotsquared/core/command/Area.java
index 784022f07..18f71b00f 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Area.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Area.java
@@ -71,7 +71,7 @@ import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.io.File;
import java.io.FileOutputStream;
@@ -100,13 +100,13 @@ public class Area extends SubCommand {
private final WorldUtil worldUtil;
private final RegionManager regionManager;
- @Inject public Area(@NotNull final PlotAreaManager plotAreaManager,
- @WorldConfig @NotNull final YamlConfiguration worldConfiguration,
- @WorldFile @NotNull final File worldFile,
- @NotNull final HybridPlotWorldFactory hybridPlotWorldFactory,
- @NotNull final SetupUtils setupUtils,
- @NotNull final WorldUtil worldUtil,
- @NotNull final RegionManager regionManager) {
+ @Inject public Area(@Nonnull final PlotAreaManager plotAreaManager,
+ @WorldConfig @Nonnull final YamlConfiguration worldConfiguration,
+ @WorldFile @Nonnull final File worldFile,
+ @Nonnull final HybridPlotWorldFactory hybridPlotWorldFactory,
+ @Nonnull final SetupUtils setupUtils,
+ @Nonnull final WorldUtil worldUtil,
+ @Nonnull final RegionManager regionManager) {
this.plotAreaManager = plotAreaManager;
this.worldConfiguration = worldConfiguration;
this.worldFile = worldFile;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Auto.java b/Core/src/main/java/com/plotsquared/core/command/Auto.java
index ff405ddd3..e212d3e58 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Auto.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Auto.java
@@ -26,6 +26,7 @@
package com.plotsquared.core.command;
import com.google.common.primitives.Ints;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.CaptionUtility;
import com.plotsquared.core.configuration.Captions;
@@ -49,8 +50,8 @@ import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.AutoClaimFinishTask;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Set;
@@ -66,10 +67,14 @@ public class Auto extends SubCommand {
private final PlotAreaManager plotAreaManager;
private final EventDispatcher eventDispatcher;
-
- public Auto(@NotNull final PlotAreaManager plotAreaManager, @NotNull final EventDispatcher eventDispatcher) {
+ private final EconHandler econHandler;
+
+ @Inject public Auto(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final EventDispatcher eventDispatcher,
+ @Nullable final EconHandler econHandler) {
this.plotAreaManager = plotAreaManager;
this.eventDispatcher = eventDispatcher;
+ this.econHandler = econHandler;
}
@Deprecated public static PlotId getNextPlotId(PlotId id, int step) {
@@ -147,7 +152,7 @@ public class Auto extends SubCommand {
player.setMeta(Auto.class.getName(), true);
autoClaimFromDatabase(player, area, start, new RunnableVal() {
@Override public void run(final Plot plot) {
- TaskManager.IMP.sync(new AutoClaimFinishTask(player, plot, area, schematic,
+ TaskManager.getImplementation().sync(new AutoClaimFinishTask(player, plot, area, schematic,
PlotSquared.get().getEventDispatcher()));
}
});
@@ -169,10 +174,9 @@ public class Auto extends SubCommand {
@Override public boolean onCommand(final PlotPlayer> player, String[] args) {
PlotArea plotarea = player.getApplicablePlotArea();
if (plotarea == null) {
- if (EconHandler.getEconHandler() != null) {
+ if (this.econHandler != null) {
for (PlotArea area : this.plotAreaManager.getAllPlotAreas()) {
- if (EconHandler.getEconHandler()
- .hasPermission(area.getWorldName(), player.getName(), "plots.auto")) {
+ if (this.econHandler.hasPermission(area.getWorldName(), player.getName(), "plots.auto")) {
if (plotarea != null) {
plotarea = null;
break;
@@ -265,18 +269,18 @@ public class Auto extends SubCommand {
return true;
}
}
- if (EconHandler.getEconHandler() != null && plotarea.useEconomy()) {
+ if (this.econHandler != null && plotarea.useEconomy()) {
Expression costExp = plotarea.getPrices().get("claim");
double cost = costExp.evaluate((double) (Settings.Limit.GLOBAL ?
player.getPlotCount() :
player.getPlotCount(plotarea.getWorldName())));
cost = (size_x * size_z) * cost;
if (cost > 0d) {
- if (!force && EconHandler.getEconHandler().getMoney(player) < cost) {
+ if (!force && this.econHandler.getMoney(player) < cost) {
sendMessage(player, Captions.CANNOT_AFFORD_PLOT, "" + cost);
return true;
}
- EconHandler.getEconHandler().withdrawMoney(player, cost);
+ this.econHandler.withdrawMoney(player, cost);
sendMessage(player, Captions.REMOVED_BALANCE, cost + "");
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Backup.java b/Core/src/main/java/com/plotsquared/core/command/Backup.java
index 6ddeb7e91..4c16458c6 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Backup.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Backup.java
@@ -36,7 +36,7 @@ import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.nio.file.Files;
import java.time.Instant;
@@ -64,7 +64,7 @@ public final class Backup extends Command {
private final BackupManager backupManager;
- @Inject public Backup(@NotNull final BackupManager backupManager) {
+ @Inject public Backup(@Nonnull final BackupManager backupManager) {
super(MainCommand.getInstance(), true);
this.backupManager = backupManager;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Buy.java b/Core/src/main/java/com/plotsquared/core/command/Buy.java
index 934a6e684..f62f24bc2 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Buy.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Buy.java
@@ -39,9 +39,9 @@ import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nullable;
+import javax.annotation.Nonnull;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
@@ -56,7 +56,7 @@ public class Buy extends Command {
private final EventDispatcher eventDispatcher;
private final EconHandler econHandler;
- @Inject public Buy(@NotNull final EventDispatcher eventDispatcher,
+ @Inject public Buy(@Nonnull final EventDispatcher eventDispatcher,
@Nullable final EconHandler econHandler) {
super(MainCommand.getInstance(), true);
this.eventDispatcher = eventDispatcher;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Caps.java b/Core/src/main/java/com/plotsquared/core/command/Caps.java
index b56d33dc0..55efd2519 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Caps.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Caps.java
@@ -71,7 +71,7 @@ public class Caps extends SubCommand {
}
private > void sendFormatted(final Plot plot,
- final PlotPlayer player, final Class capFlag, final int[] countedEntities,
+ final PlotPlayer> player, final Class capFlag, final int[] countedEntities,
final String name, final int type) {
final int current = countedEntities[type];
final int max = plot.getFlag(capFlag);
diff --git a/Core/src/main/java/com/plotsquared/core/command/Claim.java b/Core/src/main/java/com/plotsquared/core/command/Claim.java
index e79f085c3..ea77ae44e 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Claim.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Claim.java
@@ -46,8 +46,8 @@ import com.plotsquared.core.util.Expression;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
@CommandDeclaration(command = "claim",
aliases = "c",
@@ -61,7 +61,7 @@ public class Claim extends SubCommand {
private final EventDispatcher eventDispatcher;
private final EconHandler econHandler;
- @Inject public Claim(@NotNull final EventDispatcher eventDispatcher,
+ @Inject public Claim(@Nonnull final EventDispatcher eventDispatcher,
@Nullable final EconHandler econHandler) {
this.eventDispatcher = eventDispatcher;
this.econHandler = econHandler;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Clear.java b/Core/src/main/java/com/plotsquared/core/command/Clear.java
index a68254904..1eee3a26c 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Clear.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Clear.java
@@ -42,7 +42,7 @@ import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.concurrent.CompletableFuture;
@@ -61,8 +61,8 @@ public class Clear extends Command {
private final EventDispatcher eventDispatcher;
private final GlobalBlockQueue blockQueue;
- @Inject public Clear(@NotNull final EventDispatcher eventDispatcher,
- @NotNull final GlobalBlockQueue blockQueue) {
+ @Inject public Clear(@Nonnull final EventDispatcher eventDispatcher,
+ @Nonnull final GlobalBlockQueue blockQueue) {
super(MainCommand.getInstance(), true);
this.eventDispatcher = eventDispatcher;
this.blockQueue = blockQueue;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Command.java b/Core/src/main/java/com/plotsquared/core/command/Command.java
index 194fc48a4..a0dbe9079 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Command.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Command.java
@@ -36,7 +36,7 @@ import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
import lombok.SneakyThrows;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -582,7 +582,7 @@ public abstract class Command {
return object;
}
- @SneakyThrows protected static void sneakyThrow(@NotNull final Throwable throwable) {
+ @SneakyThrows protected static void sneakyThrow(@Nonnull final Throwable throwable) {
throw throwable;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Condense.java b/Core/src/main/java/com/plotsquared/core/command/Condense.java
index 1f78d9bc5..180e26581 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Condense.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Condense.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
@@ -34,7 +35,7 @@ import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.MathMan;
import com.plotsquared.core.util.WorldUtil;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collection;
@@ -56,9 +57,12 @@ public class Condense extends SubCommand {
public static boolean TASK = false;
private final PlotAreaManager plotAreaManager;
+ private final WorldUtil worldUtil;
- public Condense(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public Condense(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final WorldUtil worldUtil) {
this.plotAreaManager = plotAreaManager;
+ this.worldUtil = worldUtil;
}
@Override public boolean onCommand(final PlotPlayer> player, String[] args) {
@@ -67,7 +71,7 @@ public class Condense extends SubCommand {
return false;
}
PlotArea area = this.plotAreaManager.getPlotAreaByString(args[0]);
- if (area == null || !WorldUtil.IMP.isWorld(area.getWorldName())) {
+ if (area == null || !this.worldUtil.isWorld(area.getWorldName())) {
MainUtil.sendMessage(player, "INVALID AREA");
return false;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Continue.java b/Core/src/main/java/com/plotsquared/core/command/Continue.java
index 1f619f2a3..bd061e380 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Continue.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Continue.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.events.PlotFlagRemoveEvent;
@@ -36,7 +37,7 @@ import com.plotsquared.core.plot.flag.implementations.DoneFlag;
import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
@CommandDeclaration(command = "continue",
description = "Continue a plot that was previously marked as done",
@@ -47,7 +48,7 @@ public class Continue extends SubCommand {
private final EventDispatcher eventDispatcher;
- public Continue(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Continue(@Nonnull final EventDispatcher eventDispatcher) {
this.eventDispatcher = eventDispatcher;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/CreateRoadSchematic.java b/Core/src/main/java/com/plotsquared/core/command/CreateRoadSchematic.java
index acee18881..2820fc204 100644
--- a/Core/src/main/java/com/plotsquared/core/command/CreateRoadSchematic.java
+++ b/Core/src/main/java/com/plotsquared/core/command/CreateRoadSchematic.java
@@ -33,7 +33,7 @@ import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.util.MainUtil;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
@CommandDeclaration(command = "createroadschematic",
aliases = {"crs"},
@@ -46,7 +46,7 @@ public class CreateRoadSchematic extends SubCommand {
private final HybridUtils hybridUtils;
- @Inject public CreateRoadSchematic(@NotNull final HybridUtils hybridUtils) {
+ @Inject public CreateRoadSchematic(@Nonnull final HybridUtils hybridUtils) {
this.hybridUtils = hybridUtils;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java b/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java
index bd4216e12..424363e3f 100644
--- a/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java
+++ b/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.inject.annotations.WorldConfig;
import com.plotsquared.core.configuration.file.YamlConfiguration;
@@ -44,7 +45,7 @@ import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.query.PlotQuery;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.io.File;
import java.sql.SQLException;
@@ -68,8 +69,10 @@ public class DatabaseCommand extends SubCommand {
private final PlotListener plotListener;
private final YamlConfiguration worldConfiguration;
- public DatabaseCommand(@NotNull final PlotAreaManager plotAreaManager, @NotNull final EventDispatcher eventDispatcher,
- @NotNull final PlotListener plotListener, @WorldConfig @NotNull final YamlConfiguration worldConfiguration) {
+ @Inject public DatabaseCommand(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final EventDispatcher eventDispatcher,
+ @Nonnull final PlotListener plotListener,
+ @WorldConfig @Nonnull final YamlConfiguration worldConfiguration) {
this.plotAreaManager = plotAreaManager;
this.eventDispatcher = eventDispatcher;
this.plotListener = plotListener;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Debug.java b/Core/src/main/java/com/plotsquared/core/command/Debug.java
index 3b912231d..35d413033 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Debug.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Debug.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.player.PlotPlayer;
@@ -38,7 +39,7 @@ import com.plotsquared.core.util.query.PlotQuery;
import com.plotsquared.core.util.task.TaskManager;
import com.plotsquared.core.uuid.UUIDMapping;
import com.sk89q.worldedit.world.entity.EntityType;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Comparator;
@@ -52,9 +53,12 @@ import java.util.Map;
public class Debug extends SubCommand {
private final PlotAreaManager plotAreaManager;
+ private final RegionManager regionManager;
- public Debug(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public Debug(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final RegionManager regionManager) {
this.plotAreaManager = plotAreaManager;
+ this.regionManager = regionManager;
}
@Override public boolean onCommand(PlotPlayer> player, String[] args) {
@@ -70,8 +74,7 @@ public class Debug extends SubCommand {
final long start = System.currentTimeMillis();
MainUtil.sendMessage(player, "Fetching loaded chunks...");
TaskManager.runTaskAsync(() -> MainUtil.sendMessage(player,
- "Loaded chunks: " + RegionManager.manager
- .getChunkChunks(player.getLocation().getWorldName()).size() + "(" + (
+ "Loaded chunks: " + this.regionManager.getChunkChunks(player.getLocation().getWorldName()).size() + "(" + (
System.currentTimeMillis() - start) + "ms) using thread: " + Thread
.currentThread().getName()));
return true;
diff --git a/Core/src/main/java/com/plotsquared/core/command/DebugExec.java b/Core/src/main/java/com/plotsquared/core/command/DebugExec.java
index 0006a6d83..f8daa2a89 100644
--- a/Core/src/main/java/com/plotsquared/core/command/DebugExec.java
+++ b/Core/src/main/java/com/plotsquared/core/command/DebugExec.java
@@ -26,6 +26,7 @@
package com.plotsquared.core.command;
import com.google.common.io.Files;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
@@ -62,8 +63,8 @@ import com.plotsquared.core.util.task.RunnableVal3;
import com.plotsquared.core.util.task.TaskManager;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.world.block.BlockState;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.script.Bindings;
import javax.script.ScriptContext;
@@ -90,35 +91,39 @@ public class DebugExec extends SubCommand {
private final PlotAreaManager plotAreaManager;
private final EventDispatcher eventDispatcher;
private final WorldEdit worldEdit;
+ private final GlobalBlockQueue blockQueue;
+ private final SchematicHandler schematicHandler;
+ private final EconHandler econHandler;
+ private final ChunkManager chunkManager;
+ private final WorldUtil worldUtil;
+ private final SetupUtils setupUtils;
+ private final HybridUtils hybridUtils;
+
private ScriptEngine engine;
private Bindings scope;
- public DebugExec(@NotNull final PlotAreaManager plotAreaManager, @NotNull final EventDispatcher eventDispatcher,
- @Nullable final WorldEdit worldEdit) {
+ @Inject public DebugExec(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final EventDispatcher eventDispatcher,
+ @Nullable final WorldEdit worldEdit,
+ @Nonnull final GlobalBlockQueue blockQueue,
+ @Nonnull final SchematicHandler schematicHandler,
+ @Nullable final EconHandler econHandler,
+ @Nonnull final ChunkManager chunkManager,
+ @Nonnull final WorldUtil worldUtil,
+ @Nonnull final SetupUtils setupUtils,
+ @Nonnull final HybridUtils hybridUtils) {
this.plotAreaManager = plotAreaManager;
this.eventDispatcher = eventDispatcher;
this.worldEdit = worldEdit;
+ this.blockQueue = blockQueue;
+ this.schematicHandler = schematicHandler;
+ this.econHandler = econHandler;
+ this.chunkManager = chunkManager;
+ this.worldUtil = worldUtil;
+ this.setupUtils = setupUtils;
+ this.hybridUtils = hybridUtils;
+
init();
-/*
- try {
- if (PlotSquared.get() != null) {
- File file = new File(PlotSquared.imp().getDirectory(),
- Settings.Paths.SCRIPTS + File.separator + "start.js");
- if (file.exists()) {
- init();
- String script = StringMan.join(Files.readLines(new File(new File(
- PlotSquared.imp().getDirectory() + File.separator
- + Settings.Paths.SCRIPTS), "start.js"), StandardCharsets.UTF_8),
- System.getProperty("line.separator"));
- this.scope.put("THIS", this);
- this.scope.put("PlotPlayer", ConsolePlayer.getConsole());
- this.engine.eval(script, this.scope);
- }
- }
- } catch (IOException | ScriptException ignored) {
- ignored.printStackTrace();
- }
-*/
}
public ScriptEngine getEngine() {
@@ -167,21 +172,21 @@ public class DebugExec extends SubCommand {
// Instances
this.scope.put("PS", PlotSquared.get());
- this.scope.put("GlobalBlockQueue", GlobalBlockQueue.IMP);
+ this.scope.put("GlobalBlockQueue", this.blockQueue);
this.scope.put("ExpireManager", ExpireManager.IMP);
if (this.worldEdit != null) {
this.scope.put("WEManager", new WEManager());
}
- this.scope.put("TaskManager", TaskManager.IMP);
+ this.scope.put("TaskManager", TaskManager.getImplementation());
this.scope.put("ConsolePlayer", ConsolePlayer.getConsole());
- this.scope.put("SchematicHandler", SchematicHandler.manager);
- this.scope.put("ChunkManager", ChunkManager.manager);
- this.scope.put("BlockManager", WorldUtil.IMP);
- this.scope.put("SetupUtils", SetupUtils.manager);
+ this.scope.put("SchematicHandler", this.schematicHandler);
+ this.scope.put("ChunkManager", this.chunkManager);
+ this.scope.put("BlockManager", this.worldUtil);
+ this.scope.put("SetupUtils", this.setupUtils);
this.scope.put("EventUtil", this.eventDispatcher);
- this.scope.put("EconHandler", EconHandler.getEconHandler());
+ this.scope.put("EconHandler", this.econHandler);
this.scope.put("DBFunc", DBFunc.dbManager);
- this.scope.put("HybridUtils", HybridUtils.manager);
+ this.scope.put("HybridUtils", this.hybridUtils);
this.scope.put("IMP", PlotSquared.platform());
this.scope.put("MainCommand", MainCommand.getInstance());
@@ -213,7 +218,7 @@ public class DebugExec extends SubCommand {
return true;
}
MainUtil.sendMessage(player, "$1Starting task...");
- HybridUtils.manager.analyzePlot(plot, new RunnableVal() {
+ this.hybridUtils.analyzePlot(plot, new RunnableVal() {
@Override public void run(PlotAnalysis value) {
MainUtil.sendMessage(player,
"$1Done: $2Use $3/plot debugexec analyze$2 for more information");
@@ -279,10 +284,9 @@ public class DebugExec extends SubCommand {
}
boolean result;
if (HybridUtils.regions != null) {
- result = HybridUtils.manager
- .scheduleRoadUpdate(area, HybridUtils.regions, 0, new HashSet<>());
+ result = this.hybridUtils.scheduleRoadUpdate(area, HybridUtils.regions, 0, new HashSet<>());
} else {
- result = HybridUtils.manager.scheduleRoadUpdate(area, 0);
+ result = this.hybridUtils.scheduleRoadUpdate(area, 0);
}
if (!result) {
MainUtil.sendMessage(player,
diff --git a/Core/src/main/java/com/plotsquared/core/command/DebugImportWorlds.java b/Core/src/main/java/com/plotsquared/core/command/DebugImportWorlds.java
index 1a24a97c9..0f15c1528 100644
--- a/Core/src/main/java/com/plotsquared/core/command/DebugImportWorlds.java
+++ b/Core/src/main/java/com/plotsquared/core/command/DebugImportWorlds.java
@@ -26,6 +26,7 @@
package com.plotsquared.core.command;
import com.google.common.base.Charsets;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.player.PlotPlayer;
@@ -36,7 +37,7 @@ import com.plotsquared.core.plot.world.SinglePlotAreaManager;
import com.plotsquared.core.util.WorldUtil;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.io.File;
import java.util.UUID;
@@ -50,10 +51,13 @@ import java.util.concurrent.CompletableFuture;
public class DebugImportWorlds extends Command {
private final PlotAreaManager plotAreaManager;
+ private final WorldUtil worldUtil;
- public DebugImportWorlds(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public DebugImportWorlds(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final WorldUtil worldUtil) {
super(MainCommand.getInstance(), true);
this.plotAreaManager = plotAreaManager;
+ this.worldUtil = worldUtil;
}
@Override
@@ -75,7 +79,7 @@ public class DebugImportWorlds extends Command {
}
for (File folder : container.listFiles()) {
String name = folder.getName();
- if (!WorldUtil.IMP.isWorld(name) && PlotId.fromStringOrNull(name) == null) {
+ if (!this.worldUtil.isWorld(name) && PlotId.fromStringOrNull(name) == null) {
UUID uuid;
if (name.length() > 16) {
uuid = UUID.fromString(name);
diff --git a/Core/src/main/java/com/plotsquared/core/command/DebugPaste.java b/Core/src/main/java/com/plotsquared/core/command/DebugPaste.java
index 524d3daa9..fa7f4a837 100644
--- a/Core/src/main/java/com/plotsquared/core/command/DebugPaste.java
+++ b/Core/src/main/java/com/plotsquared/core/command/DebugPaste.java
@@ -27,6 +27,7 @@ package com.plotsquared.core.command;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.inject.annotations.ConfigFile;
import com.plotsquared.core.inject.annotations.WorldFile;
@@ -37,8 +38,8 @@ import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.PremiumVerification;
import com.plotsquared.core.util.net.IncendoPaster;
import com.plotsquared.core.util.task.TaskManager;
-import lombok.NonNull;
-import org.jetbrains.annotations.NotNull;
+
+import javax.annotation.Nonnull;
import java.io.BufferedReader;
import java.io.File;
@@ -65,13 +66,13 @@ public class DebugPaste extends SubCommand {
private final File configFile;
private final File worldfile;
- public DebugPaste(@ConfigFile @NotNull final File configFile,
- @WorldFile @NotNull final File worldFile) {
+ @Inject public DebugPaste(@ConfigFile @Nonnull final File configFile,
+ @WorldFile @Nonnull final File worldFile) {
this.configFile = configFile;
this.worldfile = worldFile;
}
- private static String readFile(@NonNull final File file) throws IOException {
+ private static String readFile(@Nonnull final File file) throws IOException {
final List lines;
try (final BufferedReader reader = new BufferedReader(new FileReader(file))) {
lines = reader.lines().collect(Collectors.toList());
diff --git a/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java b/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java
index baa494029..b656522c7 100644
--- a/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java
+++ b/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java
@@ -35,7 +35,7 @@ import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotManager;
import com.plotsquared.core.util.MainUtil;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Arrays;
@@ -51,7 +51,7 @@ public class DebugRoadRegen extends SubCommand {
private final HybridUtils hybridUtils;
- @Inject public DebugRoadRegen(@NotNull final HybridUtils hybridUtils) {
+ @Inject public DebugRoadRegen(@Nonnull final HybridUtils hybridUtils) {
this.hybridUtils = hybridUtils;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Delete.java b/Core/src/main/java/com/plotsquared/core/command/Delete.java
index ccb6dedf5..87d8d683a 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Delete.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Delete.java
@@ -39,8 +39,8 @@ import com.plotsquared.core.util.Expression;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
@CommandDeclaration(command = "delete",
@@ -56,7 +56,7 @@ public class Delete extends SubCommand {
private final EventDispatcher eventDispatcher;
private final EconHandler econHandler;
- @Inject public Delete(@NotNull final EventDispatcher eventDispatcher,
+ @Inject public Delete(@Nonnull final EventDispatcher eventDispatcher,
@Nullable final EconHandler econHandler) {
this.eventDispatcher = eventDispatcher;
this.econHandler = econHandler;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Deny.java b/Core/src/main/java/com/plotsquared/core/command/Deny.java
index ed91fcfe9..b97be84f7 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Deny.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Deny.java
@@ -39,7 +39,7 @@ import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.TabCompletions;
import com.plotsquared.core.util.WorldUtil;
import com.sk89q.worldedit.world.gamemode.GameModes;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Collections;
@@ -58,9 +58,9 @@ public class Deny extends SubCommand {
private final EventDispatcher eventDispatcher;
private final WorldUtil worldUtil;
- @Inject public Deny(@NotNull final PlotAreaManager plotAreaManager,
- @NotNull final EventDispatcher eventDispatcher,
- @NotNull final WorldUtil worldUtil) {
+ @Inject public Deny(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final EventDispatcher eventDispatcher,
+ @Nonnull final WorldUtil worldUtil) {
super(Argument.PlayerName);
this.plotAreaManager = plotAreaManager;
this.eventDispatcher = eventDispatcher;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Desc.java b/Core/src/main/java/com/plotsquared/core/command/Desc.java
index a5de2111c..6b607ae31 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Desc.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Desc.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.events.PlotFlagAddEvent;
import com.plotsquared.core.events.PlotFlagRemoveEvent;
@@ -34,7 +35,7 @@ import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.flag.implementations.DescriptionFlag;
import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
@CommandDeclaration(command = "setdescription",
permission = "plots.set.desc",
@@ -47,7 +48,7 @@ public class Desc extends SetCommand {
private final EventDispatcher eventDispatcher;
- public Desc(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Desc(@Nonnull final EventDispatcher eventDispatcher) {
this.eventDispatcher = eventDispatcher;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Dislike.java b/Core/src/main/java/com/plotsquared/core/command/Dislike.java
index 503effa12..51e0b1ca2 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Dislike.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Dislike.java
@@ -25,8 +25,9 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.player.PlotPlayer;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
@CommandDeclaration(command = "dislike",
permission = "plots.dislike",
@@ -38,7 +39,7 @@ public class Dislike extends SubCommand {
private final Like like;
- public Dislike(@NotNull final Like like) {
+ @Inject public Dislike(@Nonnull final Like like) {
this.like = like;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Done.java b/Core/src/main/java/com/plotsquared/core/command/Done.java
index 7fa88b40a..2103cc4d9 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Done.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Done.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.events.PlotDoneEvent;
@@ -42,7 +43,7 @@ import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.RunnableVal;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
@CommandDeclaration(command = "done",
aliases = {"submit"},
@@ -53,9 +54,12 @@ import org.jetbrains.annotations.NotNull;
public class Done extends SubCommand {
private final EventDispatcher eventDispatcher;
-
- public Done(@NotNull final EventDispatcher eventDispatcher) {
+ private final HybridUtils hybridUtils;
+
+ @Inject public Done(@Nonnull final EventDispatcher eventDispatcher,
+ @Nonnull final HybridUtils hybridUtils) {
this.eventDispatcher = eventDispatcher;
+ this.hybridUtils = hybridUtils;
}
@Override public boolean onCommand(final PlotPlayer> player, String[] args) {
@@ -90,7 +94,7 @@ public class Done extends SubCommand {
finish(plot, player, true);
plot.removeRunning();
} else {
- HybridUtils.manager.analyzePlot(plot, new RunnableVal() {
+ this.hybridUtils.analyzePlot(plot, new RunnableVal() {
@Override public void run(PlotAnalysis value) {
plot.removeRunning();
boolean result =
diff --git a/Core/src/main/java/com/plotsquared/core/command/Download.java b/Core/src/main/java/com/plotsquared/core/command/Download.java
index 9245b3b85..66f0b6e86 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Download.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Download.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.player.PlotPlayer;
@@ -38,7 +39,7 @@ import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.WorldUtil;
import com.plotsquared.core.util.task.RunnableVal;
import com.sk89q.jnbt.CompoundTag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.net.URL;
@@ -52,9 +53,15 @@ import java.net.URL;
public class Download extends SubCommand {
private final PlotAreaManager plotAreaManager;
+ private final SchematicHandler schematicHandler;
+ private final WorldUtil worldUtil;
- public Download(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public Download(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final SchematicHandler schematicHandler,
+ @Nonnull final WorldUtil worldUtil) {
this.plotAreaManager = plotAreaManager;
+ this.schematicHandler = schematicHandler;
+ this.worldUtil = worldUtil;
}
@Override public boolean onCommand(final PlotPlayer> player, String[] args) {
@@ -91,10 +98,10 @@ public class Download extends SubCommand {
return false;
}
plot.addRunning();
- SchematicHandler.manager.getCompoundTag(plot, new RunnableVal() {
+ this.schematicHandler.getCompoundTag(plot, new RunnableVal() {
@Override public void run(CompoundTag value) {
plot.removeRunning();
- SchematicHandler.manager.upload(value, null, null, new RunnableVal() {
+ schematicHandler.upload(value, null, null, new RunnableVal() {
@Override public void run(URL url) {
if (url == null) {
MainUtil.sendMessage(player, Captions.GENERATING_LINK_FAILED);
@@ -113,8 +120,8 @@ public class Download extends SubCommand {
}
MainUtil.sendMessage(player, Captions.MCA_FILE_SIZE);
plot.addRunning();
- WorldUtil.IMP.saveWorld(world);
- WorldUtil.IMP.upload(plot, null, null, new RunnableVal() {
+ this.worldUtil.saveWorld(world);
+ this.worldUtil.upload(plot, null, null, new RunnableVal() {
@Override public void run(URL url) {
plot.removeRunning();
if (url == null) {
diff --git a/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java b/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java
index d6b5a58e8..d71cbbb2b 100644
--- a/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java
+++ b/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java
@@ -50,8 +50,8 @@ import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.helpmenu.HelpMenu;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.annotation.Nonnull;
import java.util.ArrayList;
@@ -87,7 +87,7 @@ public final class FlagCommand extends Command {
}
private static boolean checkPermValue(@Nonnull final PlotPlayer player,
- @NotNull final PlotFlag, ?> flag, @NotNull String key, @NotNull String value) {
+ @Nonnull final PlotFlag, ?> flag, @Nonnull String key, @Nonnull String value) {
key = key.toLowerCase();
value = value.toLowerCase();
String perm = CaptionUtility
@@ -152,7 +152,7 @@ public final class FlagCommand extends Command {
*
* @return true if the player is allowed to modify the flags at their current location
*/
- private static boolean checkRequirements(@NotNull final PlotPlayer player) {
+ private static boolean checkRequirements(@Nonnull final PlotPlayer player) {
final Location location = player.getLocation();
final Plot plot = location.getPlotAbs();
if (plot == null) {
@@ -180,8 +180,8 @@ public final class FlagCommand extends Command {
* @param arg String to extract flag from
* @return The flag, if found, else null
*/
- @Nullable private static PlotFlag, ?> getFlag(@NotNull final PlotPlayer player,
- @NotNull final String arg) {
+ @Nullable private static PlotFlag, ?> getFlag(@Nonnull final PlotPlayer player,
+ @Nonnull final String arg) {
if (arg != null && arg.length() > 0) {
final PlotFlag, ?> flag = GlobalFlagContainer.getInstance().getFlagFromString(arg);
if (flag instanceof InternalFlag || flag == null) {
diff --git a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java
index f963a8732..3cc72188a 100644
--- a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java
+++ b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.events.TeleportCause;
import com.plotsquared.core.player.PlotPlayer;
@@ -40,7 +41,7 @@ import com.plotsquared.core.util.query.PlotQuery;
import com.plotsquared.core.util.query.SortingStrategy;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collection;
@@ -58,13 +59,13 @@ public class HomeCommand extends Command {
private final PlotAreaManager plotAreaManager;
- public HomeCommand(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public HomeCommand(@Nonnull final PlotAreaManager plotAreaManager) {
super(MainCommand.getInstance(), true);
this.plotAreaManager = plotAreaManager;
}
- private void home(@NotNull final PlotPlayer> player,
- @NotNull final PlotQuery query, final int page,
+ private void home(@Nonnull final PlotPlayer> player,
+ @Nonnull final PlotQuery query, final int page,
final RunnableVal3 confirm,
final RunnableVal2 whenDone) {
List plots = query.asList();
@@ -86,7 +87,7 @@ public class HomeCommand extends Command {
}), () -> whenDone.run(HomeCommand.this, CommandResult.FAILURE));
}
- @NotNull private PlotQuery query(@NotNull final PlotPlayer> player) {
+ @Nonnull private PlotQuery query(@Nonnull final PlotPlayer> player) {
// everything plots need to have in common here
return PlotQuery.newQuery().ownedBy(player);
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Kick.java b/Core/src/main/java/com/plotsquared/core/command/Kick.java
index 8c2ede600..1b35df43c 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Kick.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Kick.java
@@ -37,7 +37,7 @@ import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.TabCompletions;
import com.plotsquared.core.util.WorldUtil;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Collections;
@@ -58,8 +58,8 @@ public class Kick extends SubCommand {
private final PlotAreaManager plotAreaManager;
private final WorldUtil worldUtil;
- @Inject public Kick(@NotNull final PlotAreaManager plotAreaManager,
- @NotNull final WorldUtil worldUtil) {
+ @Inject public Kick(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final WorldUtil worldUtil) {
super(Argument.PlayerName);
this.plotAreaManager = plotAreaManager;
this.worldUtil = worldUtil;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Leave.java b/Core/src/main/java/com/plotsquared/core/command/Leave.java
index bf1fbe604..a6666f84c 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Leave.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Leave.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
@@ -32,7 +33,7 @@ import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
@@ -47,7 +48,7 @@ public class Leave extends Command {
private final EventDispatcher eventDispatcher;
- public Leave(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Leave(@Nonnull final EventDispatcher eventDispatcher) {
super(MainCommand.getInstance(), true);
this.eventDispatcher = eventDispatcher;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Like.java b/Core/src/main/java/com/plotsquared/core/command/Like.java
index 92624d342..cab2dc433 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Like.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Like.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
@@ -39,7 +40,7 @@ import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collection;
@@ -57,7 +58,7 @@ public class Like extends SubCommand {
private final EventDispatcher eventDispatcher;
- public Like(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Like(@Nonnull final EventDispatcher eventDispatcher) {
this.eventDispatcher = eventDispatcher;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/ListCmd.java b/Core/src/main/java/com/plotsquared/core/command/ListCmd.java
index e1ba7afbf..57bbe624a 100644
--- a/Core/src/main/java/com/plotsquared/core/command/ListCmd.java
+++ b/Core/src/main/java/com/plotsquared/core/command/ListCmd.java
@@ -49,8 +49,8 @@ import com.plotsquared.core.util.query.PlotQuery;
import com.plotsquared.core.util.query.SortingStrategy;
import com.plotsquared.core.util.task.RunnableVal3;
import com.plotsquared.core.uuid.UUIDMapping;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
@@ -76,7 +76,7 @@ public class ListCmd extends SubCommand {
private final PlotAreaManager plotAreaManager;
private final EconHandler econHandler;
- @Inject public ListCmd(@NotNull final PlotAreaManager plotAreaManager,
+ @Inject public ListCmd(@Nonnull final PlotAreaManager plotAreaManager,
@Nullable final EconHandler econHandler) {
this.plotAreaManager = plotAreaManager;
this.econHandler = econHandler;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Load.java b/Core/src/main/java/com/plotsquared/core/command/Load.java
index df18fc8a7..cc099687b 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Load.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Load.java
@@ -39,7 +39,7 @@ import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.SchematicHandler;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.net.MalformedURLException;
import java.net.URL;
@@ -57,8 +57,8 @@ public class Load extends SubCommand {
private final PlotAreaManager plotAreaManager;
private final SchematicHandler schematicHandler;
- @Inject public Load(@NotNull final PlotAreaManager plotAreaManager,
- @NotNull final SchematicHandler schematicHandler) {
+ @Inject public Load(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final SchematicHandler schematicHandler) {
this.plotAreaManager = plotAreaManager;
this.schematicHandler = schematicHandler;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java
index b8d3015b5..d724155cf 100644
--- a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java
+++ b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java
@@ -29,23 +29,17 @@ import com.google.inject.Injector;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
-import com.plotsquared.core.configuration.file.YamlConfiguration;
-import com.plotsquared.core.listener.PlotListener;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
-import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.EconHandler;
-import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.Expression;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import com.sk89q.worldedit.WorldEdit;
-import java.io.File;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
@@ -152,12 +146,13 @@ public class MainCommand extends Command {
// Referenced commands
instance.toggle = injector.getInstance(Toggle.class);
- instance.help = injector.getInstance(Help.class);
+ instance.help = new Help(instance);
}
return instance;
}
public static boolean onCommand(final PlotPlayer> player, String... args) {
+ final EconHandler econHandler = PlotSquared.platform().getEconHandler();
if (args.length >= 1 && args[0].contains(":")) {
String[] split2 = args[0].split(":");
if (split2.length == 2) {
@@ -179,14 +174,14 @@ public class MainCommand extends Command {
public void run(final Command cmd, final Runnable success, final Runnable failure) {
if (cmd.hasConfirmation(player)) {
CmdConfirm.addPending(player, cmd.getUsage(), () -> {
- if (EconHandler.getEconHandler() != null) {
+ if (econHandler != null) {
PlotArea area = player.getApplicablePlotArea();
if (area != null) {
Expression priceEval =
area.getPrices().get(cmd.getFullId());
Double price = priceEval != null ? priceEval.evaluate(0d) : 0d;
if (price != null
- && EconHandler.getEconHandler().getMoney(player) < price) {
+ && econHandler.getMoney(player) < price) {
if (failure != null) {
failure.run();
}
@@ -200,12 +195,12 @@ public class MainCommand extends Command {
});
return;
}
- if (EconHandler.getEconHandler() != null) {
+ if (econHandler != null) {
PlotArea area = player.getApplicablePlotArea();
if (area != null) {
Expression priceEval = area.getPrices().get(cmd.getFullId());
Double price = priceEval != null ? priceEval.evaluate(0d) : 0d;
- if (price != 0d && EconHandler.getEconHandler().getMoney(player) < price) {
+ if (price != 0d && econHandler.getMoney(player) < price) {
if (failure != null) {
failure.run();
}
@@ -267,14 +262,14 @@ public class MainCommand extends Command {
if ("f".equals(args[0].substring(1))) {
confirm = new RunnableVal3() {
@Override public void run(Command cmd, Runnable success, Runnable failure) {
- if (EconHandler.getEconHandler() != null) {
+ if (PlotSquared.platform().getEconHandler() != null) {
PlotArea area = player.getApplicablePlotArea();
if (area != null) {
Expression priceEval =
area.getPrices().get(cmd.getFullId());
Double price = priceEval != null ? priceEval.evaluate(0d) : 0d;
if (price != 0d
- && EconHandler.getEconHandler().getMoney(player) < price) {
+ && PlotSquared.platform().getEconHandler().getMoney(player) < price) {
if (failure != null) {
failure.run();
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Merge.java b/Core/src/main/java/com/plotsquared/core/command/Merge.java
index 148b2c137..49d275246 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Merge.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Merge.java
@@ -42,8 +42,8 @@ import com.plotsquared.core.util.Expression;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.StringMan;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.UUID;
@@ -63,7 +63,7 @@ public class Merge extends SubCommand {
private final EventDispatcher eventDispatcher;
private final EconHandler econHandler;
- @Inject public Merge(@NotNull final EventDispatcher eventDispatcher,
+ @Inject public Merge(@Nonnull final EventDispatcher eventDispatcher,
@Nullable final EconHandler econHandler) {
this.eventDispatcher = eventDispatcher;
this.econHandler = econHandler;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Move.java b/Core/src/main/java/com/plotsquared/core/command/Move.java
index aa5cc7afa..2ae527f54 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Move.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Move.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer;
@@ -35,7 +36,7 @@ import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.concurrent.CompletableFuture;
@@ -49,7 +50,7 @@ public class Move extends SubCommand {
private final PlotAreaManager plotAreaManager;
- public Move(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public Move(@Nonnull final PlotAreaManager plotAreaManager) {
this.plotAreaManager = plotAreaManager;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Music.java b/Core/src/main/java/com/plotsquared/core/command/Music.java
index 989393fff..e3ee4afeb 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Music.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Music.java
@@ -39,7 +39,7 @@ import com.plotsquared.core.plot.flag.PlotFlag;
import com.plotsquared.core.plot.flag.implementations.MusicFlag;
import com.plotsquared.core.util.InventoryUtil;
import com.sk89q.worldedit.world.item.ItemTypes;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.Collection;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Owner.java b/Core/src/main/java/com/plotsquared/core/command/Owner.java
index 02e8c45c9..c4b0938fb 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Owner.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Owner.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
@@ -37,7 +38,7 @@ import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Set;
import java.util.UUID;
@@ -56,7 +57,7 @@ public class Owner extends SetCommand {
private final EventDispatcher eventDispatcher;
- public Owner(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Owner(@Nonnull final EventDispatcher eventDispatcher) {
this.eventDispatcher = eventDispatcher;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/PluginCmd.java b/Core/src/main/java/com/plotsquared/core/command/PluginCmd.java
index 67f498c67..60925ccbd 100644
--- a/Core/src/main/java/com/plotsquared/core/command/PluginCmd.java
+++ b/Core/src/main/java/com/plotsquared/core/command/PluginCmd.java
@@ -40,7 +40,7 @@ import com.plotsquared.core.util.task.TaskManager;
public class PluginCmd extends SubCommand {
@Override public boolean onCommand(final PlotPlayer> player, String[] args) {
- TaskManager.IMP.taskAsync(() -> {
+ TaskManager.getImplementation().taskAsync(() -> {
MainUtil.sendMessage(player, String.format(
"$2>> $1&l" + PlotSquared.platform().getPluginName() + " $2($1Version$2: $1%s$2)",
PlotSquared.get().getVersion()));
diff --git a/Core/src/main/java/com/plotsquared/core/command/Purge.java b/Core/src/main/java/com/plotsquared/core/command/Purge.java
index 969ee6cd5..09c0f44ba 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Purge.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Purge.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
@@ -37,7 +38,7 @@ import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.HashMap;
import java.util.HashSet;
@@ -58,7 +59,8 @@ public class Purge extends SubCommand {
private final PlotAreaManager plotAreaManager;
private final PlotListener plotListener;
- public Purge(@NotNull final PlotAreaManager plotAreaManager, @NotNull final PlotListener plotListener) {
+ @Inject public Purge(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final PlotListener plotListener) {
this.plotAreaManager = plotAreaManager;
this.plotListener = plotListener;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Rate.java b/Core/src/main/java/com/plotsquared/core/command/Rate.java
index f98ecdb3b..64f21a381 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Rate.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Rate.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
@@ -38,11 +39,12 @@ import com.plotsquared.core.plot.PlotItemStack;
import com.plotsquared.core.plot.Rating;
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
import com.plotsquared.core.util.EventDispatcher;
+import com.plotsquared.core.util.InventoryUtil;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.MathMan;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.HashMap;
@@ -59,9 +61,12 @@ import java.util.UUID;
public class Rate extends SubCommand {
private final EventDispatcher eventDispatcher;
+ private final InventoryUtil inventoryUtil;
- public Rate(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Rate(@Nonnull final EventDispatcher eventDispatcher,
+ @Nonnull final InventoryUtil inventoryUtil) {
this.eventDispatcher = eventDispatcher;
+ this.inventoryUtil = inventoryUtil;
}
@Override public boolean onCommand(final PlotPlayer> player, String[] args) {
@@ -143,7 +148,7 @@ public class Rate extends SubCommand {
final MutableInt index = new MutableInt(0);
final MutableInt rating = new MutableInt(0);
String title = Settings.Ratings.CATEGORIES.get(0);
- PlotInventory inventory = new PlotInventory(player, 1, title) {
+ PlotInventory inventory = new PlotInventory(inventoryUtil, player, 1, title) {
@Override public boolean onClick(int i) {
rating.add((i + 1) * Math.pow(10, index.getValue()));
index.increment();
diff --git a/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java b/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java
index 7ed15a943..e159e85e7 100644
--- a/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java
+++ b/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java
@@ -34,7 +34,7 @@ import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotManager;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.MainUtil;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
@CommandDeclaration(command = "regenallroads",
description = "Regenerate all roads in the map using the set road schematic",
@@ -48,8 +48,8 @@ public class RegenAllRoads extends SubCommand {
private final PlotAreaManager plotAreaManager;
private final HybridUtils hybridUtils;
- @Inject public RegenAllRoads(@NotNull final PlotAreaManager plotAreaManager,
- @NotNull final HybridUtils hybridUtils) {
+ @Inject public RegenAllRoads(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final HybridUtils hybridUtils) {
this.plotAreaManager = plotAreaManager;
this.hybridUtils = hybridUtils;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Reload.java b/Core/src/main/java/com/plotsquared/core/command/Reload.java
index 2fc3bdb9a..72ec89596 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Reload.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Reload.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.inject.annotations.WorldConfig;
import com.plotsquared.core.inject.annotations.WorldFile;
@@ -36,7 +37,7 @@ import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.PlotAreaType;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.MainUtil;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.io.File;
import java.io.IOException;
@@ -54,9 +55,9 @@ public class Reload extends SubCommand {
private final YamlConfiguration worldConfiguration;
private final File worldFile;
- public Reload(@NotNull final PlotAreaManager plotAreaManager,
- @WorldConfig @NotNull final YamlConfiguration worldConfiguration,
- @WorldFile @NotNull final File worldFile) {
+ @Inject public Reload(@Nonnull final PlotAreaManager plotAreaManager,
+ @WorldConfig @Nonnull final YamlConfiguration worldConfiguration,
+ @WorldFile @Nonnull final File worldFile) {
this.plotAreaManager = plotAreaManager;
this.worldConfiguration = worldConfiguration;
this.worldFile = worldFile;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Remove.java b/Core/src/main/java/com/plotsquared/core/command/Remove.java
index 4178668bc..b20a4da3a 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Remove.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Remove.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.location.Location;
@@ -34,7 +35,7 @@ import com.plotsquared.core.util.EventDispatcher;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.TabCompletions;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Collections;
@@ -52,7 +53,7 @@ public class Remove extends SubCommand {
private final EventDispatcher eventDispatcher;
- public Remove(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Remove(@Nonnull final EventDispatcher eventDispatcher) {
super(Argument.PlayerName);
this.eventDispatcher = eventDispatcher;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Save.java b/Core/src/main/java/com/plotsquared/core/command/Save.java
index 483a29ce6..3c814c655 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Save.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Save.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.PlotPlayer;
@@ -37,7 +38,7 @@ import com.plotsquared.core.util.SchematicHandler;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager;
import com.sk89q.jnbt.CompoundTag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.net.URL;
import java.util.List;
@@ -51,9 +52,12 @@ import java.util.UUID;
public class Save extends SubCommand {
private final PlotAreaManager plotAreaManager;
+ private final SchematicHandler schematicHandler;
- public Save(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public Save(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final SchematicHandler schematicHandler) {
this.plotAreaManager = plotAreaManager;
+ this.schematicHandler = schematicHandler;
}
@Override public boolean onCommand(final PlotPlayer> player, final String[] args) {
@@ -79,7 +83,7 @@ public class Save extends SubCommand {
return false;
}
plot.addRunning();
- SchematicHandler.manager.getCompoundTag(plot, new RunnableVal() {
+ this.schematicHandler.getCompoundTag(plot, new RunnableVal() {
@Override public void run(final CompoundTag value) {
TaskManager.runTaskAsync(() -> {
String time = (System.currentTimeMillis() / 1000) + "";
@@ -92,7 +96,7 @@ public class Save extends SubCommand {
.replaceAll("[^A-Za-z0-9]", "");
final String file = time + '_' + world1 + '_' + id.x + '_' + id.y + '_' + size;
UUID uuid = player.getUUID();
- SchematicHandler.manager.upload(value, uuid, file, new RunnableVal() {
+ schematicHandler.upload(value, uuid, file, new RunnableVal() {
@Override public void run(URL url) {
plot.removeRunning();
if (url == null) {
diff --git a/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java b/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java
index 66e76604e..131549d76 100644
--- a/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java
+++ b/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java
@@ -42,7 +42,7 @@ import com.plotsquared.core.util.SchematicHandler;
import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.net.URL;
import java.util.ArrayList;
@@ -61,8 +61,8 @@ public class SchematicCmd extends SubCommand {
private final SchematicHandler schematicHandler;
private boolean running = false;
- @Inject public SchematicCmd(@NotNull final PlotAreaManager plotAreaManager,
- @NotNull final SchematicHandler schematicHandler) {
+ @Inject public SchematicCmd(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final SchematicHandler schematicHandler) {
this.plotAreaManager = plotAreaManager;
this.schematicHandler = schematicHandler;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Set.java b/Core/src/main/java/com/plotsquared/core/command/Set.java
index 3a06ca6e2..743433ad2 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Set.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Set.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.backup.BackupManager;
import com.plotsquared.core.configuration.CaptionUtility;
import com.plotsquared.core.configuration.Captions;
@@ -44,6 +45,7 @@ import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.world.block.BlockCategory;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Arrays;
@@ -67,8 +69,13 @@ public class Set extends SubCommand {
public static final String[] aliases = new String[] {"b", "w", "wf", "a", "h"};
private final SetCommand component;
+ private final WorldUtil worldUtil;
+ private final GlobalBlockQueue blockQueue;
- public Set() {
+ @Inject public Set(@Nonnull final WorldUtil worldUtil,
+ @Nonnull final GlobalBlockQueue blockQueue) {
+ this.worldUtil = worldUtil;
+ this.blockQueue = blockQueue;
this.component = new SetCommand() {
@Override public String getId() {
@@ -91,7 +98,7 @@ public class Set extends SubCommand {
final List forbiddenTypes = new ArrayList<>(Settings.General.INVALID_BLOCKS);
if (Settings.Enabled_Components.CHUNK_PROCESSOR) {
- forbiddenTypes.addAll(WorldUtil.IMP.getTileEntityTypes().stream().map(
+ forbiddenTypes.addAll(worldUtil.getTileEntityTypes().stream().map(
BlockType::getName).collect(Collectors.toList()));
}
@@ -154,7 +161,7 @@ public class Set extends SubCommand {
current.setComponent(component, pattern);
}
MainUtil.sendMessage(player, Captions.GENERATING_COMPONENT);
- GlobalBlockQueue.IMP.addEmptyTask(plot::removeRunning);
+ blockQueue.addEmptyTask(plot::removeRunning);
});
return true;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Setup.java b/Core/src/main/java/com/plotsquared/core/command/Setup.java
index d61fd02da..cf412656a 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Setup.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Setup.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.generator.GeneratorWrapper;
@@ -33,6 +34,7 @@ import com.plotsquared.core.setup.SetupProcess;
import com.plotsquared.core.setup.SetupStep;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.SetupUtils;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collection;
@@ -48,6 +50,12 @@ import java.util.Map.Entry;
category = CommandCategory.ADMINISTRATION)
public class Setup extends SubCommand {
+ private final SetupUtils setupUtils;
+
+ @Inject public Setup(@Nonnull final SetupUtils setupUtils) {
+ this.setupUtils = setupUtils;
+ }
+
public void displayGenerators(PlotPlayer> player) {
StringBuilder message = new StringBuilder();
message.append("&6What generator do you want?");
@@ -72,7 +80,7 @@ public class Setup extends SubCommand {
}
process = new SetupProcess();
player.setMeta("setup", process);
- SetupUtils.manager.updateGenerators();
+ this.setupUtils.updateGenerators();
SetupStep step = process.getCurrentStep();
step.announce(player);
displayGenerators(player);
diff --git a/Core/src/main/java/com/plotsquared/core/command/Template.java b/Core/src/main/java/com/plotsquared/core/command/Template.java
index ab9785a01..5e90d5a90 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Template.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Template.java
@@ -48,7 +48,7 @@ import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.SetupUtils;
import com.plotsquared.core.util.WorldUtil;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.io.File;
import java.io.FileInputStream;
@@ -73,12 +73,12 @@ public class Template extends SubCommand {
private final GlobalBlockQueue globalBlockQueue;
private final WorldUtil worldUtil;
- @Inject public Template(@NotNull final PlotAreaManager plotAreaManager,
- @WorldConfig @NotNull final YamlConfiguration worldConfiguration,
- @WorldFile @NotNull final File worldFile,
- @NotNull final SetupUtils setupUtils,
- @NotNull final GlobalBlockQueue globalBlockQueue,
- @NotNull final WorldUtil worldUtil) {
+ @Inject public Template(@Nonnull final PlotAreaManager plotAreaManager,
+ @WorldConfig @Nonnull final YamlConfiguration worldConfiguration,
+ @WorldFile @Nonnull final File worldFile,
+ @Nonnull final SetupUtils setupUtils,
+ @Nonnull final GlobalBlockQueue globalBlockQueue,
+ @Nonnull final WorldUtil worldUtil) {
this.plotAreaManager = plotAreaManager;
this.worldConfiguration = worldConfiguration;
this.worldFile = worldFile;
diff --git a/Core/src/main/java/com/plotsquared/core/command/Trim.java b/Core/src/main/java/com/plotsquared/core/command/Trim.java
index 24d352802..8c400c95e 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Trim.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Trim.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.location.Location;
@@ -44,7 +45,7 @@ import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.TaskManager;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.regions.CuboidRegion;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.HashSet;
import java.util.Iterator;
@@ -60,9 +61,18 @@ import java.util.Set;
public class Trim extends SubCommand {
private final PlotAreaManager plotAreaManager;
+ private final WorldUtil worldUtil;
+ private final GlobalBlockQueue blockQueue;
+ private final RegionManager regionManager;
- public Trim(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public Trim(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final WorldUtil worldUtil,
+ @Nonnull final GlobalBlockQueue blockQueue,
+ @Nonnull final RegionManager regionManager) {
this.plotAreaManager = plotAreaManager;
+ this.worldUtil = worldUtil;
+ this.blockQueue = blockQueue;
+ this.regionManager = regionManager;
}
private static volatile boolean TASK = false;
@@ -84,7 +94,7 @@ public class Trim extends SubCommand {
if (ExpireManager.IMP != null) {
plots.removeAll(ExpireManager.IMP.getPendingExpired());
}
- result.value1 = new HashSet<>(RegionManager.manager.getChunkChunks(world));
+ result.value1 = new HashSet<>(PlotSquared.platform().getRegionManager().getChunkChunks(world));
result.value2 = new HashSet<>();
MainUtil.sendMessage(null, " - MCA #: " + result.value1.size());
MainUtil.sendMessage(null, " - CHUNKS: " + (result.value1.size() * 1024) + " (max)");
@@ -116,7 +126,7 @@ public class Trim extends SubCommand {
return false;
}
final String world = args[0];
- if (!WorldUtil.IMP.isWorld(world) || !this.plotAreaManager.hasPlotArea(world)) {
+ if (!this.worldUtil.isWorld(world) || !this.plotAreaManager.hasPlotArea(world)) {
MainUtil.sendMessage(player, Captions.NOT_VALID_WORLD);
return false;
}
@@ -174,8 +184,7 @@ public class Trim extends SubCommand {
}
}
}
- final LocalBlockQueue queue =
- GlobalBlockQueue.IMP.getNewQueue(world, false);
+ final LocalBlockQueue queue = blockQueue.getNewQueue(world, false);
TaskManager.objectTask(chunks, new RunnableVal() {
@Override public void run(BlockVector2 value) {
queue.regenChunk(value.getX(), value.getZ());
@@ -189,7 +198,7 @@ public class Trim extends SubCommand {
player.sendMessage("Trim done!");
};
}
- RegionManager.manager.deleteRegionFiles(world, viable, regenTask);
+ regionManager.deleteRegionFiles(world, viable, regenTask);
}
});
diff --git a/Core/src/main/java/com/plotsquared/core/command/Trust.java b/Core/src/main/java/com/plotsquared/core/command/Trust.java
index 892205f4d..a84feffc3 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Trust.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Trust.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.player.PlotPlayer;
@@ -35,7 +36,7 @@ import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.TabCompletions;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Collections;
@@ -54,7 +55,7 @@ public class Trust extends Command {
private final EventDispatcher eventDispatcher;
- public Trust(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Trust(@Nonnull final EventDispatcher eventDispatcher) {
super(MainCommand.getInstance(), true);
this.eventDispatcher = eventDispatcher;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Unlink.java b/Core/src/main/java/com/plotsquared/core/command/Unlink.java
index 424b23819..3c56e3dd3 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Unlink.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Unlink.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.events.PlotUnlinkEvent;
import com.plotsquared.core.events.Result;
@@ -36,7 +37,7 @@ import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
@CommandDeclaration(command = "unlink",
aliases = {"u", "unmerge"},
@@ -49,7 +50,7 @@ public class Unlink extends SubCommand {
private final EventDispatcher eventDispatcher;
- public Unlink(@NotNull final EventDispatcher eventDispatcher) {
+ @Inject public Unlink(@Nonnull final EventDispatcher eventDispatcher) {
this.eventDispatcher = eventDispatcher;
}
diff --git a/Core/src/main/java/com/plotsquared/core/command/Visit.java b/Core/src/main/java/com/plotsquared/core/command/Visit.java
index a12c0c625..5982d9337 100644
--- a/Core/src/main/java/com/plotsquared/core/command/Visit.java
+++ b/Core/src/main/java/com/plotsquared/core/command/Visit.java
@@ -25,6 +25,7 @@
*/
package com.plotsquared.core.command;
+import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.events.TeleportCause;
@@ -41,7 +42,7 @@ import com.plotsquared.core.util.query.PlotQuery;
import com.plotsquared.core.util.query.SortingStrategy;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collection;
@@ -62,17 +63,17 @@ public class Visit extends Command {
private final PlotAreaManager plotAreaManager;
- public Visit(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public Visit(@Nonnull final PlotAreaManager plotAreaManager) {
super(MainCommand.getInstance(), true);
this.plotAreaManager = plotAreaManager;
}
- private void visit(@NotNull final PlotPlayer player, @NotNull final PlotQuery query, final PlotArea sortByArea,
+ private void visit(@Nonnull final PlotPlayer player, @Nonnull final PlotQuery query, final PlotArea sortByArea,
final RunnableVal3 confirm, final RunnableVal2 whenDone) {
this.visit(player, query, sortByArea, confirm, whenDone, 1);
}
- private void visit(@NotNull final PlotPlayer player, @NotNull final PlotQuery query, final PlotArea sortByArea,
+ private void visit(@Nonnull final PlotPlayer player, @Nonnull final PlotQuery query, final PlotArea sortByArea,
final RunnableVal3 confirm, final RunnableVal2 whenDone, int page) {
// We get the query once,
// then we get it another time further on
diff --git a/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java b/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java
index 98150cc58..32d18c13b 100644
--- a/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java
+++ b/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java
@@ -30,7 +30,7 @@ import com.plotsquared.core.configuration.serialization.SerializableAs;
import com.plotsquared.core.generator.ClassicPlotManagerComponent;
import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.HashMap;
@@ -63,7 +63,7 @@ public class ComponentPreset implements ConfigurationSerializable {
this.icon = icon;
}
- public static ComponentPreset deserialize(@NotNull final Map map) {
+ public static ComponentPreset deserialize(@Nonnull final Map map) {
final ClassicPlotManagerComponent classicPlotManagerComponent = ClassicPlotManagerComponent
.fromString(map.getOrDefault("component", "").toString()).orElseThrow(() ->
new IllegalArgumentException("The preset needs a valid target component"));
diff --git a/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java b/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java
index 48364b10e..d192f349d 100644
--- a/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java
+++ b/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java
@@ -44,8 +44,8 @@ import com.plotsquared.core.util.PatternUtil;
import com.plotsquared.core.util.Permissions;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.world.item.ItemTypes;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
@@ -64,7 +64,7 @@ public class ComponentPresetManager {
private final EconHandler econHandler;
private final InventoryUtil inventoryUtil;
- @Inject public ComponentPresetManager(@Nullable final EconHandler econHandler, @NotNull final
+ @Inject public ComponentPresetManager(@Nullable final EconHandler econHandler, @Nonnull final
InventoryUtil inventoryUtil) {
this.econHandler = econHandler;
this.inventoryUtil = inventoryUtil;
diff --git a/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationUtil.java b/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationUtil.java
index db03b73a0..a5dd65f8e 100644
--- a/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationUtil.java
+++ b/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationUtil.java
@@ -31,7 +31,9 @@ import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.biome.BiomeTypes;
import com.sk89q.worldedit.world.block.BlockState;
import lombok.Getter;
-import lombok.NonNull;
+
+import javax.annotation.Nonnull;
+
/**
* Main Configuration Utility
@@ -104,7 +106,7 @@ public class ConfigurationUtil {
@Getter private final String unknownValue;
- UnknownBlockException(@NonNull final String unknownValue) {
+ UnknownBlockException(@Nonnull final String unknownValue) {
super(String.format("\"%s\" is not a valid block", unknownValue));
this.unknownValue = unknownValue;
}
@@ -137,7 +139,7 @@ public class ConfigurationUtil {
@Getter private final BlockState unsafeBlock;
- UnsafeBlockException(@NonNull final BlockState unsafeBlock) {
+ UnsafeBlockException(@Nonnull final BlockState unsafeBlock) {
super(String.format("%s is not a valid block", unsafeBlock));
this.unsafeBlock = unsafeBlock;
}
diff --git a/Core/src/main/java/com/plotsquared/core/database/AbstractDB.java b/Core/src/main/java/com/plotsquared/core/database/AbstractDB.java
index 4f3beccc2..ab8c50282 100644
--- a/Core/src/main/java/com/plotsquared/core/database/AbstractDB.java
+++ b/Core/src/main/java/com/plotsquared/core/database/AbstractDB.java
@@ -32,7 +32,7 @@ import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.plot.comment.PlotComment;
import com.plotsquared.core.plot.flag.PlotFlag;
import com.plotsquared.core.util.task.RunnableVal;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.HashMap;
import java.util.List;
@@ -345,7 +345,7 @@ public interface AbstractDB {
*
* @param plot The Plot to get comments from
*/
- void getComments(@NotNull Plot plot, String inbox, RunnableVal> whenDone);
+ void getComments(@Nonnull Plot plot, String inbox, RunnableVal> whenDone);
void createPlotAndSettings(Plot plot, Runnable whenDone);
diff --git a/Core/src/main/java/com/plotsquared/core/database/SQLManager.java b/Core/src/main/java/com/plotsquared/core/database/SQLManager.java
index f5a7636d0..22890e695 100644
--- a/Core/src/main/java/com/plotsquared/core/database/SQLManager.java
+++ b/Core/src/main/java/com/plotsquared/core/database/SQLManager.java
@@ -51,7 +51,7 @@ import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
@@ -144,11 +144,11 @@ public class SQLManager implements AbstractDB {
* @throws SQLException
* @throws ClassNotFoundException
*/
- public SQLManager(@NotNull final Database database,
- @NotNull final String prefix,
- @NotNull final EventDispatcher eventDispatcher,
- @NotNull final PlotListener plotListener,
- @WorldConfig @NotNull final YamlConfiguration worldConfiguration)
+ public SQLManager(@Nonnull final Database database,
+ @Nonnull final String prefix,
+ @Nonnull final EventDispatcher eventDispatcher,
+ @Nonnull final PlotListener plotListener,
+ @WorldConfig @Nonnull final YamlConfiguration worldConfiguration)
throws SQLException, ClassNotFoundException {
// Private final
this.eventDispatcher = eventDispatcher;
@@ -265,7 +265,7 @@ public class SQLManager implements AbstractDB {
return this.notifyTasks;
}
- public synchronized void addPlotTask(@NotNull Plot plot, UniqueStatement task) {
+ public synchronized void addPlotTask(@Nonnull Plot plot, UniqueStatement task) {
Queue tasks = this.plotTasks.get(plot);
if (tasks == null) {
tasks = new ConcurrentLinkedQueue<>();
@@ -2390,7 +2390,7 @@ public class SQLManager implements AbstractDB {
}
@Override
- public void getComments(@NotNull Plot plot, final String inbox,
+ public void getComments(@Nonnull Plot plot, final String inbox,
final RunnableVal> whenDone) {
addPlotTask(plot, new UniqueStatement("getComments_" + plot) {
@Override public void set(PreparedStatement statement) throws SQLException {
diff --git a/Core/src/main/java/com/plotsquared/core/events/PlotAutoMergeEvent.java b/Core/src/main/java/com/plotsquared/core/events/PlotAutoMergeEvent.java
index a84bc5de0..81653ffe4 100644
--- a/Core/src/main/java/com/plotsquared/core/events/PlotAutoMergeEvent.java
+++ b/Core/src/main/java/com/plotsquared/core/events/PlotAutoMergeEvent.java
@@ -28,7 +28,7 @@ package com.plotsquared.core.events;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotId;
import lombok.Getter;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
@@ -50,8 +50,8 @@ public final class PlotAutoMergeEvent extends PlotEvent implements CancellablePl
* @param plot Plot that was merged
* @param plots A list of plots involved in the event
*/
- public PlotAutoMergeEvent(@NotNull final String world, @NotNull final Plot plot,
- @NotNull final List plots) {
+ public PlotAutoMergeEvent(@Nonnull final String world, @Nonnull final Plot plot,
+ @Nonnull final List plots) {
super(plot);
this.world = world;
this.plots = plots;
diff --git a/Core/src/main/java/com/plotsquared/core/events/PlotChangeOwnerEvent.java b/Core/src/main/java/com/plotsquared/core/events/PlotChangeOwnerEvent.java
index 0e1f5eb48..10b3d6c5f 100644
--- a/Core/src/main/java/com/plotsquared/core/events/PlotChangeOwnerEvent.java
+++ b/Core/src/main/java/com/plotsquared/core/events/PlotChangeOwnerEvent.java
@@ -28,7 +28,7 @@ package com.plotsquared.core.events;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotId;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nullable;
import java.util.UUID;
diff --git a/Core/src/main/java/com/plotsquared/core/events/PlotEvent.java b/Core/src/main/java/com/plotsquared/core/events/PlotEvent.java
index 0b9e8801c..bec3a5bfa 100644
--- a/Core/src/main/java/com/plotsquared/core/events/PlotEvent.java
+++ b/Core/src/main/java/com/plotsquared/core/events/PlotEvent.java
@@ -26,7 +26,7 @@
package com.plotsquared.core.events;
import com.plotsquared.core.plot.Plot;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public abstract class PlotEvent {
@@ -51,7 +51,7 @@ public abstract class PlotEvent {
*
* @return the event class name
*/
- @NotNull public String getEventName() {
+ @Nonnull public String getEventName() {
if (name == null) {
name = getClass().getSimpleName();
}
diff --git a/Core/src/main/java/com/plotsquared/core/events/PlotMergeEvent.java b/Core/src/main/java/com/plotsquared/core/events/PlotMergeEvent.java
index 71bc2eaad..a6cbe6adc 100644
--- a/Core/src/main/java/com/plotsquared/core/events/PlotMergeEvent.java
+++ b/Core/src/main/java/com/plotsquared/core/events/PlotMergeEvent.java
@@ -30,7 +30,7 @@ import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import lombok.Getter;
import lombok.Setter;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
/**
* Event called when several plots are merged
@@ -53,8 +53,8 @@ public final class PlotMergeEvent extends PlotPlayerEvent implements Cancellable
* @param max Max merge size
* @param player The player attempting the merge
*/
- public PlotMergeEvent(@NotNull final String world, @NotNull final Plot plot,
- @NotNull final Direction dir, final int max, PlotPlayer player) {
+ public PlotMergeEvent(@Nonnull final String world, @Nonnull final Plot plot,
+ @Nonnull final Direction dir, final int max, PlotPlayer player) {
super(player, plot);
this.world = world;
this.dir = dir;
diff --git a/Core/src/main/java/com/plotsquared/core/events/PlotRateEvent.java b/Core/src/main/java/com/plotsquared/core/events/PlotRateEvent.java
index 7bd8ec31e..0590644b7 100644
--- a/Core/src/main/java/com/plotsquared/core/events/PlotRateEvent.java
+++ b/Core/src/main/java/com/plotsquared/core/events/PlotRateEvent.java
@@ -28,7 +28,7 @@ package com.plotsquared.core.events;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.Rating;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nullable;
public class PlotRateEvent extends PlotEvent implements CancellablePlotEvent {
diff --git a/Core/src/main/java/com/plotsquared/core/events/PlotUnlinkEvent.java b/Core/src/main/java/com/plotsquared/core/events/PlotUnlinkEvent.java
index 45299868f..827be63d6 100644
--- a/Core/src/main/java/com/plotsquared/core/events/PlotUnlinkEvent.java
+++ b/Core/src/main/java/com/plotsquared/core/events/PlotUnlinkEvent.java
@@ -29,7 +29,7 @@ import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import lombok.Getter;
import lombok.Setter;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
/**
* Event called when several merged plots are unlinked
@@ -52,7 +52,7 @@ public final class PlotUnlinkEvent extends PlotEvent implements CancellablePlotE
* @param createSign Whether to regenerate signs
* @param reason The {@link REASON} for the unlink
*/
- public PlotUnlinkEvent(@NotNull final PlotArea area, Plot plot, boolean createRoad,
+ public PlotUnlinkEvent(@Nonnull final PlotArea area, Plot plot, boolean createRoad,
boolean createSign, REASON reason) {
super(plot);
this.area = area;
diff --git a/Core/src/main/java/com/plotsquared/core/generator/AugmentedUtils.java b/Core/src/main/java/com/plotsquared/core/generator/AugmentedUtils.java
index 73bbb157e..e672a1fdf 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/AugmentedUtils.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/AugmentedUtils.java
@@ -39,8 +39,8 @@ import com.plotsquared.core.util.RegionUtil;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.Set;
@@ -54,7 +54,7 @@ public class AugmentedUtils {
enabled = true;
}
- public static boolean generate(@Nullable Object chunkObject, @NotNull final String world,
+ public static boolean generate(@Nullable Object chunkObject, @Nonnull final String world,
final int chunkX, final int chunkZ, LocalBlockQueue queue) {
if (!enabled) {
return false;
diff --git a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java
index 69b34580b..ac6aca214 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java
@@ -40,7 +40,7 @@ import com.plotsquared.core.util.RegionManager;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.block.BlockTypes;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.List;
import java.util.Optional;
@@ -53,8 +53,8 @@ public class ClassicPlotManager extends SquarePlotManager {
private final ClassicPlotWorld classicPlotWorld;
private final RegionManager regionManager;
- public ClassicPlotManager(@NotNull final ClassicPlotWorld classicPlotWorld,
- @NotNull final RegionManager regionManager) {
+ public ClassicPlotManager(@Nonnull final ClassicPlotWorld classicPlotWorld,
+ @Nonnull final RegionManager regionManager) {
super(classicPlotWorld, regionManager);
this.classicPlotWorld = classicPlotWorld;
this.regionManager = regionManager;
diff --git a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManagerComponent.java b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManagerComponent.java
index 3856546a5..adeb5222c 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManagerComponent.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManagerComponent.java
@@ -25,7 +25,7 @@
*/
package com.plotsquared.core.generator;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Optional;
@@ -51,7 +51,7 @@ public enum ClassicPlotManagerComponent {
return stringValues;
}
- public static Optional fromString(@NotNull final String string) {
+ public static Optional fromString(@Nonnull final String string) {
for (final ClassicPlotManagerComponent classicPlotManagerComponent : values()) {
if (classicPlotManagerComponent.name().equalsIgnoreCase(string)) {
return Optional.of(classicPlotManagerComponent);
diff --git a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotWorld.java b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotWorld.java
index 4ea893678..a09901c2c 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotWorld.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotWorld.java
@@ -35,8 +35,8 @@ import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.util.EconHandler;
import com.sk89q.worldedit.world.block.BlockTypes;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
@SuppressWarnings("WeakerAccess")
public abstract class ClassicPlotWorld extends SquarePlotWorld {
@@ -58,13 +58,13 @@ public abstract class ClassicPlotWorld extends SquarePlotWorld {
// BlockUtil.get((short) 155, (byte) 0);
public boolean PLOT_BEDROCK = true;
- public ClassicPlotWorld(@NotNull final String worldName,
+ public ClassicPlotWorld(@Nonnull final String worldName,
@Nullable final String id,
- @NotNull final IndependentPlotGenerator generator,
- @NotNull final PlotId min,
- @NotNull final PlotId max,
- @WorldConfig @NotNull final YamlConfiguration worldConfiguration,
- @NotNull final GlobalBlockQueue blockQueue,
+ @Nonnull final IndependentPlotGenerator generator,
+ @Nonnull final PlotId min,
+ @Nonnull final PlotId max,
+ @WorldConfig @Nonnull final YamlConfiguration worldConfiguration,
+ @Nonnull final GlobalBlockQueue blockQueue,
@Nullable final EconHandler econHandler) {
super(worldName, id, generator, min, max, worldConfiguration, blockQueue, econHandler);
}
@@ -76,7 +76,7 @@ public abstract class ClassicPlotWorld extends SquarePlotWorld {
* command - this may be useful if a config value can be changed at a later date, and has no impact on the actual
* world generation
*/
- @NotNull @Override public ConfigurationNode[] getSettingNodes() {
+ @Nonnull @Override public ConfigurationNode[] getSettingNodes() {
return new ConfigurationNode[] {
new ConfigurationNode("plot.height", this.PLOT_HEIGHT, "Plot height",
ConfigurationUtil.INTEGER),
diff --git a/Core/src/main/java/com/plotsquared/core/generator/GridPlotWorld.java b/Core/src/main/java/com/plotsquared/core/generator/GridPlotWorld.java
index 935ce6145..108796e45 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/GridPlotWorld.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/GridPlotWorld.java
@@ -31,16 +31,16 @@ import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.util.EconHandler;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
public abstract class GridPlotWorld extends PlotArea {
public short SIZE;
- public GridPlotWorld(String worldName, String id, @NotNull IndependentPlotGenerator generator,
- PlotId min, PlotId max, @WorldConfig @NotNull final YamlConfiguration worldConfiguration,
- @NotNull final GlobalBlockQueue blockQueue,
+ public GridPlotWorld(String worldName, String id, @Nonnull IndependentPlotGenerator generator,
+ PlotId min, PlotId max, @WorldConfig @Nonnull final YamlConfiguration worldConfiguration,
+ @Nonnull final GlobalBlockQueue blockQueue,
@Nullable final EconHandler econHandler) {
super(worldName, id, generator, min, max, worldConfiguration, blockQueue, econHandler);
}
diff --git a/Core/src/main/java/com/plotsquared/core/generator/HybridGen.java b/Core/src/main/java/com/plotsquared/core/generator/HybridGen.java
index c3f238470..2560981ab 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/HybridGen.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/HybridGen.java
@@ -38,13 +38,13 @@ import com.plotsquared.core.util.MathMan;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockTypes;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class HybridGen extends IndependentPlotGenerator {
private final HybridPlotWorldFactory hybridPlotWorldFactory;
- @Inject public HybridGen(@NotNull final HybridPlotWorldFactory hybridPlotWorldFactory) {
+ @Inject public HybridGen(@Nonnull final HybridPlotWorldFactory hybridPlotWorldFactory) {
this.hybridPlotWorldFactory = hybridPlotWorldFactory;
}
@@ -76,7 +76,7 @@ public class HybridGen extends IndependentPlotGenerator {
}
@Override
- public void generateChunk(@NotNull ScopedLocalBlockQueue result, @NotNull PlotArea settings) {
+ public void generateChunk(@Nonnull ScopedLocalBlockQueue result, @Nonnull PlotArea settings) {
Preconditions.checkNotNull(result, "result cannot be null");
Preconditions.checkNotNull(settings, "settings cannot be null");
diff --git a/Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java b/Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java
index c517f1cd8..e7fd298a0 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java
@@ -47,7 +47,7 @@ import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
import lombok.Getter;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.io.File;
import java.io.IOException;
@@ -61,8 +61,8 @@ public class HybridPlotManager extends ClassicPlotManager {
@Getter private final HybridPlotWorld hybridPlotWorld;
private final RegionManager regionManager;
- public HybridPlotManager(@NotNull final HybridPlotWorld hybridPlotWorld,
- @NotNull final RegionManager regionManager) {
+ public HybridPlotManager(@Nonnull final HybridPlotWorld hybridPlotWorld,
+ @Nonnull final RegionManager regionManager) {
super(hybridPlotWorld, regionManager);
this.hybridPlotWorld = hybridPlotWorld;
this.regionManager = regionManager;
diff --git a/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java b/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java
index fa1e7965b..b8031bc2b 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java
@@ -57,8 +57,8 @@ import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import lombok.Getter;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.inject.Inject;
import java.io.File;
@@ -83,15 +83,15 @@ public class HybridPlotWorld extends ClassicPlotWorld {
private final RegionManager regionManager;
private final SchematicHandler schematicHandler;
- @Inject public HybridPlotWorld(@Assisted final String worldName,
- @Assisted final String id,
- @Assisted @NotNull final IndependentPlotGenerator generator,
- @Assisted final PlotId min,
- @Assisted final PlotId max,
- @WorldConfig @NotNull final YamlConfiguration worldConfiguration,
- @NotNull final RegionManager regionManager,
- @NotNull final SchematicHandler schematicHandler,
- @NotNull final GlobalBlockQueue blockQueue,
+ @Inject public HybridPlotWorld(@Assisted("world") final String worldName,
+ @Nullable @Assisted("id") final String id,
+ @Assisted @Nonnull final IndependentPlotGenerator generator,
+ @Nullable @Assisted("min") final PlotId min,
+ @Nullable @Assisted("max") final PlotId max,
+ @WorldConfig @Nonnull final YamlConfiguration worldConfiguration,
+ @Nonnull final RegionManager regionManager,
+ @Nonnull final SchematicHandler schematicHandler,
+ @Nonnull final GlobalBlockQueue blockQueue,
@Nullable final EconHandler econHandler) {
super(worldName, id, generator, min, max, worldConfiguration, blockQueue, econHandler);
this.regionManager = regionManager;
@@ -145,11 +145,11 @@ public class HybridPlotWorld extends ClassicPlotWorld {
return BlockTransformExtent.transform(id, transform);
}
- @NotNull @Override protected PlotManager createManager() {
+ @Nonnull @Override protected PlotManager createManager() {
return new HybridPlotManager(this, this.regionManager);
}
- public Location getSignLocation(@NotNull Plot plot) {
+ public Location getSignLocation(@Nonnull Plot plot) {
plot = plot.getBasePlot(false);
final Location bot = plot.getBottomAbs();
if (SIGN_LOCATION == null) {
@@ -206,7 +206,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
}
}
- @Override public boolean isCompatible(@NotNull final PlotArea plotArea) {
+ @Override public boolean isCompatible(@Nonnull final PlotArea plotArea) {
if (!(plotArea instanceof SquarePlotWorld)) {
return false;
}
diff --git a/Core/src/main/java/com/plotsquared/core/generator/HybridUtils.java b/Core/src/main/java/com/plotsquared/core/generator/HybridUtils.java
index cbba50067..bb5e0db42 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/HybridUtils.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/HybridUtils.java
@@ -63,7 +63,7 @@ import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.io.File;
import java.util.ArrayDeque;
@@ -92,9 +92,9 @@ public class HybridUtils {
private final RegionManager regionManager;
private final SchematicHandler schematicHandler;
- @Inject public HybridUtils(@NotNull final PlotAreaManager plotAreaManager,
- @NotNull final ChunkManager chunkManager, @NotNull final GlobalBlockQueue blockQueue,
- @NotNull final WorldUtil worldUtil, @NotNull final RegionManager regionManager, @NotNull final SchematicHandler schematicHandler) {
+ @Inject public HybridUtils(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final ChunkManager chunkManager, @Nonnull final GlobalBlockQueue blockQueue,
+ @Nonnull final WorldUtil worldUtil, @Nonnull final RegionManager regionManager, @Nonnull final SchematicHandler schematicHandler) {
this.plotAreaManager = plotAreaManager;
this.chunkManager = chunkManager;
this.blockQueue = blockQueue;
diff --git a/Core/src/main/java/com/plotsquared/core/generator/SingleWorldGenerator.java b/Core/src/main/java/com/plotsquared/core/generator/SingleWorldGenerator.java
index 6be1db74d..7e2f164d3 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/SingleWorldGenerator.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/SingleWorldGenerator.java
@@ -35,7 +35,7 @@ import com.plotsquared.core.plot.world.SinglePlotAreaManager;
import com.plotsquared.core.queue.ScopedLocalBlockQueue;
import com.sk89q.worldedit.world.biome.BiomeTypes;
import com.sk89q.worldedit.world.block.BlockTypes;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class SingleWorldGenerator extends IndependentPlotGenerator {
@@ -48,7 +48,7 @@ public class SingleWorldGenerator extends IndependentPlotGenerator {
private final PlotAreaManager plotAreaManager;
- @Inject public SingleWorldGenerator(@NotNull final PlotAreaManager plotAreaManager) {
+ @Inject public SingleWorldGenerator(@Nonnull final PlotAreaManager plotAreaManager) {
this.plotAreaManager = plotAreaManager;
}
diff --git a/Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java b/Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java
index c73d28246..41edc7603 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java
@@ -34,7 +34,7 @@ import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.RegionManager;
import com.sk89q.worldedit.regions.CuboidRegion;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Iterator;
@@ -48,7 +48,7 @@ public abstract class SquarePlotManager extends GridPlotManager {
private final SquarePlotWorld squarePlotWorld;
private final RegionManager regionManager;
- public SquarePlotManager(@NotNull final SquarePlotWorld squarePlotWorld, @NotNull final RegionManager regionManager) {
+ public SquarePlotManager(@Nonnull final SquarePlotWorld squarePlotWorld, @Nonnull final RegionManager regionManager) {
super(squarePlotWorld);
this.squarePlotWorld = squarePlotWorld;
this.regionManager = regionManager;
diff --git a/Core/src/main/java/com/plotsquared/core/generator/SquarePlotWorld.java b/Core/src/main/java/com/plotsquared/core/generator/SquarePlotWorld.java
index 940669fb0..3d25ae1db 100644
--- a/Core/src/main/java/com/plotsquared/core/generator/SquarePlotWorld.java
+++ b/Core/src/main/java/com/plotsquared/core/generator/SquarePlotWorld.java
@@ -32,8 +32,8 @@ import com.plotsquared.core.inject.annotations.WorldConfig;
import com.plotsquared.core.plot.PlotId;
import com.plotsquared.core.queue.GlobalBlockQueue;
import com.plotsquared.core.util.EconHandler;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
public abstract class SquarePlotWorld extends GridPlotWorld {
@@ -44,11 +44,11 @@ public abstract class SquarePlotWorld extends GridPlotWorld {
public SquarePlotWorld(final String worldName,
@Nullable final String id,
- @NotNull final IndependentPlotGenerator generator,
+ @Nonnull final IndependentPlotGenerator generator,
@Nullable final PlotId min,
@Nullable final PlotId max,
- @WorldConfig @NotNull final YamlConfiguration worldConfiguration,
- @NotNull final GlobalBlockQueue blockQueue,
+ @WorldConfig @Nonnull final YamlConfiguration worldConfiguration,
+ @Nonnull final GlobalBlockQueue blockQueue,
@Nullable final EconHandler econHandler) {
super(worldName, id, generator, min, max, worldConfiguration, blockQueue, econHandler);
}
diff --git a/Core/src/main/java/com/plotsquared/core/inject/annotations/BackgroundPipeline.java b/Core/src/main/java/com/plotsquared/core/inject/annotations/BackgroundPipeline.java
index 28f9f0ed0..60c6f475e 100644
--- a/Core/src/main/java/com/plotsquared/core/inject/annotations/BackgroundPipeline.java
+++ b/Core/src/main/java/com/plotsquared/core/inject/annotations/BackgroundPipeline.java
@@ -25,6 +25,8 @@
*/
package com.plotsquared.core.inject.annotations;
+import com.google.inject.BindingAnnotation;
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -32,5 +34,6 @@ import java.lang.annotation.Target;
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
+@BindingAnnotation
public @interface BackgroundPipeline {
}
diff --git a/Core/src/main/java/com/plotsquared/core/inject/annotations/ConfigFile.java b/Core/src/main/java/com/plotsquared/core/inject/annotations/ConfigFile.java
index 69d5bc1fd..6a8f950f8 100644
--- a/Core/src/main/java/com/plotsquared/core/inject/annotations/ConfigFile.java
+++ b/Core/src/main/java/com/plotsquared/core/inject/annotations/ConfigFile.java
@@ -25,6 +25,8 @@
*/
package com.plotsquared.core.inject.annotations;
+import com.google.inject.BindingAnnotation;
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -32,5 +34,6 @@ import java.lang.annotation.Target;
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
+@BindingAnnotation
public @interface ConfigFile {
}
diff --git a/Core/src/main/java/com/plotsquared/core/inject/annotations/ConsoleActor.java b/Core/src/main/java/com/plotsquared/core/inject/annotations/ConsoleActor.java
index 74ed7e2af..41213cc4f 100644
--- a/Core/src/main/java/com/plotsquared/core/inject/annotations/ConsoleActor.java
+++ b/Core/src/main/java/com/plotsquared/core/inject/annotations/ConsoleActor.java
@@ -25,6 +25,8 @@
*/
package com.plotsquared.core.inject.annotations;
+import com.google.inject.BindingAnnotation;
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -32,5 +34,6 @@ import java.lang.annotation.Target;
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
+@BindingAnnotation
public @interface ConsoleActor {
}
diff --git a/Core/src/main/java/com/plotsquared/core/inject/annotations/DefaultGenerator.java b/Core/src/main/java/com/plotsquared/core/inject/annotations/DefaultGenerator.java
index 69d1c0192..26060efd6 100644
--- a/Core/src/main/java/com/plotsquared/core/inject/annotations/DefaultGenerator.java
+++ b/Core/src/main/java/com/plotsquared/core/inject/annotations/DefaultGenerator.java
@@ -25,6 +25,8 @@
*/
package com.plotsquared.core.inject.annotations;
+import com.google.inject.BindingAnnotation;
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -32,5 +34,6 @@ import java.lang.annotation.Target;
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
+@BindingAnnotation
public @interface DefaultGenerator {
}
diff --git a/Core/src/main/java/com/plotsquared/core/inject/annotations/ImpromptuPipeline.java b/Core/src/main/java/com/plotsquared/core/inject/annotations/ImpromptuPipeline.java
index c218b4580..76caa547e 100644
--- a/Core/src/main/java/com/plotsquared/core/inject/annotations/ImpromptuPipeline.java
+++ b/Core/src/main/java/com/plotsquared/core/inject/annotations/ImpromptuPipeline.java
@@ -25,6 +25,8 @@
*/
package com.plotsquared.core.inject.annotations;
+import com.google.inject.BindingAnnotation;
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -32,5 +34,6 @@ import java.lang.annotation.Target;
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
+@BindingAnnotation
public @interface ImpromptuPipeline {
}
diff --git a/Core/src/main/java/com/plotsquared/core/inject/annotations/WorldConfig.java b/Core/src/main/java/com/plotsquared/core/inject/annotations/WorldConfig.java
index 115f71d48..f7aeb5d54 100644
--- a/Core/src/main/java/com/plotsquared/core/inject/annotations/WorldConfig.java
+++ b/Core/src/main/java/com/plotsquared/core/inject/annotations/WorldConfig.java
@@ -25,6 +25,8 @@
*/
package com.plotsquared.core.inject.annotations;
+import com.google.inject.BindingAnnotation;
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -32,5 +34,6 @@ import java.lang.annotation.Target;
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
+@BindingAnnotation
public @interface WorldConfig {
}
diff --git a/Core/src/main/java/com/plotsquared/core/inject/annotations/WorldFile.java b/Core/src/main/java/com/plotsquared/core/inject/annotations/WorldFile.java
index 47cfc932a..4a6518a08 100644
--- a/Core/src/main/java/com/plotsquared/core/inject/annotations/WorldFile.java
+++ b/Core/src/main/java/com/plotsquared/core/inject/annotations/WorldFile.java
@@ -25,6 +25,8 @@
*/
package com.plotsquared.core.inject.annotations;
+import com.google.inject.BindingAnnotation;
+
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -32,5 +34,6 @@ import java.lang.annotation.Target;
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
+@BindingAnnotation
public @interface WorldFile {
}
diff --git a/Core/src/main/java/com/plotsquared/core/inject/factory/HybridPlotWorldFactory.java b/Core/src/main/java/com/plotsquared/core/inject/factory/HybridPlotWorldFactory.java
index 9dd2223dd..53c446949 100644
--- a/Core/src/main/java/com/plotsquared/core/inject/factory/HybridPlotWorldFactory.java
+++ b/Core/src/main/java/com/plotsquared/core/inject/factory/HybridPlotWorldFactory.java
@@ -25,15 +25,19 @@
*/
package com.plotsquared.core.inject.factory;
+import com.google.inject.assistedinject.Assisted;
import com.plotsquared.core.generator.HybridPlotWorld;
import com.plotsquared.core.generator.IndependentPlotGenerator;
import com.plotsquared.core.plot.PlotId;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
public interface HybridPlotWorldFactory {
- @NotNull HybridPlotWorld create(@NotNull String worldName, @Nullable String id,
- @NotNull IndependentPlotGenerator plotGenerator, @Nullable PlotId min, @Nullable PlotId max);
+ @Nonnull HybridPlotWorld create(@Nonnull @Assisted("world") String worldName,
+ @Nullable @Assisted("id") String id,
+ @Nonnull IndependentPlotGenerator plotGenerator,
+ @Nullable @Assisted("min") PlotId min,
+ @Nullable @Assisted("max") PlotId max);
}
diff --git a/Core/src/main/java/com/plotsquared/core/inject/factory/PlayerBackupProfileFactory.java b/Core/src/main/java/com/plotsquared/core/inject/factory/PlayerBackupProfileFactory.java
index b9497aa02..512a6256f 100644
--- a/Core/src/main/java/com/plotsquared/core/inject/factory/PlayerBackupProfileFactory.java
+++ b/Core/src/main/java/com/plotsquared/core/inject/factory/PlayerBackupProfileFactory.java
@@ -27,12 +27,12 @@ package com.plotsquared.core.inject.factory;
import com.plotsquared.core.backup.PlayerBackupProfile;
import com.plotsquared.core.plot.Plot;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.UUID;
public interface PlayerBackupProfileFactory {
- @NotNull PlayerBackupProfile create(@NotNull UUID uuid, @NotNull Plot plot);
+ @Nonnull PlayerBackupProfile create(@Nonnull UUID uuid, @Nonnull Plot plot);
}
diff --git a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java
index 46c1747aa..f01253053 100644
--- a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java
+++ b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java
@@ -65,7 +65,7 @@ import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.gamemode.GameModes;
import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.Iterator;
diff --git a/Core/src/main/java/com/plotsquared/core/listener/ProcessedWEExtent.java b/Core/src/main/java/com/plotsquared/core/listener/ProcessedWEExtent.java
index fb1324ad7..5d9de3ba3 100644
--- a/Core/src/main/java/com/plotsquared/core/listener/ProcessedWEExtent.java
+++ b/Core/src/main/java/com/plotsquared/core/listener/ProcessedWEExtent.java
@@ -44,7 +44,7 @@ import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.lang.reflect.Field;
import java.util.HashMap;
@@ -64,7 +64,7 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
private Extent parent;
private Map tileEntityCount = new HashMap<>();
- public ProcessedWEExtent(String world, Set mask, int max, Extent child, Extent parent, @NotNull final WorldUtil worldUtil) {
+ public ProcessedWEExtent(String world, Set mask, int max, Extent child, Extent parent, @Nonnull final WorldUtil worldUtil) {
super(child);
this.mask = mask;
this.world = world;
diff --git a/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java b/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java
index bac7bd5ec..4ae1c5c1f 100644
--- a/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java
+++ b/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java
@@ -45,7 +45,7 @@ import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.util.eventbus.EventHandler.Priority;
import com.sk89q.worldedit.util.eventbus.Subscribe;
import com.sk89q.worldedit.world.World;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Set;
@@ -54,7 +54,7 @@ public class WESubscriber {
private final PlotAreaManager plotAreaManager;
private final WorldUtil worldUtil;
- @Inject public WESubscriber(@NotNull final PlotAreaManager plotAreaManager, @NotNull final WorldUtil worldUtil) {
+ @Inject public WESubscriber(@Nonnull final PlotAreaManager plotAreaManager, @Nonnull final WorldUtil worldUtil) {
this.plotAreaManager = plotAreaManager;
this.worldUtil = worldUtil;
}
diff --git a/Core/src/main/java/com/plotsquared/core/location/Location.java b/Core/src/main/java/com/plotsquared/core/location/Location.java
index b3a72c237..53db29ed7 100644
--- a/Core/src/main/java/com/plotsquared/core/location/Location.java
+++ b/Core/src/main/java/com/plotsquared/core/location/Location.java
@@ -33,11 +33,12 @@ import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import lombok.EqualsAndHashCode;
import lombok.Getter;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import org.khelekore.prtree.MBR;
import org.khelekore.prtree.SimpleMBR;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
/**
* An unmodifiable 6-tuple (world,x,y,z,yaw,pitch)
*/
@@ -49,7 +50,7 @@ public final class Location implements Comparable {
@Getter private final BlockVector3 blockVector3;
private final World> world;
- private Location(@NotNull final World> world, @NotNull final BlockVector3 blockVector3,
+ private Location(@Nonnull final World> world, @Nonnull final BlockVector3 blockVector3,
final float yaw, final float pitch) {
this.world = Preconditions.checkNotNull(world, "World may not be null");
this.blockVector3 = Preconditions.checkNotNull(blockVector3, "Vector may not be null");
@@ -57,7 +58,7 @@ public final class Location implements Comparable {
this.pitch = pitch;
}
- private Location(@NotNull final String worldName, @NotNull final BlockVector3 blockVector3,
+ private Location(@Nonnull final String worldName, @Nonnull final BlockVector3 blockVector3,
final float yaw, final float pitch) {
Preconditions.checkNotNull(worldName, "World name may not be null");
if (worldName.isEmpty()) {
@@ -79,8 +80,8 @@ public final class Location implements Comparable {
* @param pitch pitch
* @return New location
*/
- @NotNull public static Location at(@NotNull final String world,
- @NotNull final BlockVector3 blockVector3, final float yaw, final float pitch) {
+ @Nonnull public static Location at(@Nonnull final String world,
+ @Nonnull final BlockVector3 blockVector3, final float yaw, final float pitch) {
return new Location(world, blockVector3, yaw, pitch);
}
@@ -91,8 +92,8 @@ public final class Location implements Comparable {
* @param blockVector3 (x,y,z) vector
* @return New location
*/
- @NotNull public static Location at(@NotNull final String world,
- @NotNull final BlockVector3 blockVector3) {
+ @Nonnull public static Location at(@Nonnull final String world,
+ @Nonnull final BlockVector3 blockVector3) {
return at(world, blockVector3, 0f, 0f);
}
@@ -107,7 +108,7 @@ public final class Location implements Comparable {
* @param pitch Pitch
* @return New location
*/
- @NotNull public static Location at(@NotNull final String world, final int x, final int y,
+ @Nonnull public static Location at(@Nonnull final String world, final int x, final int y,
final int z, final float yaw, final float pitch) {
return at(world, BlockVector3.at(x, y, z), yaw, pitch);
}
@@ -121,7 +122,7 @@ public final class Location implements Comparable {
* @param z Z coordinate
* @return New location
*/
- @NotNull public static Location at(@NotNull final String world, final int x, final int y,
+ @Nonnull public static Location at(@Nonnull final String world, final int x, final int y,
final int z) {
return at(world, BlockVector3.at(x, y, z));
}
@@ -135,8 +136,8 @@ public final class Location implements Comparable {
* @param pitch pitch
* @return New location
*/
- @NotNull public static Location at(@NotNull final World> world,
- @NotNull final BlockVector3 blockVector3, final float yaw, final float pitch) {
+ @Nonnull public static Location at(@Nonnull final World> world,
+ @Nonnull final BlockVector3 blockVector3, final float yaw, final float pitch) {
return new Location(world, blockVector3, yaw, pitch);
}
@@ -147,8 +148,8 @@ public final class Location implements Comparable {
* @param blockVector3 (x,y,z) vector
* @return New location
*/
- @NotNull public static Location at(@NotNull final World> world,
- @NotNull final BlockVector3 blockVector3) {
+ @Nonnull public static Location at(@Nonnull final World> world,
+ @Nonnull final BlockVector3 blockVector3) {
return at(world, blockVector3, 0f, 0f);
}
@@ -163,7 +164,7 @@ public final class Location implements Comparable {
* @param pitch Pitch
* @return New location
*/
- @NotNull public static Location at(@NotNull final World> world, final int x, final int y,
+ @Nonnull public static Location at(@Nonnull final World> world, final int x, final int y,
final int z, final float yaw, final float pitch) {
return at(world, BlockVector3.at(x, y, z), yaw, pitch);
}
@@ -177,7 +178,7 @@ public final class Location implements Comparable {
* @param z Z coordinate
* @return New location
*/
- @NotNull public static Location at(@NotNull final World> world, final int x, final int y,
+ @Nonnull public static Location at(@Nonnull final World> world, final int x, final int y,
final int z) {
return at(world, BlockVector3.at(x, y, z));
}
@@ -187,7 +188,7 @@ public final class Location implements Comparable {
*
* @return World object
*/
- @NotNull public World> getWorld() {
+ @Nonnull public World> getWorld() {
return this.world;
}
@@ -196,7 +197,7 @@ public final class Location implements Comparable {
*
* @return World name
*/
- @NotNull public String getWorldName() {
+ @Nonnull public String getWorldName() {
return this.world.getName();
}
@@ -326,7 +327,7 @@ public final class Location implements Comparable {
*
* @return Chunk coordinates
*/
- @NotNull public BlockVector2 getChunkLocation() {
+ @Nonnull public BlockVector2 getChunkLocation() {
return BlockVector2.at(this.getX() >> 4, this.getZ() >> 4);
}
@@ -338,7 +339,7 @@ public final class Location implements Comparable {
* @param z Z offset
* @return New location
*/
- @NotNull public Location add(final int x, final int y, final int z) {
+ @Nonnull public Location add(final int x, final int y, final int z) {
return new Location(this.world, this.blockVector3.add(x, y, z), this.yaw, this.pitch);
}
@@ -348,7 +349,7 @@ public final class Location implements Comparable {
* @param x New X coordinate
* @return New location
*/
- @NotNull public Location withX(final int x) {
+ @Nonnull public Location withX(final int x) {
return new Location(this.world, this.blockVector3.withX(x), this.yaw, this.pitch);
}
@@ -358,7 +359,7 @@ public final class Location implements Comparable {
* @param y New Y coordinate
* @return New location
*/
- @NotNull public Location withY(final int y) {
+ @Nonnull public Location withY(final int y) {
return new Location(this.world, this.blockVector3.withY(y), this.yaw, this.pitch);
}
@@ -368,7 +369,7 @@ public final class Location implements Comparable {
* @param z New Z coordinate
* @return New location
*/
- @NotNull public Location withZ(final int z) {
+ @Nonnull public Location withZ(final int z) {
return new Location(this.world, this.blockVector3.withZ(z), this.yaw, this.pitch);
}
@@ -378,7 +379,7 @@ public final class Location implements Comparable {
* @param yaw New yaw
* @return New location
*/
- @NotNull public Location withYaw(final float yaw) {
+ @Nonnull public Location withYaw(final float yaw) {
return new Location(this.world, this.blockVector3, yaw, this.pitch);
}
@@ -388,7 +389,7 @@ public final class Location implements Comparable {
* @param pitch New pitch
* @return New location
*/
- @NotNull public Location withPitch(final float pitch) {
+ @Nonnull public Location withPitch(final float pitch) {
return new Location(this.world, this.blockVector3, this.yaw, pitch);
}
@@ -398,18 +399,18 @@ public final class Location implements Comparable {
* @param world New world
* @return New location
*/
- @NotNull public Location withWorld(@NotNull final String world) {
+ @Nonnull public Location withWorld(@Nonnull final String world) {
return new Location(world, this.blockVector3, this.yaw, this.pitch);
}
- public double getEuclideanDistanceSquared(@NotNull final Location l2) {
+ public double getEuclideanDistanceSquared(@Nonnull final Location l2) {
double x = getX() - l2.getX();
double y = getY() - l2.getY();
double z = getZ() - l2.getZ();
return x * x + y * y + z * z;
}
- public double getEuclideanDistance(@NotNull final Location l2) {
+ public double getEuclideanDistance(@Nonnull final Location l2) {
return Math.sqrt(getEuclideanDistanceSquared(l2));
}
@@ -421,7 +422,7 @@ public final class Location implements Comparable {
* @param z Z offset
* @return New location
*/
- @NotNull public Location subtract(int x, int y, int z) {
+ @Nonnull public Location subtract(int x, int y, int z) {
return this.add(-x, -y, -z);
}
@@ -430,12 +431,12 @@ public final class Location implements Comparable {
*
* @return Minimum bounding rectangle
*/
- @NotNull public MBR toMBR() {
+ @Nonnull public MBR toMBR() {
return new SimpleMBR(this.getX(), this.getX(), this.getY(), this.getY(), this.getZ(),
this.getZ());
}
- @Override public int compareTo(@NotNull final Location o) {
+ @Override public int compareTo(@Nonnull final Location o) {
if (this.getX() == o.getX() && this.getY() == o.getY() || this.getZ() == o.getZ()) {
return 0;
}
diff --git a/Core/src/main/java/com/plotsquared/core/location/PlotLoc.java b/Core/src/main/java/com/plotsquared/core/location/PlotLoc.java
index 6181f9fad..8301f23a7 100644
--- a/Core/src/main/java/com/plotsquared/core/location/PlotLoc.java
+++ b/Core/src/main/java/com/plotsquared/core/location/PlotLoc.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.location;
import com.plotsquared.core.util.StringMan;
import lombok.AllArgsConstructor;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nullable;
//todo better description needed
diff --git a/Core/src/main/java/com/plotsquared/core/location/World.java b/Core/src/main/java/com/plotsquared/core/location/World.java
index 588447dd9..2e4eb6c52 100644
--- a/Core/src/main/java/com/plotsquared/core/location/World.java
+++ b/Core/src/main/java/com/plotsquared/core/location/World.java
@@ -26,7 +26,7 @@
package com.plotsquared.core.location;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
/**
* PlotSquared representation of a platform world
@@ -40,14 +40,14 @@ public interface World {
*
* @return Platform world
*/
- @NotNull T getPlatformWorld();
+ @Nonnull T getPlatformWorld();
/**
* Get the name of the world
*
* @return World name
*/
- @NotNull String getName();
+ @Nonnull String getName();
/**
* Get a {@link NullWorld} implementation
@@ -63,11 +63,11 @@ public interface World {
private NullWorld() {
}
- @NotNull @Override public T getPlatformWorld() {
+ @Nonnull @Override public T getPlatformWorld() {
throw new UnsupportedOperationException("Cannot get platform world from NullWorld");
}
- @Override public @NotNull String getName() {
+ @Override public @Nonnull String getName() {
return "";
}
diff --git a/Core/src/main/java/com/plotsquared/core/player/ConsolePlayer.java b/Core/src/main/java/com/plotsquared/core/player/ConsolePlayer.java
index 654678253..271a15e56 100644
--- a/Core/src/main/java/com/plotsquared/core/player/ConsolePlayer.java
+++ b/Core/src/main/java/com/plotsquared/core/player/ConsolePlayer.java
@@ -42,8 +42,8 @@ import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.gamemode.GameModes;
import com.sk89q.worldedit.world.item.ItemType;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.UUID;
@@ -53,9 +53,9 @@ public class ConsolePlayer extends PlotPlayer {
private final Actor actor;
- @Inject private ConsolePlayer(@NotNull final PlotAreaManager plotAreaManager,
- @NotNull final EventDispatcher eventDispatcher,
- @ConsoleActor @NotNull final Actor actor,
+ @Inject private ConsolePlayer(@Nonnull final PlotAreaManager plotAreaManager,
+ @Nonnull final EventDispatcher eventDispatcher,
+ @ConsoleActor @Nonnull final Actor actor,
@Nullable final EconHandler econHandler) {
super(plotAreaManager, eventDispatcher, econHandler);
this.actor = actor;
@@ -73,7 +73,7 @@ public class ConsolePlayer extends PlotPlayer {
region.getMinimumPoint().getX() + region.getMaximumPoint().getX() / 2, 0,
region.getMinimumPoint().getZ() + region.getMaximumPoint().getZ() / 2);
} else {
- location = Location.at("world", 0, 0, 0);
+ location = Location.at("", 0, 0, 0);
}
setMeta("location", location);
}
@@ -94,7 +94,7 @@ public class ConsolePlayer extends PlotPlayer {
return this.toActor();
}
- @Override public boolean canTeleport(@NotNull Location location) {
+ @Override public boolean canTeleport(@Nonnull Location location) {
return true;
}
@@ -102,7 +102,7 @@ public class ConsolePlayer extends PlotPlayer {
public void sendTitle(String title, String subtitle, int fadeIn, int stay, int fadeOut) {
}
- @NotNull @Override public Location getLocation() {
+ @Nonnull @Override public Location getLocation() {
return this.getMeta("location");
}
@@ -110,7 +110,7 @@ public class ConsolePlayer extends PlotPlayer {
return getLocation();
}
- @NotNull @Override public UUID getUUID() {
+ @Nonnull @Override public UUID getUUID() {
return DBFunc.EVERYONE;
}
@@ -160,14 +160,14 @@ public class ConsolePlayer extends PlotPlayer {
return RequiredType.CONSOLE;
}
- @Override public void setWeather(@NotNull PlotWeather weather) {
+ @Override public void setWeather(@Nonnull PlotWeather weather) {
}
- @Override public @NotNull GameMode getGameMode() {
+ @Override public @Nonnull GameMode getGameMode() {
return GameModes.SPECTATOR;
}
- @Override public void setGameMode(@NotNull GameMode gameMode) {
+ @Override public void setGameMode(@Nonnull GameMode gameMode) {
}
@Override public void setTime(long time) {
@@ -180,7 +180,7 @@ public class ConsolePlayer extends PlotPlayer {
@Override public void setFlight(boolean fly) {
}
- @Override public void playMusic(@NotNull Location location, @NotNull ItemType id) {
+ @Override public void playMusic(@Nonnull Location location, @Nonnull ItemType id) {
}
@Override public void kick(String message) {
diff --git a/Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java b/Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
index 3f0fbbd30..9ce053985 100644
--- a/Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
+++ b/Core/src/main/java/com/plotsquared/core/player/PlotPlayer.java
@@ -54,9 +54,8 @@ import com.plotsquared.core.util.task.TaskManager;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.item.ItemType;
-import lombok.NonNull;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.nio.ByteBuffer;
import java.util.Collection;
@@ -93,13 +92,13 @@ public abstract class PlotPlayer
implements CommandCaller, OfflinePlotPlayer
private final EventDispatcher eventDispatcher;
private final EconHandler econHandler;
- public PlotPlayer(@NotNull final PlotAreaManager plotAreaManager, @NotNull final EventDispatcher eventDispatcher, @Nullable final EconHandler econHandler) {
+ public PlotPlayer(@Nonnull final PlotAreaManager plotAreaManager, @Nonnull final EventDispatcher eventDispatcher, @Nullable final EconHandler econHandler) {
this.plotAreaManager = plotAreaManager;
this.eventDispatcher = eventDispatcher;
this.econHandler = econHandler;
}
- public static PlotPlayer from(@NonNull final T object) {
+ public static PlotPlayer from(@Nonnull final T object) {
if (!converters.containsKey(object.getClass())) {
throw new IllegalArgumentException(String
.format("There is no registered PlotPlayer converter for type %s",
@@ -108,7 +107,7 @@ public abstract class PlotPlayer
implements CommandCaller, OfflinePlotPlayer
return converters.get(object.getClass()).convert(object);
}
- public static void registerConverter(@NonNull final Class clazz,
+ public static void registerConverter(@Nonnull final Class clazz,
final PlotPlayerConverter converter) {
converters.put(clazz, converter);
}
@@ -117,7 +116,7 @@ public abstract class PlotPlayer
implements CommandCaller, OfflinePlotPlayer
return Collections.unmodifiableCollection(debugModeEnabled);
}
- public static Collection> getDebugModePlayersInPlot(@NotNull final Plot plot) {
+ public static Collection> getDebugModePlayersInPlot(@Nonnull final Plot plot) {
if (debugModeEnabled.isEmpty()) {
return Collections.emptyList();
}
@@ -376,7 +375,7 @@ public abstract class PlotPlayer
implements CommandCaller, OfflinePlotPlayer
*
* @return The location
*/
- @NotNull public Location getLocation() {
+ @Nonnull public Location getLocation() {
Location location = getMeta("location");
if (location != null) {
return location;
@@ -403,9 +402,9 @@ public abstract class PlotPlayer
implements CommandCaller, OfflinePlotPlayer
*
* @return UUID
*/
- @Override @NotNull public abstract UUID getUUID();
+ @Override @Nonnull public abstract UUID getUUID();
- public boolean canTeleport(@NotNull final Location location) {
+ public boolean canTeleport(@Nonnull final Location location) {
Preconditions.checkNotNull(location, "Specified location cannot be null");
final Location current = getLocationFull();
teleport(location);
@@ -497,21 +496,21 @@ public abstract class PlotPlayer
implements CommandCaller, OfflinePlotPlayer
*
* @param weather the weather visible to the player
*/
- public abstract void setWeather(@NotNull PlotWeather weather);
+ public abstract void setWeather(@Nonnull PlotWeather weather);
/**
* Get this player's gamemode.
*
* @return the gamemode of the player.
*/
- public abstract @NotNull GameMode getGameMode();
+ public abstract @Nonnull GameMode getGameMode();
/**
* Set this player's gameMode.
*
* @param gameMode the gamemode to set
*/
- public abstract void setGameMode(@NotNull GameMode gameMode);
+ public abstract void setGameMode(@Nonnull GameMode gameMode);
/**
* Set this player's local time (ticks).
@@ -540,7 +539,7 @@ public abstract class PlotPlayer
implements CommandCaller, OfflinePlotPlayer
* @param location where to play the music
* @param id the record item id
*/
- public abstract void playMusic(@NotNull Location location, @NotNull ItemType id);
+ public abstract void playMusic(@Nonnull Location location, @Nonnull ItemType id);
/**
* Check if this player is banned.
diff --git a/Core/src/main/java/com/plotsquared/core/plot/BlockBucket.java b/Core/src/main/java/com/plotsquared/core/plot/BlockBucket.java
index b5a6250ab..f467c595f 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/BlockBucket.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/BlockBucket.java
@@ -38,8 +38,9 @@ import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockType;
import lombok.EqualsAndHashCode;
import lombok.Getter;
-import lombok.NonNull;
+
import lombok.RequiredArgsConstructor;
+import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Map;
@@ -81,28 +82,28 @@ public final class BlockBucket implements ConfigurationSerializable {
this.input = new StringBuilder();
}
- public static BlockBucket withSingle(@NonNull final BlockState block) {
+ public static BlockBucket withSingle(@Nonnull final BlockState block) {
final BlockBucket blockBucket = new BlockBucket();
blockBucket.addBlock(block, 100);
return blockBucket;
}
- public static BlockBucket deserialize(@NonNull final Map map) {
+ public static BlockBucket deserialize(@Nonnull final Map map) {
if (!map.containsKey("blocks")) {
return null;
}
return ConfigurationUtil.BLOCK_BUCKET.parseString(map.get("blocks").toString());
}
- public void addBlock(@NonNull final BlockState block) {
+ public void addBlock(@Nonnull final BlockState block) {
this.addBlock(block, -1);
}
- public void addBlock(@NonNull final BlockState block, final int chance) {
+ public void addBlock(@Nonnull final BlockState block, final int chance) {
addBlock(block, (double) chance);
}
- private void addBlock(@NonNull final BlockState block, double chance) {
+ private void addBlock(@Nonnull final BlockState block, double chance) {
if (chance == -1)
chance = 1;
String prefix = input.length() == 0 ? "" : ",";
diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java
index 2f5048964..885078f06 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java
@@ -75,8 +75,8 @@ import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockTypes;
import lombok.Getter;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.awt.geom.Area;
import java.awt.geom.PathIterator;
@@ -126,7 +126,7 @@ public class Plot {
private static Set connected_cache;
private static Set regions_cache;
- @NotNull private final PlotId id;
+ @Nonnull private final PlotId id;
// These will be injected
@Inject private EventDispatcher eventDispatcher;
@@ -207,7 +207,7 @@ public class Plot {
* @param owner the plot owner
* @see Plot#getPlot(Location) for existing plots
*/
- public Plot(final PlotArea area, @NotNull final PlotId id, final UUID owner) {
+ public Plot(final PlotArea area, @Nonnull final PlotId id, final UUID owner) {
this(area, id, owner, 0);
}
@@ -219,7 +219,7 @@ public class Plot {
* @param id the plot id
* @see Plot#getPlot(Location) for existing plots
*/
- public Plot(@NotNull final PlotArea area, @NotNull final PlotId id) {
+ public Plot(@Nonnull final PlotArea area, @Nonnull final PlotId id) {
this(area, id, null, 0);
}
@@ -234,7 +234,7 @@ public class Plot {
* @param temp Represents whatever the database manager needs it to
* @see Plot#getPlot(Location) for existing plots
*/
- public Plot(final PlotArea area, @NotNull final PlotId id, final UUID owner, final int temp) {
+ public Plot(final PlotArea area, @Nonnull final PlotId id, final UUID owner, final int temp) {
this.area = area;
this.id = id;
this.owner = owner;
@@ -253,7 +253,7 @@ public class Plot {
* @param merged an array giving merged plots
* @see Plot#getPlot(Location) for existing plots
*/
- public Plot(@NotNull PlotId id, UUID owner, HashSet trusted, HashSet members,
+ public Plot(@Nonnull PlotId id, UUID owner, HashSet trusted, HashSet members,
HashSet denied, String alias, BlockLoc position, Collection> flags,
PlotArea area, boolean[] merged, long timestamp, int temp) {
this.id = id;
@@ -440,7 +440,7 @@ public class Plot {
* @param uuid the player uuid
* @return if the provided uuid is the owner of the plot
*/
- public boolean isOwner(@NotNull UUID uuid) {
+ public boolean isOwner(@Nonnull UUID uuid) {
if (uuid.equals(this.getOwner())) {
return true;
}
@@ -569,7 +569,7 @@ public class Plot {
*
* @return the PlotId for this plot
*/
- @NotNull public PlotId getId() {
+ @Nonnull public PlotId getId() {
return this.id;
}
@@ -1079,7 +1079,7 @@ public class Plot {
*
* @param name name
*/
- public void setSign(@NotNull String name) {
+ public void setSign(@Nonnull String name) {
if (!isLoaded()) {
return;
}
@@ -1733,7 +1733,7 @@ public class Plot {
return this.create(this.owner, true);
}
- public boolean claim(@NotNull final PlotPlayer player, boolean teleport, String schematic) {
+ public boolean claim(@Nonnull final PlotPlayer player, boolean teleport, String schematic) {
if (!canClaim(player)) {
PlotSquared.debug(Captions.PREFIX.getTranslated() + String
.format("Player %s attempted to claim plot %s, but was not allowed",
@@ -1743,7 +1743,7 @@ public class Plot {
return claim(player, teleport, schematic, true);
}
- public boolean claim(@NotNull final PlotPlayer player, boolean teleport, String schematic,
+ public boolean claim(@Nonnull final PlotPlayer player, boolean teleport, String schematic,
boolean updateDB) {
if (updateDB) {
@@ -1804,7 +1804,7 @@ public class Plot {
* @param notify notify
* @return true if plot was created successfully
*/
- public boolean create(@NotNull UUID uuid, final boolean notify) {
+ public boolean create(@Nonnull UUID uuid, final boolean notify) {
this.setOwnerAbs(uuid);
Plot existing = this.area.getOwnedPlotAbs(this.id);
if (existing != null) {
@@ -2366,7 +2366,7 @@ public class Plot {
*
* @param player the claiming player
*/
- public boolean canClaim(@NotNull PlotPlayer player) {
+ public boolean canClaim(@Nonnull PlotPlayer player) {
PlotCluster cluster = this.getCluster();
if (cluster != null) {
if (!cluster.isAdded(player.getUUID()) && !Permissions
@@ -2758,7 +2758,7 @@ public class Plot {
*
* @return
*/
- @NotNull public Set getRegions() {
+ @Nonnull public Set getRegions() {
if (regions_cache != null && connected_cache != null && connected_cache.contains(this)) {
return regions_cache;
}
@@ -2923,7 +2923,7 @@ public class Plot {
}, 1);
}
- public void debug(@NotNull final String message) {
+ public void debug(@Nonnull final String message) {
try {
final Collection> players = PlotPlayer.getDebugModePlayersInPlot(this);
if (players.isEmpty()) {
diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
index 920b9b650..86bb07791 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java
@@ -66,8 +66,8 @@ import com.sk89q.worldedit.world.gamemode.GameModes;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
@@ -88,13 +88,13 @@ import java.util.function.Consumer;
public abstract class PlotArea {
protected final ConcurrentHashMap plots = new ConcurrentHashMap<>();
- @Getter @NotNull private final String worldName;
+ @Getter @Nonnull private final String worldName;
@Getter private final String id;
- @Getter @NotNull private final PlotManager plotManager;
+ @Getter @Nonnull private final PlotManager plotManager;
@Getter private final int worldHash;
private final PlotId min;
private final PlotId max;
- @Getter @NotNull private final IndependentPlotGenerator generator;
+ @Getter @Nonnull private final IndependentPlotGenerator generator;
@Getter private int maxPlotMembers = 128;
@Getter private boolean autoMerge = false;
@Setter private boolean allowSigns = true;
@@ -139,11 +139,11 @@ public abstract class PlotArea {
private final GlobalBlockQueue globalBlockQueue;
private final EconHandler econHandler;
- public PlotArea(@NotNull final String worldName, @Nullable final String id,
- @NotNull IndependentPlotGenerator generator, @Nullable final PlotId min,
+ public PlotArea(@Nonnull final String worldName, @Nullable final String id,
+ @Nonnull IndependentPlotGenerator generator, @Nullable final PlotId min,
@Nullable final PlotId max,
@WorldConfig @Nullable final YamlConfiguration worldConfiguration,
- @NotNull final GlobalBlockQueue blockQueue,
+ @Nonnull final GlobalBlockQueue blockQueue,
@Nullable final EconHandler econHandler) {
this.worldName = worldName;
this.id = id;
@@ -166,7 +166,7 @@ public abstract class PlotArea {
this.econHandler = econHandler;
}
- @NotNull protected abstract PlotManager createManager();
+ @Nonnull protected abstract PlotManager createManager();
public LocalBlockQueue getQueue(final boolean autoQueue) {
return this.globalBlockQueue.getNewQueue(worldName, autoQueue);
@@ -246,7 +246,7 @@ public abstract class PlotArea {
* @param plotArea the {@code PlotArea} to compare
* @return true if both areas are compatible
*/
- public boolean isCompatible(@NotNull final PlotArea plotArea) {
+ public boolean isCompatible(@Nonnull final PlotArea plotArea) {
final ConfigurationSection section = this.worldConfiguration.getConfigurationSection("worlds");
for (ConfigurationNode setting : plotArea.getSettingNodes()) {
Object constant = section.get(plotArea.worldName + '.' + setting.getConstant());
@@ -489,7 +489,7 @@ public abstract class PlotArea {
}
}
- @NotNull @Override public String toString() {
+ @Nonnull @Override public String toString() {
if (this.getId() == null) {
return this.getWorldName();
} else {
@@ -517,7 +517,7 @@ public abstract class PlotArea {
* @param location the location
* @return the {@code Plot} or null if none exists
*/
- @Nullable public Plot getPlotAbs(@NotNull final Location location) {
+ @Nullable public Plot getPlotAbs(@Nonnull final Location location) {
final PlotId pid =
this.getPlotManager().getPlotId(location.getX(), location.getY(), location.getZ());
if (pid == null) {
@@ -532,7 +532,7 @@ public abstract class PlotArea {
* @param location the location
* @return base Plot
*/
- @Nullable public Plot getPlot(@NotNull final Location location) {
+ @Nullable public Plot getPlot(@Nonnull final Location location) {
final PlotId pid =
this.getPlotManager().getPlotId(location.getX(), location.getY(), location.getZ());
if (pid == null) {
@@ -547,7 +547,7 @@ public abstract class PlotArea {
* @param location the location
* @return the base plot or null
*/
- @Nullable public Plot getOwnedPlot(@NotNull final Location location) {
+ @Nullable public Plot getOwnedPlot(@Nonnull final Location location) {
final PlotId pid =
this.getPlotManager().getPlotId(location.getX(), location.getY(), location.getZ());
if (pid == null) {
@@ -563,7 +563,7 @@ public abstract class PlotArea {
* @param location the location
* @return Plot or null
*/
- @Nullable public Plot getOwnedPlotAbs(@NotNull final Location location) {
+ @Nullable public Plot getOwnedPlotAbs(@Nonnull final Location location) {
final PlotId pid =
this.getPlotManager().getPlotId(location.getX(), location.getY(), location.getZ());
if (pid == null) {
@@ -578,11 +578,11 @@ public abstract class PlotArea {
* @param id the {@code PlotId}
* @return the plot or null
*/
- @Nullable public Plot getOwnedPlotAbs(@NotNull final PlotId id) {
+ @Nullable public Plot getOwnedPlotAbs(@Nonnull final PlotId id) {
return this.plots.get(id);
}
- @Nullable public Plot getOwnedPlot(@NotNull final PlotId id) {
+ @Nullable public Plot getOwnedPlot(@Nonnull final PlotId id) {
Plot plot = this.plots.get(id);
return plot == null ? null : plot.getBasePlot(false);
}
@@ -591,17 +591,17 @@ public abstract class PlotArea {
return this.getType() != PlotAreaType.PARTIAL || RegionUtil.contains(getRegionAbs(), x, z);
}
- public boolean contains(@NotNull final PlotId id) {
+ public boolean contains(@Nonnull final PlotId id) {
return this.min == null || (id.x >= this.min.x && id.x <= this.max.x && id.y >= this.min.y
&& id.y <= this.max.y);
}
- public boolean contains(@NotNull final Location location) {
+ public boolean contains(@Nonnull final Location location) {
return StringMan.isEqual(location.getWorldName(), this.getWorldName()) && (
getRegionAbs() == null || this.region.contains(location.getBlockVector3()));
}
- @NotNull public Set getPlotsAbs(final UUID uuid) {
+ @Nonnull public Set getPlotsAbs(final UUID uuid) {
if (uuid == null) {
return Collections.emptySet();
}
@@ -614,7 +614,7 @@ public abstract class PlotArea {
return myPlots;
}
- @NotNull public Set getPlots(@NotNull final UUID uuid) {
+ @Nonnull public Set getPlots(@Nonnull final UUID uuid) {
return getPlots().stream().filter(plot -> plot.isBasePlot() && plot.isOwner(uuid))
.collect(ImmutableSet.toImmutableSet());
}
@@ -628,7 +628,7 @@ public abstract class PlotArea {
return this.plots.values();
}
- public int getPlotCount(@NotNull final UUID uuid) {
+ public int getPlotCount(@Nonnull final UUID uuid) {
if (!Settings.Done.COUNTS_TOWARDS_LIMIT) {
return (int) getPlotsAbs(uuid).stream().filter(plot -> !DoneFlag.isDone(plot)).count();
}
@@ -640,11 +640,11 @@ public abstract class PlotArea {
*
* @deprecated Use {@link #getPlots(UUID)}
*/
- @Deprecated public Set getPlots(@NotNull final PlotPlayer player) {
+ @Deprecated public Set getPlots(@Nonnull final PlotPlayer player) {
return getPlots(player.getUUID());
}
- public boolean hasPlot(@NotNull final UUID uuid) {
+ public boolean hasPlot(@Nonnull final UUID uuid) {
return this.plots.entrySet().stream().anyMatch(entry -> entry.getValue().isOwner(uuid));
}
@@ -654,7 +654,7 @@ public abstract class PlotArea {
return player != null ? getPlotCount(player.getUUID()) : 0;
}
- @Nullable public Plot getPlotAbs(@NotNull final PlotId id) {
+ @Nullable public Plot getPlotAbs(@Nonnull final PlotId id) {
Plot plot = getOwnedPlotAbs(id);
if (plot == null) {
if (this.min != null && (id.x < this.min.x || id.x > this.max.x || id.y < this.min.y
@@ -666,7 +666,7 @@ public abstract class PlotArea {
return plot;
}
- @Nullable public Plot getPlot(@NotNull final PlotId id) {
+ @Nullable public Plot getPlot(@Nonnull final PlotId id) {
final Plot plot = getOwnedPlotAbs(id);
if (plot == null) {
if (this.min != null && (id.x < this.min.x || id.x > this.max.x || id.y < this.min.y
@@ -687,7 +687,7 @@ public abstract class PlotArea {
return this.plots.size();
}
- @Nullable public PlotCluster getCluster(@NotNull final Location location) {
+ @Nullable public PlotCluster getCluster(@Nonnull final Location location) {
final Plot plot = getPlot(location);
if (plot == null) {
return null;
@@ -696,8 +696,8 @@ public abstract class PlotArea {
}
@Nullable
- public PlotCluster getFirstIntersectingCluster(@NotNull final PlotId pos1,
- @NotNull final PlotId pos2) {
+ public PlotCluster getFirstIntersectingCluster(@Nonnull final PlotId pos1,
+ @Nonnull final PlotId pos2) {
if (this.clusters == null) {
return null;
}
@@ -709,7 +709,7 @@ public abstract class PlotArea {
return null;
}
- @Nullable PlotCluster getCluster(@NotNull final PlotId id) {
+ @Nullable PlotCluster getCluster(@Nonnull final PlotId id) {
return this.clusters != null ? this.clusters.get(id.x, id.y) : null;
}
@@ -718,14 +718,14 @@ public abstract class PlotArea {
*
* For persistent metadata use the flag system
*/
- public void setMeta(@NotNull final String key, @Nullable final Object value) {
+ public void setMeta(@Nonnull final String key, @Nullable final Object value) {
if (this.meta == null) {
this.meta = new ConcurrentHashMap<>();
}
this.meta.put(key, value);
}
- @NotNull public T getMeta(@NotNull final String key, @NotNull final T def) {
+ @Nonnull public T getMeta(@Nonnull final String key, @Nonnull final T def) {
final Object v = getMeta(key);
return v == null ? def : (T) v;
}
@@ -735,14 +735,14 @@ public abstract class PlotArea {
*
* For persistent metadata use the flag system
*/
- @Nullable public Object getMeta(@NotNull final String key) {
+ @Nullable public Object getMeta(@Nonnull final String key) {
if (this.meta != null) {
return this.meta.get(key);
}
return null;
}
- @SuppressWarnings("unused") @NotNull public Set getBasePlots() {
+ @SuppressWarnings("unused") @Nonnull public Set getBasePlots() {
final HashSet myPlots = new HashSet<>(getPlots());
myPlots.removeIf(plot -> !plot.isBasePlot());
return myPlots;
@@ -775,15 +775,15 @@ public abstract class PlotArea {
* @deprecated Use {@link #getPlotsMap()}
*/
//todo eventually remove
- @Deprecated @NotNull public Map getPlotsRaw() {
+ @Deprecated @Nonnull public Map getPlotsRaw() {
return ImmutableMap.copyOf(plots);
}
- @NotNull public Set> getPlotEntries() {
+ @Nonnull public Set> getPlotEntries() {
return this.plots.entrySet();
}
- public boolean addPlot(@NotNull final Plot plot) {
+ public boolean addPlot(@Nonnull final Plot plot) {
for (PlotPlayer pp : plot.getPlayersInPlot()) {
pp.setMeta(PlotPlayer.META_LAST_PLOT, plot);
}
@@ -821,7 +821,7 @@ public abstract class PlotArea {
return null;
}
- public boolean addPlotIfAbsent(@NotNull final Plot plot) {
+ public boolean addPlotIfAbsent(@Nonnull final Plot plot) {
if (this.plots.putIfAbsent(plot.getId(), plot) == null) {
for (PlotPlayer pp : plot.getPlayersInPlot()) {
pp.setMeta(PlotPlayer.META_LAST_PLOT, plot);
@@ -831,7 +831,7 @@ public abstract class PlotArea {
return false;
}
- public boolean addPlotAbs(@NotNull final Plot plot) {
+ public boolean addPlotAbs(@Nonnull final Plot plot) {
return this.plots.put(plot.getId(), plot) == null;
}
@@ -876,14 +876,14 @@ public abstract class PlotArea {
*
* @param key Meta data key
*/
- public void deleteMeta(@NotNull final String key) {
+ public void deleteMeta(@Nonnull final String key) {
if (this.meta != null) {
this.meta.remove(key);
}
}
- public boolean canClaim(@Nullable final PlotPlayer player, @NotNull final PlotId pos1,
- @NotNull final PlotId pos2) {
+ public boolean canClaim(@Nullable final PlotPlayer player, @Nonnull final PlotId pos1,
+ @Nonnull final PlotId pos2) {
if (pos1.x == pos2.x && pos1.y == pos2.y) {
if (getOwnedPlot(pos1) != null) {
return false;
@@ -909,11 +909,11 @@ public abstract class PlotArea {
return true;
}
- public boolean removePlot(@NotNull final PlotId id) {
+ public boolean removePlot(@Nonnull final PlotId id) {
return this.plots.remove(id) != null;
}
- public boolean mergePlots(@NotNull final List plotIds, final boolean removeRoads) {
+ public boolean mergePlots(@Nonnull final List plotIds, final boolean removeRoads) {
if (plotIds.size() < 2) {
return false;
}
@@ -986,7 +986,7 @@ public abstract class PlotArea {
* @param pos2 second corner of selection
* @return the plots in the selection which are owned
*/
- public Set getPlotSelectionOwned(@NotNull final PlotId pos1, @NotNull final PlotId pos2) {
+ public Set getPlotSelectionOwned(@Nonnull final PlotId pos1, @Nonnull final PlotId pos2) {
final int size = (1 + pos2.x - pos1.x) * (1 + pos2.y - pos1.y);
final Set result = new HashSet<>();
if (size < 16 || size < getPlotCount()) {
@@ -1048,7 +1048,7 @@ public abstract class PlotArea {
* @param schematic the schematic to look for.
* @return true if the schematic exists, false otherwise.
*/
- public boolean hasSchematic(@NotNull String schematic) {
+ public boolean hasSchematic(@Nonnull String schematic) {
return getSchematics().contains(schematic.toLowerCase());
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotCluster.java b/Core/src/main/java/com/plotsquared/core/plot/PlotCluster.java
index 917259ef6..ea7484129 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/PlotCluster.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/PlotCluster.java
@@ -31,7 +31,7 @@ import com.plotsquared.core.location.Location;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.RegionUtil;
import com.sk89q.worldedit.regions.CuboidRegion;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.HashSet;
import java.util.UUID;
@@ -152,7 +152,7 @@ public class PlotCluster {
+ this.pos2.y;
}
- public void getHome(@NotNull final Consumer result) {
+ public void getHome(@Nonnull final Consumer result) {
final BlockLoc home = this.settings.getPosition();
Consumer locationConsumer = toReturn ->
MainUtil.getHighestBlock(this.area.getWorldName(), toReturn.getX(), toReturn.getZ(),
diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotId.java b/Core/src/main/java/com/plotsquared/core/plot/PlotId.java
index 41016da1f..3327c1473 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/PlotId.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/PlotId.java
@@ -26,8 +26,8 @@
package com.plotsquared.core.plot;
import com.plotsquared.core.location.Direction;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
public class PlotId {
@@ -53,14 +53,14 @@ public class PlotId {
* @return the PlotId representation of the arguement
* @throws IllegalArgumentException if the string does not contain a valid PlotId
*/
- @NotNull public static PlotId fromString(@NotNull String string) {
+ @Nonnull public static PlotId fromString(@Nonnull String string) {
PlotId plot = fromStringOrNull(string);
if (plot == null)
throw new IllegalArgumentException("Cannot create PlotID. String invalid.");
return plot;
}
- @Nullable public static PlotId fromStringOrNull(@NotNull String string) {
+ @Nullable public static PlotId fromStringOrNull(@Nonnull String string) {
String[] parts = string.split("[;,.]");
if (parts.length < 2) {
return null;
diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java b/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java
index 3ef2f1c74..df6155b4e 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java
@@ -28,8 +28,8 @@ package com.plotsquared.core.plot;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.util.InventoryUtil;
-import lombok.NonNull;
-import org.jetbrains.annotations.NotNull;
+
+import javax.annotation.Nonnull;
public class PlotInventory {
@@ -41,7 +41,8 @@ public class PlotInventory {
private boolean open = false;
private final InventoryUtil inventoryUtil;
- public PlotInventory(@NotNull final InventoryUtil inventoryUtil, PlotPlayer> player, int size, String name) {
+ public PlotInventory(@Nonnull final InventoryUtil inventoryUtil,
+ PlotPlayer> player, int size, String name) {
this.size = size;
this.title = name == null ? "" : name;
this.player = player;
@@ -49,20 +50,20 @@ public class PlotInventory {
this.inventoryUtil = inventoryUtil;
}
- public static boolean hasPlotInventoryOpen(@NonNull final PlotPlayer> plotPlayer) {
+ public static boolean hasPlotInventoryOpen(@Nonnull final PlotPlayer> plotPlayer) {
return getOpenPlotInventory(plotPlayer) != null;
}
- public static PlotInventory getOpenPlotInventory(@NonNull final PlotPlayer> plotPlayer) {
+ public static PlotInventory getOpenPlotInventory(@Nonnull final PlotPlayer> plotPlayer) {
return plotPlayer.getMeta(META_KEY, null);
}
- public static void setPlotInventoryOpen(@NonNull final PlotPlayer> plotPlayer,
- @NonNull final PlotInventory plotInventory) {
+ public static void setPlotInventoryOpen(@Nonnull final PlotPlayer> plotPlayer,
+ @Nonnull final PlotInventory plotInventory) {
plotPlayer.setMeta(META_KEY, plotInventory);
}
- public static void removePlotInventoryOpen(@NonNull final PlotPlayer>plotPlayer) {
+ public static void removePlotInventoryOpen(@Nonnull final PlotPlayer>plotPlayer) {
plotPlayer.deleteMeta(META_KEY);
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java b/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java
index ed7b854c2..76f9d4c9f 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java
@@ -28,8 +28,8 @@ package com.plotsquared.core.plot;
import com.plotsquared.core.location.Location;
import com.sk89q.worldedit.regions.CuboidRegion;
import lombok.EqualsAndHashCode;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.Collection;
@@ -46,7 +46,7 @@ public abstract class PlotWorld {
*
* @param world World name
*/
- protected PlotWorld(@NotNull final String world) {
+ protected PlotWorld(@Nonnull final String world) {
this.world = world;
}
@@ -57,14 +57,14 @@ public abstract class PlotWorld {
* @param location Location
* @return Containing plot area, or null
*/
- @Nullable public abstract PlotArea getArea(@NotNull final Location location);
+ @Nullable public abstract PlotArea getArea(@Nonnull final Location location);
/**
* Get all plot areas in the world
*
* @return All plot areas in the world
*/
- @NotNull public abstract Collection getAreas();
+ @Nonnull public abstract Collection getAreas();
/**
* Get all plot areas in a specified region
@@ -72,15 +72,15 @@ public abstract class PlotWorld {
* @param region Region
* @return All areas in the region
*/
- @NotNull public abstract Collection getAreasInRegion(
- @NotNull final CuboidRegion region);
+ @Nonnull public abstract Collection getAreasInRegion(
+ @Nonnull final CuboidRegion region);
/**
* Register a new area in the world
*
* @param area Plot area
*/
- public void addArea(@NotNull final PlotArea area) {
+ public void addArea(@Nonnull final PlotArea area) {
throw new UnsupportedOperationException("This world type does not allow adding new areas");
}
@@ -89,7 +89,7 @@ public abstract class PlotWorld {
*
* @param area Plot area
*/
- public void removeArea(@NotNull final PlotArea area) {
+ public void removeArea(@Nonnull final PlotArea area) {
throw new UnsupportedOperationException("This world type does not allow removing areas");
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java b/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java
index 6eba78367..6448a1b6c 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java
@@ -48,7 +48,7 @@ import com.plotsquared.core.util.query.PlotQuery;
import com.plotsquared.core.util.task.RunnableVal;
import com.plotsquared.core.util.task.RunnableVal3;
import com.plotsquared.core.util.task.TaskManager;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.ArrayDeque;
import java.util.ArrayList;
@@ -76,7 +76,7 @@ public class ExpireManager {
*/
private int running;
- public ExpireManager(@NotNull final EventDispatcher eventDispatcher) {
+ public ExpireManager(@Nonnull final EventDispatcher eventDispatcher) {
this.tasks = new ArrayDeque<>();
this.dates_cache = new ConcurrentHashMap<>();
this.account_age_cache = new ConcurrentHashMap<>();
diff --git a/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpiryTask.java b/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpiryTask.java
index e1802d9b7..022a3dc93 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpiryTask.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpiryTask.java
@@ -30,7 +30,7 @@ import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.world.PlotAreaManager;
import com.plotsquared.core.util.query.PlotQuery;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collection;
@@ -47,7 +47,7 @@ public class ExpiryTask {
private final PlotAreaManager plotAreaManager;
private long cutoffThreshold = Long.MIN_VALUE;
- public ExpiryTask(@NotNull final Settings.Auto_Clear settings, @NotNull final PlotAreaManager plotAreaManager) {
+ public ExpiryTask(final Settings.Auto_Clear settings, @Nonnull final PlotAreaManager plotAreaManager) {
this.settings = settings;
this.plotAreaManager = plotAreaManager;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java b/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java
index e0bb40fb8..5c11a258b 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java
@@ -30,8 +30,8 @@ import com.google.common.collect.ImmutableMap;
import com.plotsquared.core.PlotSquared;
import lombok.EqualsAndHashCode;
import lombok.Setter;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
@@ -284,7 +284,7 @@ import java.util.Map;
* @param plotFlagUpdateHandler The update handler which will react to changes.
* @see PlotFlagUpdateType Plot flag update types
*/
- public void subscribe(@NotNull final PlotFlagUpdateHandler plotFlagUpdateHandler) {
+ public void subscribe(@Nonnull final PlotFlagUpdateHandler plotFlagUpdateHandler) {
this.updateSubscribers.add(plotFlagUpdateHandler);
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/PlotFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/PlotFlag.java
index af3306b25..1007726df 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/PlotFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/PlotFlag.java
@@ -29,7 +29,7 @@ import com.google.common.base.Preconditions;
import com.plotsquared.core.configuration.Caption;
import com.plotsquared.core.configuration.Captions;
import lombok.EqualsAndHashCode;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Collections;
@@ -55,8 +55,8 @@ import java.util.Collections;
* @param flagCategory The flag category
* @param flagDescription A caption describing the flag functionality
*/
- protected PlotFlag(@NotNull final T value, @NotNull final Caption flagCategory,
- @NotNull final Caption flagDescription) {
+ protected PlotFlag(@Nonnull final T value, @Nonnull final Caption flagCategory,
+ @Nonnull final Caption flagDescription) {
this.value = Preconditions.checkNotNull(value, "flag value may not be null");
this.flagCategory =
Preconditions.checkNotNull(flagCategory, "flag category may not be null");
@@ -82,7 +82,7 @@ import java.util.Collections;
*
* @return Non-nullable flag value
*/
- @NotNull public final T getValue() {
+ @Nonnull public final T getValue() {
return this.value;
}
@@ -95,7 +95,7 @@ import java.util.Collections;
* @return Parsed value, if valid.
* @throws FlagParseException If the value could not be parsed.
*/
- public abstract F parse(@NotNull final String input) throws FlagParseException;
+ public abstract F parse(@Nonnull final String input) throws FlagParseException;
/**
* Merge this flag's value with another value and return an instance
@@ -104,7 +104,7 @@ import java.util.Collections;
* @param newValue New flag value.
* @return Flag containing parsed flag value.
*/
- public abstract F merge(@NotNull final T newValue);
+ public abstract F merge(@Nonnull final T newValue);
/**
* Returns a string representation of the flag instance, that when
@@ -154,7 +154,7 @@ import java.util.Collections;
*/
public abstract String getExample();
- protected abstract F flagOf(@NotNull T value);
+ protected abstract F flagOf(@Nonnull T value);
/**
* Create a new instance of the flag using a provided
@@ -163,7 +163,7 @@ import java.util.Collections;
* @param value The flag value
* @return The created flag instance
*/
- public final F createFlagInstance(@NotNull final T value) {
+ public final F createFlagInstance(@Nonnull final T value) {
return flagOf(Preconditions.checkNotNull(value));
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnalysisFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnalysisFlag.java
index 133f56df9..173d8caf2 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnalysisFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnalysisFlag.java
@@ -29,7 +29,7 @@ import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.InternalFlag;
import com.plotsquared.core.plot.flag.types.ListFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
@@ -40,7 +40,7 @@ public class AnalysisFlag extends ListFlag implements Int
super(valueList, Captions.NONE, Captions.NONE);
}
- @Override public AnalysisFlag parse(@NotNull String input) throws FlagParseException {
+ @Override public AnalysisFlag parse(@Nonnull String input) throws FlagParseException {
final String[] split = input.split(",");
final List numbers = new ArrayList<>();
for (final String element : split) {
@@ -53,7 +53,7 @@ public class AnalysisFlag extends ListFlag implements Int
return "";
}
- @Override protected AnalysisFlag flagOf(@NotNull List value) {
+ @Override protected AnalysisFlag flagOf(@Nonnull List value) {
return new AnalysisFlag(value);
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalAttackFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalAttackFlag.java
index 1ae0abc12..8eb750aa7 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalAttackFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalAttackFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class AnimalAttackFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class AnimalAttackFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_ANIMAL_ATTACK);
}
- @Override protected AnimalAttackFlag flagOf(@NotNull Boolean value) {
+ @Override protected AnimalAttackFlag flagOf(@Nonnull Boolean value) {
return value ? ANIMAL_ATTACK_TRUE : ANIMAL_ATTACK_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalCapFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalCapFlag.java
index 228ea94aa..78bdf65b2 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalCapFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalCapFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class AnimalCapFlag extends NonNegativeIntegerFlag {
public static final AnimalCapFlag ANIMAL_CAP_UNLIMITED = new AnimalCapFlag(Integer.MAX_VALUE);
@@ -36,7 +36,7 @@ public class AnimalCapFlag extends NonNegativeIntegerFlag {
super(value, Captions.FLAG_DESCRIPTION_ANIMAL_CAP);
}
- @Override protected AnimalCapFlag flagOf(@NotNull Integer value) {
+ @Override protected AnimalCapFlag flagOf(@Nonnull Integer value) {
return new AnimalCapFlag(value);
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalInteractFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalInteractFlag.java
index f19a479d3..00c854f88 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalInteractFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/AnimalInteractFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class AnimalInteractFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class AnimalInteractFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_ANIMAL_INTERACT);
}
- @Override protected AnimalInteractFlag flagOf(@NotNull Boolean value) {
+ @Override protected AnimalInteractFlag flagOf(@Nonnull Boolean value) {
return value ? ANIMAL_INTERACT_TRUE : ANIMAL_INTERACT_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockBurnFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockBurnFlag.java
index ac50b91b3..202513067 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockBurnFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockBurnFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class BlockBurnFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class BlockBurnFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_BLOCK_BURN);
}
- @Override protected BlockBurnFlag flagOf(@NotNull Boolean value) {
+ @Override protected BlockBurnFlag flagOf(@Nonnull Boolean value) {
return value ? BLOCK_BURN_TRUE : BLOCK_BURN_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockIgnitionFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockIgnitionFlag.java
index 4a2b7e205..add18aebf 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockIgnitionFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockIgnitionFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class BlockIgnitionFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class BlockIgnitionFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_BLOCK_IGNITION);
}
- @Override protected BlockIgnitionFlag flagOf(@NotNull Boolean value) {
+ @Override protected BlockIgnitionFlag flagOf(@Nonnull Boolean value) {
return value ? BLOCK_IGNITION_TRUE : BLOCK_IGNITION_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockedCmdsFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockedCmdsFlag.java
index d5b3eeca6..1bcdb39c2 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockedCmdsFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockedCmdsFlag.java
@@ -28,7 +28,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.types.ListFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collections;
@@ -44,7 +44,7 @@ public class BlockedCmdsFlag extends ListFlag {
Captions.FLAG_DESCRIPTION_BLOCKED_CMDS);
}
- @Override public BlockedCmdsFlag parse(@NotNull String input) throws FlagParseException {
+ @Override public BlockedCmdsFlag parse(@Nonnull String input) throws FlagParseException {
return flagOf(Arrays.asList(input.split(",")));
}
@@ -52,7 +52,7 @@ public class BlockedCmdsFlag extends ListFlag {
return "gamemode survival, spawn";
}
- @Override protected BlockedCmdsFlag flagOf(@NotNull List value) {
+ @Override protected BlockedCmdsFlag flagOf(@Nonnull List value) {
return new BlockedCmdsFlag(value);
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BreakFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BreakFlag.java
index 5acf7d489..c005efe5f 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BreakFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BreakFlag.java
@@ -28,7 +28,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BlockTypeListFlag;
import com.plotsquared.core.plot.flag.types.BlockTypeWrapper;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
@@ -41,7 +41,7 @@ public class BreakFlag extends BlockTypeListFlag {
super(blockTypeList, Captions.FLAG_DESCRIPTION_BREAK);
}
- @Override protected BreakFlag flagOf(@NotNull List value) {
+ @Override protected BreakFlag flagOf(@Nonnull List value) {
return new BreakFlag(value);
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ChatFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ChatFlag.java
index 81da5294a..8975375b0 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ChatFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ChatFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class ChatFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class ChatFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_CHAT);
}
- @Override protected ChatFlag flagOf(@NotNull Boolean value) {
+ @Override protected ChatFlag flagOf(@Nonnull Boolean value) {
return value ? CHAT_FLAG_TRUE : CHAT_FLAG_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/CoralDryFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/CoralDryFlag.java
index 84e98f9d6..da501eb6c 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/CoralDryFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/CoralDryFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class CoralDryFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class CoralDryFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_CORAL_DRY);
}
- @Override protected CoralDryFlag flagOf(@NotNull Boolean value) {
+ @Override protected CoralDryFlag flagOf(@Nonnull Boolean value) {
return value ? CORAL_DRY_TRUE : CORAL_DRY_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DenyExitFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DenyExitFlag.java
index 17fe9f0e8..107cc360d 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DenyExitFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DenyExitFlag.java
@@ -27,7 +27,8 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+
+import javax.annotation.Nonnull;
public class DenyExitFlag extends BooleanFlag {
@@ -38,7 +39,7 @@ public class DenyExitFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_DENY_EXIT);
}
- @Override protected DenyExitFlag flagOf(@NotNull Boolean value) {
+ @Override protected DenyExitFlag flagOf(@Nonnull Boolean value) {
return value ? DENY_EXIT_FLAG_TRUE : DENY_EXIT_FLAG_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DenyTeleportFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DenyTeleportFlag.java
index ba923c396..e02a1b0e8 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DenyTeleportFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DenyTeleportFlag.java
@@ -30,8 +30,8 @@ import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.PlotFlag;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.Collection;
@@ -46,7 +46,7 @@ public class DenyTeleportFlag extends PlotFlag {
public static final DescriptionFlag DESCRIPTION_FLAG_EMPTY = new DescriptionFlag("");
- protected DescriptionFlag(@NotNull String value) {
+ protected DescriptionFlag(@Nonnull String value) {
super(value, Captions.FLAG_CATEGORY_STRING, Captions.FLAG_DESCRIPTION_DESCRIPTION);
}
- @Override public DescriptionFlag parse(@NotNull String input) {
+ @Override public DescriptionFlag parse(@Nonnull String input) {
return flagOf(input);
}
- @Override public DescriptionFlag merge(@NotNull String newValue) {
+ @Override public DescriptionFlag merge(@Nonnull String newValue) {
return flagOf(this.getValue() + " " + newValue);
}
@@ -53,7 +53,7 @@ public class DescriptionFlag extends PlotFlag {
return "&6This is my plot!";
}
- @Override protected DescriptionFlag flagOf(@NotNull String value) {
+ @Override protected DescriptionFlag flagOf(@Nonnull String value) {
return new DescriptionFlag(value);
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DeviceInteractFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DeviceInteractFlag.java
index f43e1e27a..981c4bfe4 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DeviceInteractFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DeviceInteractFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class DeviceInteractFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class DeviceInteractFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_DEVICE_INTERACT);
}
- @Override protected DeviceInteractFlag flagOf(@NotNull Boolean value) {
+ @Override protected DeviceInteractFlag flagOf(@Nonnull Boolean value) {
return value ? DEVICE_INTERACT_TRUE : DEVICE_INTERACT_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DisablePhysicsFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DisablePhysicsFlag.java
index f1d952260..a0578b1fe 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DisablePhysicsFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DisablePhysicsFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class DisablePhysicsFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class DisablePhysicsFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_DISABLE_PHYSICS);
}
- @Override protected DisablePhysicsFlag flagOf(@NotNull Boolean value) {
+ @Override protected DisablePhysicsFlag flagOf(@Nonnull Boolean value) {
return value ? DISABLE_PHYSICS_TRUE : DISABLE_PHYSICS_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DoneFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DoneFlag.java
index 390ae4ba7..be94170fe 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DoneFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DoneFlag.java
@@ -29,7 +29,7 @@ import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.flag.InternalFlag;
import com.plotsquared.core.plot.flag.PlotFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class DoneFlag extends PlotFlag implements InternalFlag {
@@ -38,7 +38,7 @@ public class DoneFlag extends PlotFlag implements InternalFlag
*
* @param value Flag value
*/
- public DoneFlag(@NotNull String value) {
+ public DoneFlag(@Nonnull String value) {
super(value, Captions.NONE, Captions.NONE);
}
@@ -46,11 +46,11 @@ public class DoneFlag extends PlotFlag implements InternalFlag
return !plot.getFlag(DoneFlag.class).isEmpty();
}
- @Override public DoneFlag parse(@NotNull String input) {
+ @Override public DoneFlag parse(@Nonnull String input) {
return flagOf(input);
}
- @Override public DoneFlag merge(@NotNull String newValue) {
+ @Override public DoneFlag merge(@Nonnull String newValue) {
return flagOf(newValue);
}
@@ -62,7 +62,7 @@ public class DoneFlag extends PlotFlag implements InternalFlag
return "";
}
- @Override protected DoneFlag flagOf(@NotNull String value) {
+ @Override protected DoneFlag flagOf(@Nonnull String value) {
return new DoneFlag(value);
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DropProtectionFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DropProtectionFlag.java
index a210af66e..785d29b6e 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DropProtectionFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DropProtectionFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class DropProtectionFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class DropProtectionFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_DROP_PROTECTION);
}
- @Override protected DropProtectionFlag flagOf(@NotNull Boolean value) {
+ @Override protected DropProtectionFlag flagOf(@Nonnull Boolean value) {
return value ? DROP_PROTECTION_TRUE : DROP_PROTECTION_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/EntityCapFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/EntityCapFlag.java
index e20e2dded..13b7b4d21 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/EntityCapFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/EntityCapFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class EntityCapFlag extends NonNegativeIntegerFlag {
public static final EntityCapFlag ENTITY_CAP_UNLIMITED = new EntityCapFlag(Integer.MAX_VALUE);
@@ -36,7 +36,7 @@ public class EntityCapFlag extends NonNegativeIntegerFlag {
super(value, Captions.FLAG_DESCRIPTION_ENTITY_CAP);
}
- @Override protected EntityCapFlag flagOf(@NotNull Integer value) {
+ @Override protected EntityCapFlag flagOf(@Nonnull Integer value) {
return new EntityCapFlag(value);
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ExplosionFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ExplosionFlag.java
index 0f1f04a54..ed611d57d 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ExplosionFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ExplosionFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class ExplosionFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class ExplosionFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_EXPLOSION);
}
- @Override protected ExplosionFlag flagOf(@NotNull Boolean value) {
+ @Override protected ExplosionFlag flagOf(@Nonnull Boolean value) {
return value ? EXPLOSION_TRUE : EXPLOSION_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FarewellFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FarewellFlag.java
index 625f41cb8..1231d64a4 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FarewellFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FarewellFlag.java
@@ -27,21 +27,21 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.PlotFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class FarewellFlag extends PlotFlag {
public static final FarewellFlag FAREWELL_FLAG_EMPTY = new FarewellFlag("");
- protected FarewellFlag(@NotNull String value) {
+ protected FarewellFlag(@Nonnull String value) {
super(value, Captions.FLAG_CATEGORY_STRING, Captions.FLAG_DESCRIPTION_FAREWELL);
}
- @Override public FarewellFlag parse(@NotNull String input) {
+ @Override public FarewellFlag parse(@Nonnull String input) {
return flagOf(input);
}
- @Override public FarewellFlag merge(@NotNull String newValue) {
+ @Override public FarewellFlag merge(@Nonnull String newValue) {
return flagOf(this.getValue() + " " + newValue);
}
@@ -53,7 +53,7 @@ public class FarewellFlag extends PlotFlag {
return "&cBye :(";
}
- @Override protected FarewellFlag flagOf(@NotNull String value) {
+ @Override protected FarewellFlag flagOf(@Nonnull String value) {
return new FarewellFlag(value);
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FeedFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FeedFlag.java
index 11a0cac4a..05164b8d2 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FeedFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FeedFlag.java
@@ -28,12 +28,12 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.types.TimedFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class FeedFlag extends TimedFlag {
public static final FeedFlag FEED_NOTHING = new FeedFlag(new Timed<>(0, 0));
- public FeedFlag(@NotNull Timed value) {
+ public FeedFlag(@Nonnull Timed value) {
super(value, 1, Captions.FLAG_DESCRIPTION_FEED);
}
@@ -58,7 +58,7 @@ public class FeedFlag extends TimedFlag {
return "10 5";
}
- @Override protected FeedFlag flagOf(@NotNull Timed value) {
+ @Override protected FeedFlag flagOf(@Nonnull Timed value) {
return new FeedFlag(value);
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FlyFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FlyFlag.java
index ffe72a7b4..478e17858 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FlyFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/FlyFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.PlotFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collection;
@@ -42,7 +42,7 @@ public class FlyFlag extends PlotFlag {
super(value, Captions.FLAG_CATEGORY_BOOLEAN, Captions.FLAG_DESCRIPTION_FLIGHT);
}
- @Override public FlyFlag parse(@NotNull final String input) {
+ @Override public FlyFlag parse(@Nonnull final String input) {
switch (input.toLowerCase()) {
case "true":
case "enabled":
@@ -57,7 +57,7 @@ public class FlyFlag extends PlotFlag {
}
}
- @Override public FlyFlag merge(@NotNull final FlyStatus newValue) {
+ @Override public FlyFlag merge(@Nonnull final FlyStatus newValue) {
if (newValue == FlyStatus.ENABLED || this.getValue() == FlyStatus.ENABLED) {
return FLIGHT_FLAG_ENABLED;
}
@@ -72,7 +72,7 @@ public class FlyFlag extends PlotFlag {
return "true";
}
- @Override protected FlyFlag flagOf(@NotNull final FlyStatus value) {
+ @Override protected FlyFlag flagOf(@Nonnull final FlyStatus value) {
switch (value) {
case ENABLED:
return FLIGHT_FLAG_ENABLED;
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ForcefieldFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ForcefieldFlag.java
index f8c985238..98136a7b3 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ForcefieldFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ForcefieldFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class ForcefieldFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class ForcefieldFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_FORCEFIELD);
}
- @Override protected ForcefieldFlag flagOf(@NotNull Boolean value) {
+ @Override protected ForcefieldFlag flagOf(@Nonnull Boolean value) {
return value ? FORCEFIELD_TRUE : FORCEFIELD_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GamemodeFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GamemodeFlag.java
index 60fdb4a0a..4c6b60020 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GamemodeFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GamemodeFlag.java
@@ -30,7 +30,7 @@ import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.PlotFlag;
import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.gamemode.GameModes;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class GamemodeFlag extends PlotFlag {
@@ -52,11 +52,11 @@ public class GamemodeFlag extends PlotFlag {
*
* @param value Flag value
*/
- protected GamemodeFlag(@NotNull GameMode value) {
+ protected GamemodeFlag(@Nonnull GameMode value) {
super(value, Captions.FLAG_CATEGORY_GAMEMODE, Captions.FLAG_DESCRIPTION_GAMEMODE);
}
- @Override public GamemodeFlag parse(@NotNull String input) throws FlagParseException {
+ @Override public GamemodeFlag parse(@Nonnull String input) throws FlagParseException {
switch (input) {
case "creative":
case "c":
@@ -79,7 +79,7 @@ public class GamemodeFlag extends PlotFlag {
}
}
- @Override public GamemodeFlag merge(@NotNull GameMode newValue) {
+ @Override public GamemodeFlag merge(@Nonnull GameMode newValue) {
return flagOf(newValue);
}
@@ -91,7 +91,7 @@ public class GamemodeFlag extends PlotFlag {
return "survival";
}
- @Override protected GamemodeFlag flagOf(@NotNull GameMode value) {
+ @Override protected GamemodeFlag flagOf(@Nonnull GameMode value) {
switch (value.getId()) {
case "creative":
return GAMEMODE_FLAG_CREATIVE;
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GrassGrowFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GrassGrowFlag.java
index 7cb823667..ad63de5ee 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GrassGrowFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GrassGrowFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class GrassGrowFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class GrassGrowFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_GRASS_GROW);
}
- @Override protected GrassGrowFlag flagOf(@NotNull Boolean value) {
+ @Override protected GrassGrowFlag flagOf(@Nonnull Boolean value) {
return value ? GRASS_GROW_TRUE : GRASS_GROW_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GreetingFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GreetingFlag.java
index 0097defa8..3c6cc0163 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GreetingFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GreetingFlag.java
@@ -27,21 +27,21 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.PlotFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class GreetingFlag extends PlotFlag {
public static final GreetingFlag GREETING_FLAG_EMPTY = new GreetingFlag("");
- protected GreetingFlag(@NotNull String value) {
+ protected GreetingFlag(@Nonnull String value) {
super(value, Captions.FLAG_CATEGORY_STRING, Captions.FLAG_DESCRIPTION_GREETING);
}
- @Override public GreetingFlag parse(@NotNull String input) {
+ @Override public GreetingFlag parse(@Nonnull String input) {
return flagOf(input);
}
- @Override public GreetingFlag merge(@NotNull String newValue) {
+ @Override public GreetingFlag merge(@Nonnull String newValue) {
return flagOf(this.getValue() + " " + newValue);
}
@@ -53,7 +53,7 @@ public class GreetingFlag extends PlotFlag {
return "&6Welcome to my plot!";
}
- @Override protected GreetingFlag flagOf(@NotNull String value) {
+ @Override protected GreetingFlag flagOf(@Nonnull String value) {
return new GreetingFlag(value);
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GuestGamemodeFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GuestGamemodeFlag.java
index 8b320200e..090b056ea 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GuestGamemodeFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/GuestGamemodeFlag.java
@@ -30,7 +30,7 @@ import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.PlotFlag;
import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.gamemode.GameModes;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class GuestGamemodeFlag extends PlotFlag {
@@ -50,11 +50,11 @@ public class GuestGamemodeFlag extends PlotFlag {
*
* @param value Flag value
*/
- protected GuestGamemodeFlag(@NotNull GameMode value) {
+ protected GuestGamemodeFlag(@Nonnull GameMode value) {
super(value, Captions.FLAG_CATEGORY_GAMEMODE, Captions.FLAG_DESCRIPTION_GUEST_GAMEMODE);
}
- @Override public GuestGamemodeFlag parse(@NotNull String input) throws FlagParseException {
+ @Override public GuestGamemodeFlag parse(@Nonnull String input) throws FlagParseException {
switch (input) {
case "creative":
case "c":
@@ -77,7 +77,7 @@ public class GuestGamemodeFlag extends PlotFlag {
}
}
- @Override public GuestGamemodeFlag merge(@NotNull GameMode newValue) {
+ @Override public GuestGamemodeFlag merge(@Nonnull GameMode newValue) {
return flagOf(newValue);
}
@@ -89,7 +89,7 @@ public class GuestGamemodeFlag extends PlotFlag {
return "survival";
}
- @Override protected GuestGamemodeFlag flagOf(@NotNull GameMode value) {
+ @Override protected GuestGamemodeFlag flagOf(@Nonnull GameMode value) {
switch (value.getId()) {
case "creative":
return GUEST_GAMEMODE_FLAG_CREATIVE;
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HangingBreakFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HangingBreakFlag.java
index f7a07a28a..ca7f1fb37 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HangingBreakFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HangingBreakFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class HangingBreakFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class HangingBreakFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_HANGING_BREAK);
}
- @Override protected HangingBreakFlag flagOf(@NotNull Boolean value) {
+ @Override protected HangingBreakFlag flagOf(@Nonnull Boolean value) {
return value ? HANGING_BREAK_TRUE : HANGING_BREAK_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HangingPlaceFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HangingPlaceFlag.java
index 14923a319..eb3441ee1 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HangingPlaceFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HangingPlaceFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class HangingPlaceFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class HangingPlaceFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_HANGING_PLACE);
}
- @Override protected HangingPlaceFlag flagOf(@NotNull Boolean value) {
+ @Override protected HangingPlaceFlag flagOf(@Nonnull Boolean value) {
return value ? HANGING_PLACE_TRUE : HANGING_PLACE_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HealFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HealFlag.java
index 90e5fbabb..e683b82a6 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HealFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HealFlag.java
@@ -28,12 +28,12 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.types.TimedFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class HealFlag extends TimedFlag {
public static final HealFlag HEAL_NOTHING = new HealFlag(new Timed<>(0, 0));
- protected HealFlag(@NotNull Timed value) {
+ protected HealFlag(@Nonnull Timed value) {
super(value, 1, Captions.FLAG_DESCRIPTION_HEAL);
}
@@ -58,7 +58,7 @@ public class HealFlag extends TimedFlag {
return "20 2";
}
- @Override protected HealFlag flagOf(@NotNull Timed value) {
+ @Override protected HealFlag flagOf(@Nonnull Timed value) {
return new HealFlag(value);
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HideInfoFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HideInfoFlag.java
index d382cac8f..81d85906f 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HideInfoFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HideInfoFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class HideInfoFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class HideInfoFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_HIDE_INFO);
}
- @Override protected HideInfoFlag flagOf(@NotNull Boolean value) {
+ @Override protected HideInfoFlag flagOf(@Nonnull Boolean value) {
return value ? HIDE_INFO_TRUE : HIDE_INFO_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileAttackFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileAttackFlag.java
index 9ec805814..da5e8e4af 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileAttackFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileAttackFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class HostileAttackFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class HostileAttackFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_HOSTILE_ATTACK);
}
- @Override protected HostileAttackFlag flagOf(@NotNull Boolean value) {
+ @Override protected HostileAttackFlag flagOf(@Nonnull Boolean value) {
return value ? HOSTILE_ATTACK_TRUE : HOSTILE_ATTACK_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileCapFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileCapFlag.java
index 017e3736a..9d442bb00 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileCapFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileCapFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class HostileCapFlag extends NonNegativeIntegerFlag {
public static final HostileCapFlag HOSTILE_CAP_UNLIMITED =
@@ -37,7 +37,7 @@ public class HostileCapFlag extends NonNegativeIntegerFlag {
super(value, Captions.FLAG_DESCRIPTION_HOSTILE_CAP);
}
- @Override protected HostileCapFlag flagOf(@NotNull Integer value) {
+ @Override protected HostileCapFlag flagOf(@Nonnull Integer value) {
return new HostileCapFlag(value);
}
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileInteractFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileInteractFlag.java
index 96ce742b9..e903cd76c 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileInteractFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/HostileInteractFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class HostileInteractFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class HostileInteractFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_HOSTILE_INTERACT);
}
- @Override protected HostileInteractFlag flagOf(@NotNull Boolean value) {
+ @Override protected HostileInteractFlag flagOf(@Nonnull Boolean value) {
return value ? HOSTILE_INTERACT_TRUE : HOSTILE_INTERACT_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/IceFormFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/IceFormFlag.java
index a0f54097e..b380d0773 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/IceFormFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/IceFormFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class IceFormFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class IceFormFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_ICE_FORM);
}
- @Override protected IceFormFlag flagOf(@NotNull Boolean value) {
+ @Override protected IceFormFlag flagOf(@Nonnull Boolean value) {
return value ? ICE_FORM_TRUE : ICE_FORM_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/IceMeltFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/IceMeltFlag.java
index 0c1bf93a6..ef97c8964 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/IceMeltFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/IceMeltFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class IceMeltFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class IceMeltFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_ICE_MELT);
}
- @Override protected IceMeltFlag flagOf(@NotNull Boolean value) {
+ @Override protected IceMeltFlag flagOf(@Nonnull Boolean value) {
return value ? ICE_MELT_TRUE : ICE_MELT_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/InstabreakFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/InstabreakFlag.java
index 7c87fcff4..90d5632f1 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/InstabreakFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/InstabreakFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class InstabreakFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class InstabreakFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_INSTABREAK);
}
- @Override protected InstabreakFlag flagOf(@NotNull Boolean value) {
+ @Override protected InstabreakFlag flagOf(@Nonnull Boolean value) {
return value ? INSTABREAK_TRUE : INSTABREAK_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/InvincibleFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/InvincibleFlag.java
index b19e0d393..e3328a6a2 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/InvincibleFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/InvincibleFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class InvincibleFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class InvincibleFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_INVINCIBLE);
}
- @Override protected InvincibleFlag flagOf(@NotNull Boolean value) {
+ @Override protected InvincibleFlag flagOf(@Nonnull Boolean value) {
return value ? INVINCIBLE_TRUE : INVINCIBLE_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ItemDropFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ItemDropFlag.java
index 1c71be3eb..654505a38 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ItemDropFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ItemDropFlag.java
@@ -27,7 +27,7 @@ package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.plot.flag.types.BooleanFlag;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class ItemDropFlag extends BooleanFlag {
@@ -38,7 +38,7 @@ public class ItemDropFlag extends BooleanFlag {
super(value, Captions.FLAG_DESCRIPTION_ITEM_DROP);
}
- @Override protected ItemDropFlag flagOf(@NotNull Boolean value) {
+ @Override protected ItemDropFlag flagOf(@Nonnull Boolean value) {
return value ? ITEM_DROP_TRUE : ITEM_DROP_FALSE;
}
diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KeepFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KeepFlag.java
index ce23f2510..187237f2a 100644
--- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KeepFlag.java
+++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KeepFlag.java
@@ -30,7 +30,7 @@ import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.PlotFlag;
import com.plotsquared.core.util.MainUtil;
import com.plotsquared.core.util.MathMan;
-import org.jetbrains.annotations.NotNull;
+import javax.annotation.Nonnull;
public class KeepFlag extends PlotFlag