diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java index d29c50568..a08aa72a1 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java @@ -107,7 +107,6 @@ import com.plotsquared.core.uuid.UUIDPipeline; import com.plotsquared.core.uuid.offline.OfflineModeUUIDService; import com.sk89q.worldedit.WorldEdit; import io.papermc.lib.PaperLib; -import lombok.Getter; import net.kyori.adventure.audience.Audience; import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; @@ -167,15 +166,15 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass; } private int[] version; - @Getter private String pluginName; - @Getter private SingleWorldListener singleWorldListener; + private String pluginName; + private SingleWorldListener singleWorldListener; private Method methodUnloadChunk0; private boolean methodUnloadSetup = false; private boolean metricsStarted; private EconHandler econ; private PermHandler perm; - @Getter private Injector injector; + private Injector injector; @Inject private PlotAreaManager plotAreaManager; @Inject private EventDispatcher eventDispatcher; @@ -1123,4 +1122,15 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass; return BukkitUtil.BUKKIT_AUDIENCES.audience(Bukkit.getConsoleSender()); } + public String getPluginName() { + return this.pluginName; + } + + public SingleWorldListener getSingleWorldListener() { + return this.singleWorldListener; + } + + public Injector getInjector() { + return this.injector; + } } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/entity/EntityWrapper.java b/Bukkit/src/main/java/com/plotsquared/bukkit/entity/EntityWrapper.java index 08924e27a..7cf12c1e0 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/entity/EntityWrapper.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/entity/EntityWrapper.java @@ -25,15 +25,13 @@ */ package com.plotsquared.bukkit.entity; -import lombok.Getter; - import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; + import javax.annotation.Nonnull; -@Getter public abstract class EntityWrapper { protected final float yaw; @@ -64,4 +62,31 @@ public abstract class EntityWrapper { public abstract void saveEntity(); + public float getYaw() { + return this.yaw; + } + + public float getPitch() { + return this.pitch; + } + + public Entity getEntity() { + return this.entity; + } + + public EntityType getType() { + return this.type; + } + + public double getX() { + return this.x; + } + + public double getY() { + return this.y; + } + + public double getZ() { + return this.z; + } } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BlockStatePopulator.java b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BlockStatePopulator.java index 3e3b74938..e74266394 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BlockStatePopulator.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BlockStatePopulator.java @@ -35,8 +35,8 @@ import com.plotsquared.core.queue.ScopedLocalBlockQueue; import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.generator.BlockPopulator; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Random; final class BlockStatePopulator extends BlockPopulator { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java index 7c08c6871..d46612201 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitAugmentedGenerator.java @@ -29,8 +29,8 @@ import com.plotsquared.core.generator.AugmentedUtils; import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.generator.BlockPopulator; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Random; public class BukkitAugmentedGenerator extends BlockPopulator { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitPlotGenerator.java b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitPlotGenerator.java index 60bb34b9a..9284710de 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitPlotGenerator.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/BukkitPlotGenerator.java @@ -38,13 +38,12 @@ import com.plotsquared.core.queue.ScopedLocalBlockQueue; import com.plotsquared.core.util.ChunkManager; import com.plotsquared.core.util.MainUtil; import com.sk89q.worldedit.math.BlockVector2; -import lombok.Getter; import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.ChunkGenerator; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -62,7 +61,7 @@ public class BukkitPlotGenerator extends ChunkGenerator private List populators; private boolean loaded = false; - @Getter private final String levelName; + private final String levelName; public BukkitPlotGenerator(@Nonnull final String name, @Nonnull final IndependentPlotGenerator generator, @@ -258,4 +257,7 @@ public class BukkitPlotGenerator extends ChunkGenerator return toString().equals(obj.toString()) || toString().equals(obj.getClass().getName()); } + public String getLevelName() { + return this.levelName; + } } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/DelegatePlotGenerator.java b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/DelegatePlotGenerator.java index 0f5ca12a6..6906c446d 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/generator/DelegatePlotGenerator.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/generator/DelegatePlotGenerator.java @@ -38,8 +38,8 @@ import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.ChunkGenerator; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Random; final class DelegatePlotGenerator extends IndependentPlotGenerator { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java b/Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java index c6fe99ba7..9c817c8af 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java @@ -62,16 +62,20 @@ import com.plotsquared.core.util.SetupUtils; import com.plotsquared.core.util.WorldUtil; import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.extension.platform.Actor; -import lombok.RequiredArgsConstructor; import org.bukkit.Bukkit; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.plugin.java.JavaPlugin; + import javax.annotation.Nonnull; -@RequiredArgsConstructor public class BukkitModule extends AbstractModule { +public class BukkitModule extends AbstractModule { private final BukkitPlatform bukkitPlatform; + public BukkitModule(@Nonnull final BukkitPlatform bukkitPlatform) { + this.bukkitPlatform = bukkitPlatform; + } + @Override protected void configure() { bind(PlayerManager.class).to(BukkitPlayerManager.class); bind(JavaPlugin.class).toInstance(bukkitPlatform); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ChunkListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ChunkListener.java index c22df7c54..a4b0e3430 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ChunkListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/ChunkListener.java @@ -26,7 +26,6 @@ package com.plotsquared.bukkit.listener; import com.google.inject.Inject; -import com.plotsquared.core.PlotSquared; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.location.Location; import com.plotsquared.core.plot.Plot; @@ -53,10 +52,10 @@ import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.event.world.ChunkUnloadEvent; -import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; import java.lang.reflect.Method; import java.util.HashSet; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java index 85903eb9a..817ff621d 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java @@ -53,8 +53,8 @@ import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.List; public class EntitySpawnListener implements Listener { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java index 7dfe8fbcb..9acc3209d 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PaperListener.java @@ -59,8 +59,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.projectiles.ProjectileSource; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java index ce868a61e..71d5b9b7c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEvents.java @@ -215,8 +215,8 @@ import org.bukkit.plugin.Plugin; import org.bukkit.projectiles.BlockProjectileSource; import org.bukkit.projectiles.ProjectileSource; import org.bukkit.util.Vector; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.HashSet; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/WorldEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/WorldEvents.java index dbd0e9dba..7e9f32d04 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/WorldEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/WorldEvents.java @@ -37,6 +37,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.world.WorldInitEvent; import org.bukkit.generator.ChunkGenerator; + import javax.annotation.Nonnull; @SuppressWarnings("unused") diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java index 8a8dd891e..d85e46115 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/BukkitWorldManager.java @@ -32,9 +32,9 @@ import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.WorldCreator; import org.bukkit.WorldType; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.io.File; import java.io.IOException; import java.util.ArrayList; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/HyperverseWorldManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/HyperverseWorldManager.java index 9c96d596c..1c6be936d 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/HyperverseWorldManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/HyperverseWorldManager.java @@ -27,14 +27,15 @@ package com.plotsquared.bukkit.managers; import com.google.inject.Singleton; import org.bukkit.World; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import se.hyperver.hyperverse.Hyperverse; import se.hyperver.hyperverse.world.WorldConfiguration; import se.hyperver.hyperverse.world.WorldConfigurationBuilder; import se.hyperver.hyperverse.world.WorldFeatures; import se.hyperver.hyperverse.world.WorldType; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * Hyperverse specific manager that creates worlds * using Hyperverse's API diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/MultiverseWorldManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/MultiverseWorldManager.java index 105b8c9c0..6abb07e81 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/managers/MultiverseWorldManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/managers/MultiverseWorldManager.java @@ -28,6 +28,7 @@ package com.plotsquared.bukkit.managers; import com.google.inject.Singleton; import org.bukkit.Bukkit; import org.bukkit.World; + import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitOfflinePlayer.java b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitOfflinePlayer.java index 3aa5d12c3..238081a0c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitOfflinePlayer.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitOfflinePlayer.java @@ -27,8 +27,8 @@ package com.plotsquared.bukkit.player; import com.plotsquared.core.player.OfflinePlotPlayer; import org.bukkit.OfflinePlayer; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.UUID; public class BukkitOfflinePlayer implements OfflinePlotPlayer { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java index 1f104e27f..23b278a1e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayer.java @@ -53,9 +53,9 @@ import org.bukkit.event.EventException; import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.RegisteredListener; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Arrays; import java.util.Set; import java.util.UUID; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java index 7238709e3..3b1539980 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/player/BukkitPlayerManager.java @@ -33,9 +33,9 @@ import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.PlayerManager; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import javax.annotation.Nullable; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.UUID; /** diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitLocalQueue.java b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitLocalQueue.java index fa6ccd69d..7385b9d1f 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitLocalQueue.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/BukkitLocalQueue.java @@ -48,8 +48,8 @@ import org.bukkit.block.Biome; import org.bukkit.block.Block; import org.bukkit.block.Container; import org.bukkit.block.data.BlockData; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.concurrent.ExecutionException; import java.util.function.Consumer; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java index 3a18ec355..49c95d029 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/queue/GenChunk.java @@ -39,15 +39,13 @@ 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.BlockTypes; -import lombok.Getter; -import lombok.Setter; import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.block.Biome; import org.bukkit.generator.ChunkGenerator.BiomeGrid; import org.bukkit.generator.ChunkGenerator.ChunkData; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Arrays; public class GenChunk extends ScopedLocalBlockQueue { @@ -59,7 +57,7 @@ public class GenChunk extends ScopedLocalBlockQueue { public String world; public int chunkX; public int chunkZ; - @Getter @Setter private ChunkData chunkData = null; + private ChunkData chunkData = null; public GenChunk() { super(null, Location.at("", 0, 0, 0), Location.at("", 15, 255, 15)); @@ -217,4 +215,12 @@ public class GenChunk extends ScopedLocalBlockQueue { toReturn.chunkData = this.chunkData; return toReturn; } + + public ChunkData getChunkData() { + return this.chunkData; + } + + public void setChunkData(ChunkData chunkData) { + this.chunkData = chunkData; + } } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/schematic/BukkitSchematicHandler.java b/Bukkit/src/main/java/com/plotsquared/bukkit/schematic/BukkitSchematicHandler.java index e2e22ed3c..e6e8d625c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/schematic/BukkitSchematicHandler.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/schematic/BukkitSchematicHandler.java @@ -31,6 +31,7 @@ import com.plotsquared.core.queue.LocalBlockQueue; import com.plotsquared.core.util.SchematicHandler; import com.plotsquared.core.util.WorldUtil; import com.sk89q.jnbt.CompoundTag; + import javax.annotation.Nonnull; /** diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEconHandler.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEconHandler.java index c7356c13b..a1965fccd 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEconHandler.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitEconHandler.java @@ -36,6 +36,7 @@ import com.plotsquared.core.util.PermHandler; import net.milkbowl.vault.economy.Economy; import org.bukkit.Bukkit; import org.bukkit.plugin.RegisteredServiceProvider; + import javax.annotation.Nullable; @Singleton public class BukkitEconHandler extends EconHandler { diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java index e4cc3d071..336bbd798 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java @@ -29,12 +29,12 @@ import com.google.inject.Inject; import com.google.inject.Singleton; import com.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.plotsquared.core.PlotSquared; -import com.plotsquared.core.inject.annotations.WorldConfig; -import com.plotsquared.core.inject.annotations.WorldFile; import com.plotsquared.core.configuration.ConfigurationNode; import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.generator.GeneratorWrapper; +import com.plotsquared.core.inject.annotations.WorldConfig; +import com.plotsquared.core.inject.annotations.WorldFile; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotAreaType; import com.plotsquared.core.plot.SetupObject; @@ -48,8 +48,8 @@ import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.generator.ChunkGenerator; import org.bukkit.plugin.Plugin; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.io.IOException; import java.util.HashMap; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java index f0738a641..c6e3111ca 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java @@ -32,7 +32,6 @@ import com.plotsquared.bukkit.player.BukkitPlayer; import com.plotsquared.bukkit.player.BukkitPlayerManager; import com.plotsquared.core.PlotSquared; import com.plotsquared.core.configuration.Caption; -import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.caption.LocaleHolder; import com.plotsquared.core.location.Location; import com.plotsquared.core.player.PlotPlayer; @@ -59,7 +58,6 @@ import net.kyori.adventure.platform.bukkit.BukkitAudiences; import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; - import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.Material; @@ -101,11 +99,11 @@ import org.bukkit.entity.Snowman; import org.bukkit.entity.Tameable; import org.bukkit.entity.Vehicle; import org.bukkit.entity.WaterMob; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java index 70e664c64..d06c87d33 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java @@ -27,14 +27,13 @@ package com.plotsquared.bukkit.util; import com.google.common.collect.Maps; import com.plotsquared.core.location.World; -import lombok.EqualsAndHashCode; -import lombok.ToString; import org.bukkit.Bukkit; + import javax.annotation.Nonnull; - import java.util.Map; +import java.util.Objects; -@EqualsAndHashCode @ToString public class BukkitWorld implements World { +public class BukkitWorld implements World { private static final Map worldMap = Maps.newHashMap(); @@ -82,4 +81,36 @@ import java.util.Map; return this.world.getName(); } + public boolean equals(final Object o) { + if (o == this) { + return true; + } + if (!(o instanceof BukkitWorld)) { + return false; + } + final BukkitWorld other = (BukkitWorld) o; + if (!other.canEqual(this)) { + return false; + } + if (!Objects.equals(this.world, other.world)) { + return false; + } + return true; + } + + protected boolean canEqual(final Object other) { + return other instanceof BukkitWorld; + } + + public int hashCode() { + final int PRIME = 59; + int result = 1; + final Object $world = this.world; + result = result * PRIME + ($world == null ? 43 : $world.hashCode()); + return result; + } + + public String toString() { + return "BukkitWorld(world=" + this.world + ")"; + } } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/BungeePermsUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/BungeePermsUUIDService.java index 5163b4045..1a8068a9b 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/BungeePermsUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/BungeePermsUUIDService.java @@ -27,16 +27,15 @@ package com.plotsquared.bukkit.uuid; import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDService; -import net.luckperms.api.model.user.UserManager; +import net.alpenblock.bungeeperms.BungeePerms; +import net.alpenblock.bungeeperms.io.UUIDPlayerDB; import org.bukkit.Bukkit; import org.bukkit.plugin.RegisteredServiceProvider; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.UUID; -import net.alpenblock.bungeeperms.BungeePerms; -import net.alpenblock.bungeeperms.io.UUIDPlayerDB; /** * UUID service that uses the BungeePerms API diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/EssentialsUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/EssentialsUUIDService.java index a2472bd69..890a966e7 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/EssentialsUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/EssentialsUUIDService.java @@ -29,8 +29,8 @@ import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDService; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/LuckPermsUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/LuckPermsUUIDService.java index d2bcae5a5..df0c8c681 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/LuckPermsUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/LuckPermsUUIDService.java @@ -31,8 +31,8 @@ import net.luckperms.api.LuckPerms; import net.luckperms.api.model.user.UserManager; import org.bukkit.Bukkit; import org.bukkit.plugin.RegisteredServiceProvider; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.UUID; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/OfflinePlayerUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/OfflinePlayerUUIDService.java index 7193f9033..89557f2d2 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/OfflinePlayerUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/OfflinePlayerUUIDService.java @@ -31,8 +31,8 @@ import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDService; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/PaperUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/PaperUUIDService.java index 19ce31c45..a06bb4e10 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/PaperUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/PaperUUIDService.java @@ -29,8 +29,8 @@ import com.destroystokyo.paper.profile.PlayerProfile; import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDService; import org.bukkit.Bukkit; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; import java.util.UUID; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SQLiteUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SQLiteUUIDService.java index b2f2a8707..c272dc888 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SQLiteUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SQLiteUUIDService.java @@ -30,8 +30,8 @@ import com.plotsquared.core.database.SQLite; import com.plotsquared.core.util.MainUtil; import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDService; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SquirrelIdUUIDService.java b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SquirrelIdUUIDService.java index 3d5f2952a..57f365bf0 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SquirrelIdUUIDService.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/uuid/SquirrelIdUUIDService.java @@ -32,10 +32,10 @@ import com.plotsquared.core.uuid.UUIDService; import com.sk89q.squirrelid.Profile; import com.sk89q.squirrelid.resolver.HttpRepositoryService; import com.sk89q.squirrelid.resolver.ProfileService; -import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; diff --git a/Core/build.gradle b/Core/build.gradle index 564485fc6..59a1cddf0 100644 --- a/Core/build.gradle +++ b/Core/build.gradle @@ -11,11 +11,6 @@ dependencies { because("Minecraft uses GSON 2.8.0") force = true } - implementation("org.projectlombok:lombok:1.18.12") - compileOnly("org.projectlombok:lombok:1.18.12") - testCompileOnly("org.projectlombok:lombok:1.18.8") - annotationProcessor("org.projectlombok:lombok:1.18.8") - testAnnotationProcessor("org.projectlombok:lombok:1.18.8") implementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.72") implementation("org.khelekore:prtree:1.7.0-SNAPSHOT") // Adventure related stuff diff --git a/Core/pom.xml b/Core/pom.xml index ac6a4ef60..62dfeeb84 100644 --- a/Core/pom.xml +++ b/Core/pom.xml @@ -36,12 +36,6 @@ 3.0.1 compile - - org.projectlombok - lombok - 1.18.12 - runtime - com.sk89q.worldedit worldedit-core diff --git a/Core/src/main/java/com/plotsquared/core/PlotAPI.java b/Core/src/main/java/com/plotsquared/core/PlotAPI.java index 9a83aae5e..3fa983e7d 100644 --- a/Core/src/main/java/com/plotsquared/core/PlotAPI.java +++ b/Core/src/main/java/com/plotsquared/core/PlotAPI.java @@ -37,7 +37,6 @@ import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.MainUtil; import com.plotsquared.core.util.SchematicHandler; import com.plotsquared.core.util.query.PlotQuery; -import lombok.NoArgsConstructor; import java.util.Collections; import java.util.Set; @@ -57,7 +56,10 @@ import java.util.UUID; * * @version 5 */ -@SuppressWarnings({"unused", "WeakerAccess"}) @NoArgsConstructor public class PlotAPI { +@SuppressWarnings({"unused", "WeakerAccess"}) public class PlotAPI { + + public PlotAPI() { + } /** * Gets all plots. diff --git a/Core/src/main/java/com/plotsquared/core/PlotSquared.java b/Core/src/main/java/com/plotsquared/core/PlotSquared.java index 8c71c16e7..f79ff1d29 100644 --- a/Core/src/main/java/com/plotsquared/core/PlotSquared.java +++ b/Core/src/main/java/com/plotsquared/core/PlotSquared.java @@ -25,11 +25,6 @@ */ package com.plotsquared.core; -import com.plotsquared.core.command.WE_Anywhere; -import com.plotsquared.core.components.ComponentPresetManager; -import com.plotsquared.core.configuration.Caption; -import com.plotsquared.core.configuration.caption.CaptionMap; -import com.plotsquared.core.configuration.CaptionUtility; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationUtil; @@ -37,6 +32,7 @@ import com.plotsquared.core.configuration.MemorySection; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Storage; import com.plotsquared.core.configuration.caption.CaptionLoader; +import com.plotsquared.core.configuration.caption.CaptionMap; import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.configuration.serialization.ConfigurationSerialization; import com.plotsquared.core.database.DBFunc; @@ -64,20 +60,17 @@ 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.queue.GlobalBlockQueue; -import com.plotsquared.core.util.ChunkManager; -import com.plotsquared.core.util.EconHandler; import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.LegacyConverter; import com.plotsquared.core.util.MainUtil; import com.plotsquared.core.util.MathMan; import com.plotsquared.core.util.ReflectionUtils; +import com.plotsquared.core.util.logger.ILogger; import com.plotsquared.core.util.query.PlotQuery; import com.plotsquared.core.util.task.TaskManager; import com.plotsquared.core.uuid.UUIDPipeline; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.math.BlockVector2; -import lombok.Getter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -133,32 +126,32 @@ public class PlotSquared { // Current thread private final Thread thread; // UUID pipelines - @Getter private final UUIDPipeline impromptuUUIDPipeline = + private final UUIDPipeline impromptuUUIDPipeline = new UUIDPipeline(Executors.newCachedThreadPool()); - @Getter private final UUIDPipeline backgroundUUIDPipeline = + private final UUIDPipeline backgroundUUIDPipeline = new UUIDPipeline(Executors.newSingleThreadExecutor()); // WorldEdit instance - @Getter private WorldEdit worldedit; - @Getter private File configFile; - @Getter private File worldsFile; + private WorldEdit worldedit; + private File configFile; + private File worldsFile; public File translationFile; // TODO: REMOVE public YamlConfiguration style; // TODO: REMOVE - @Getter private YamlConfiguration worldConfiguration; + private YamlConfiguration worldConfiguration; // Temporary hold the plots/clusters before the worlds load private HashMap> clustersTmp; public HashMap> plots_tmp; private YamlConfiguration config; // Localization - @Getter private CaptionMap captionMap; + private CaptionMap captionMap; // Implementation logger - @Setter @Getter private ILogger logger; + private ILogger logger; // Platform / Version / Update URL private PlotVersion version; // Files and configuration - @Getter private File jarFile = null; // This file + private File jarFile = null; // This file private File storageFile; - @Getter private EventDispatcher eventDispatcher; - @Getter private PlotListener plotListener; + private EventDispatcher eventDispatcher; + private PlotListener plotListener; /** * Initialize PlotSquared with the desired Implementation class. @@ -1454,6 +1447,54 @@ public class PlotSquared { return config; } + public UUIDPipeline getImpromptuUUIDPipeline() { + return this.impromptuUUIDPipeline; + } + + public UUIDPipeline getBackgroundUUIDPipeline() { + return this.backgroundUUIDPipeline; + } + + public WorldEdit getWorldedit() { + return this.worldedit; + } + + public File getConfigFile() { + return this.configFile; + } + + public File getWorldsFile() { + return this.worldsFile; + } + + public YamlConfiguration getWorldConfiguration() { + return this.worldConfiguration; + } + + public CaptionMap getCaptionMap() { + return this.captionMap; + } + + public ILogger getLogger() { + return this.logger; + } + + public File getJarFile() { + return this.jarFile; + } + + public EventDispatcher getEventDispatcher() { + return this.eventDispatcher; + } + + public PlotListener getPlotListener() { + return this.plotListener; + } + + public void setLogger(ILogger logger) { + this.logger = logger; + } + public enum SortType { CREATION_DATE, CREATION_DATE_TIMESTAMP, LAST_MODIFIED, DISTANCE_FROM_ORIGIN } 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 111edd8a7..e1af86eff 100644 --- a/Core/src/main/java/com/plotsquared/core/backup/Backup.java +++ b/Core/src/main/java/com/plotsquared/core/backup/Backup.java @@ -25,11 +25,7 @@ */ package com.plotsquared.core.backup; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; import javax.annotation.Nullable; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -38,12 +34,18 @@ import java.nio.file.Path; * Object representing a plot backup. This does not actually contain the * backup itself, it is just a pointer to an available backup */ -@RequiredArgsConstructor(access = AccessLevel.PACKAGE) @Getter public class Backup { +public class Backup { private final BackupProfile owner; private final long creationTime; @Nullable private final Path file; + Backup(final BackupProfile owner, final long creationTime, final Path file) { + this.owner = owner; + this.creationTime = creationTime; + this.file = file; + } + /** * Delete the backup */ @@ -57,4 +59,15 @@ import java.nio.file.Path; } } + public BackupProfile getOwner() { + return this.owner; + } + + public long getCreationTime() { + return this.creationTime; + } + + @Nullable public Path getFile() { + return this.file; + } } 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 5ae0dcdfe..e1f7249d9 100644 --- a/Core/src/main/java/com/plotsquared/core/backup/BackupManager.java +++ b/Core/src/main/java/com/plotsquared/core/backup/BackupManager.java @@ -28,9 +28,9 @@ package com.plotsquared.core.backup; import com.plotsquared.core.PlotSquared; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.nio.file.Path; import java.util.Objects; 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 1a9dc7baa..5482cbcf7 100644 --- a/Core/src/main/java/com/plotsquared/core/backup/BackupProfile.java +++ b/Core/src/main/java/com/plotsquared/core/backup/BackupProfile.java @@ -26,7 +26,6 @@ package com.plotsquared.core.backup; import javax.annotation.Nonnull; - import java.nio.file.Path; import java.util.List; import java.util.concurrent.CompletableFuture; 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 c83a36c24..a46e3b1d1 100644 --- a/Core/src/main/java/com/plotsquared/core/backup/NullBackupManager.java +++ b/Core/src/main/java/com/plotsquared/core/backup/NullBackupManager.java @@ -29,9 +29,9 @@ import com.google.inject.Singleton; import com.plotsquared.core.PlotSquared; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.nio.file.Path; import java.util.Objects; 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 b16a589fc..b160e0e8f 100644 --- a/Core/src/main/java/com/plotsquared/core/backup/NullBackupProfile.java +++ b/Core/src/main/java/com/plotsquared/core/backup/NullBackupProfile.java @@ -26,7 +26,6 @@ package com.plotsquared.core.backup; import javax.annotation.Nonnull; - import java.io.File; import java.nio.file.Path; import java.util.Collections; 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 e70ef4ac6..bd99da015 100644 --- a/Core/src/main/java/com/plotsquared/core/backup/PlayerBackupProfile.java +++ b/Core/src/main/java/com/plotsquared/core/backup/PlayerBackupProfile.java @@ -33,8 +33,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; 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 97bae8f1c..27f6efd38 100644 --- a/Core/src/main/java/com/plotsquared/core/backup/SimpleBackupManager.java +++ b/Core/src/main/java/com/plotsquared/core/backup/SimpleBackupManager.java @@ -36,12 +36,9 @@ import com.plotsquared.core.inject.factory.PlayerBackupProfileFactory; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.util.task.TaskManager; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.nio.file.Files; import java.nio.file.Path; import java.util.Objects; @@ -51,11 +48,11 @@ import java.util.concurrent.TimeUnit; /** * {@inheritDoc} */ -@RequiredArgsConstructor @Singleton public class SimpleBackupManager implements BackupManager { +@Singleton public class SimpleBackupManager implements BackupManager { - @Getter private final Path backupPath; + private final Path backupPath; private final boolean automaticBackup; - @Getter private final int backupLimit; + private final int backupLimit; private final Cache backupProfileCache = CacheBuilder.newBuilder() .expireAfterAccess(3, TimeUnit.MINUTES).build(); private final PlayerBackupProfileFactory playerBackupProfileFactory; @@ -70,6 +67,14 @@ import java.util.concurrent.TimeUnit; this.backupLimit = Settings.Backup.BACKUP_LIMIT; } + public SimpleBackupManager(final Path backupPath, final boolean automaticBackup, + final int backupLimit, final PlayerBackupProfileFactory playerBackupProfileFactory) { + this.backupPath = backupPath; + this.automaticBackup = automaticBackup; + this.backupLimit = backupLimit; + this.playerBackupProfileFactory = playerBackupProfileFactory; + } + @Override @Nonnull public BackupProfile getProfile(@Nonnull final Plot plot) { if (plot.hasOwner() && !plot.isMerged()) { try { @@ -111,10 +116,22 @@ import java.util.concurrent.TimeUnit; return this.automaticBackup; } - @RequiredArgsConstructor(access = AccessLevel.PRIVATE) private static final class PlotCacheKey { + public Path getBackupPath() { + return this.backupPath; + } + + public int getBackupLimit() { + return this.backupLimit; + } + + private static final class PlotCacheKey { private final Plot plot; + private PlotCacheKey(Plot plot) { + this.plot = plot; + } + @Override public boolean equals(final Object o) { if (this == o) { return true; 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 a3efa64f2..10651a0aa 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Add.java +++ b/Core/src/main/java/com/plotsquared/core/command/Add.java @@ -37,9 +37,9 @@ 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 javax.annotation.Nonnull; import net.kyori.adventure.text.minimessage.Template; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.Collections; import java.util.Iterator; 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 f179a1953..f811daed1 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Area.java +++ b/Core/src/main/java/com/plotsquared/core/command/Area.java @@ -27,16 +27,16 @@ 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; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationUtil; -import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.configuration.caption.TranslatableCaption; +import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.events.TeleportCause; import com.plotsquared.core.generator.AugmentedUtils; import com.plotsquared.core.generator.HybridPlotWorld; +import com.plotsquared.core.inject.annotations.WorldConfig; +import com.plotsquared.core.inject.annotations.WorldFile; import com.plotsquared.core.inject.factory.HybridPlotWorldFactory; import com.plotsquared.core.location.Location; import com.plotsquared.core.player.ConsolePlayer; @@ -73,8 +73,8 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import net.kyori.adventure.text.minimessage.Template; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; 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 c75b805c8..e1c32e28b 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Auto.java +++ b/Core/src/main/java/com/plotsquared/core/command/Auto.java @@ -52,9 +52,9 @@ import com.plotsquared.core.util.task.AutoClaimFinishTask; import com.plotsquared.core.util.task.RunnableVal; import com.plotsquared.core.util.task.TaskManager; import net.kyori.adventure.text.minimessage.Template; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.Set; 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 4c16458c6..d6b8ae94d 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Backup.java +++ b/Core/src/main/java/com/plotsquared/core/command/Backup.java @@ -36,8 +36,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.nio.file.Files; import java.time.Instant; import java.time.ZoneId; 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 f62f24bc2..cc73ef003 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 javax.annotation.Nullable; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.Set; import java.util.concurrent.CompletableFuture; 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 7b51ea6cf..e49afd85c 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Claim.java +++ b/Core/src/main/java/com/plotsquared/core/command/Claim.java @@ -27,7 +27,6 @@ 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; import com.plotsquared.core.configuration.Settings; @@ -46,11 +45,12 @@ 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 javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + @CommandDeclaration(command = "claim", aliases = "c", description = "Claim the current plot you're standing on", 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 1eee3a26c..6d58d64ae 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Clear.java +++ b/Core/src/main/java/com/plotsquared/core/command/Clear.java @@ -42,8 +42,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.concurrent.CompletableFuture; import static com.plotsquared.core.command.SubCommand.sendMessage; 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 fd0ecdce9..88d9f9007 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Command.java +++ b/Core/src/main/java/com/plotsquared/core/command/Command.java @@ -25,12 +25,10 @@ */ package com.plotsquared.core.command; -import com.plotsquared.core.PlotSquared; import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.StaticCaption; import com.plotsquared.core.configuration.caption.TranslatableCaption; -import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.util.MainUtil; import com.plotsquared.core.util.MathMan; @@ -39,9 +37,7 @@ import com.plotsquared.core.util.StringComparison; import com.plotsquared.core.util.StringMan; import com.plotsquared.core.util.task.RunnableVal2; import com.plotsquared.core.util.task.RunnableVal3; -import lombok.SneakyThrows; import net.kyori.adventure.text.minimessage.Template; -import javax.annotation.Nonnull; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -594,10 +590,6 @@ public abstract class Command { return object; } - @SneakyThrows protected static void sneakyThrow(@Nonnull final Throwable throwable) { - throw throwable; - } - public enum CommandResult { FAILURE, SUCCESS } diff --git a/Core/src/main/java/com/plotsquared/core/command/CommandCategory.java b/Core/src/main/java/com/plotsquared/core/command/CommandCategory.java index 2cffd99c0..12337c98c 100644 --- a/Core/src/main/java/com/plotsquared/core/command/CommandCategory.java +++ b/Core/src/main/java/com/plotsquared/core/command/CommandCategory.java @@ -26,12 +26,10 @@ package com.plotsquared.core.command; import com.plotsquared.core.configuration.Captions; -import lombok.RequiredArgsConstructor; /** * CommandCategory. */ -@RequiredArgsConstructor public enum CommandCategory { /** * Claiming CommandConfig. @@ -78,6 +76,10 @@ public enum CommandCategory { */ private final Captions caption; + CommandCategory(final Captions caption) { + this.caption = caption; + } + @Override public String toString() { return this.caption.getTranslated(); } 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 180e26581..bc73a815a 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Condense.java +++ b/Core/src/main/java/com/plotsquared/core/command/Condense.java @@ -35,8 +35,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; 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 bd061e380..16cfd3622 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Continue.java +++ b/Core/src/main/java/com/plotsquared/core/command/Continue.java @@ -37,6 +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 javax.annotation.Nonnull; @CommandDeclaration(command = "continue", 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 2820fc204..d43d6f823 100644 --- a/Core/src/main/java/com/plotsquared/core/command/CreateRoadSchematic.java +++ b/Core/src/main/java/com/plotsquared/core/command/CreateRoadSchematic.java @@ -33,6 +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 javax.annotation.Nonnull; @CommandDeclaration(command = "createroadschematic", 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 424363e3f..fc6bee9d8 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/DatabaseCommand.java @@ -27,13 +27,13 @@ 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; import com.plotsquared.core.database.DBFunc; import com.plotsquared.core.database.Database; import com.plotsquared.core.database.MySQL; import com.plotsquared.core.database.SQLManager; import com.plotsquared.core.database.SQLite; +import com.plotsquared.core.inject.annotations.WorldConfig; import com.plotsquared.core.listener.PlotListener; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; @@ -45,8 +45,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.sql.SQLException; import java.util.ArrayList; 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 d8e591313..23694c2ab 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Debug.java +++ b/Core/src/main/java/com/plotsquared/core/command/Debug.java @@ -39,10 +39,10 @@ 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 javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.Comparator; import java.util.Map; 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 387320ffb..f48ab43c5 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DebugExec.java +++ b/Core/src/main/java/com/plotsquared/core/command/DebugExec.java @@ -63,11 +63,11 @@ 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 javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import javax.script.Bindings; import javax.script.ScriptContext; import javax.script.ScriptEngine; 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 0f15c1528..64f914bb4 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DebugImportWorlds.java +++ b/Core/src/main/java/com/plotsquared/core/command/DebugImportWorlds.java @@ -37,8 +37,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.util.UUID; import java.util.concurrent.CompletableFuture; 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 fa7f4a837..50c72fc1d 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DebugPaste.java +++ b/Core/src/main/java/com/plotsquared/core/command/DebugPaste.java @@ -29,10 +29,10 @@ 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; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.Settings; +import com.plotsquared.core.inject.annotations.ConfigFile; +import com.plotsquared.core.inject.annotations.WorldFile; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.util.MainUtil; import com.plotsquared.core.util.PremiumVerification; @@ -40,7 +40,6 @@ import com.plotsquared.core.util.net.IncendoPaster; import com.plotsquared.core.util.task.TaskManager; import javax.annotation.Nonnull; - import java.io.BufferedReader; import java.io.File; import java.io.FileReader; 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 b656522c7..9432c714c 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java +++ b/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java @@ -35,8 +35,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Arrays; @CommandDeclaration(command = "debugroadregen", 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 87d8d683a..1dc054085 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Delete.java +++ b/Core/src/main/java/com/plotsquared/core/command/Delete.java @@ -39,6 +39,7 @@ 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 javax.annotation.Nonnull; import javax.annotation.Nullable; 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 b97be84f7..827d19134 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Deny.java +++ b/Core/src/main/java/com/plotsquared/core/command/Deny.java @@ -39,8 +39,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.Collections; import java.util.UUID; 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 6b607ae31..84f3c24e2 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Desc.java +++ b/Core/src/main/java/com/plotsquared/core/command/Desc.java @@ -35,6 +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 javax.annotation.Nonnull; @CommandDeclaration(command = "setdescription", 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 51e0b1ca2..2d603f814 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Dislike.java +++ b/Core/src/main/java/com/plotsquared/core/command/Dislike.java @@ -27,6 +27,7 @@ package com.plotsquared.core.command; import com.google.inject.Inject; import com.plotsquared.core.player.PlotPlayer; + import javax.annotation.Nonnull; @CommandDeclaration(command = "dislike", 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 2103cc4d9..492c2c7c0 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Done.java +++ b/Core/src/main/java/com/plotsquared/core/command/Done.java @@ -43,6 +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 javax.annotation.Nonnull; @CommandDeclaration(command = "done", 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 66f0b6e86..26908b78a 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Download.java +++ b/Core/src/main/java/com/plotsquared/core/command/Download.java @@ -39,8 +39,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.net.URL; @CommandDeclaration(usage = "/plot download [schematic|world]", 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 638a34fa1..3dbea33dd 100644 --- a/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/FlagCommand.java @@ -49,10 +49,9 @@ 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 javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; 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 3cc72188a..4dfe67e73 100644 --- a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java @@ -41,8 +41,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.List; 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 1b35df43c..2cb0d686f 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Kick.java +++ b/Core/src/main/java/com/plotsquared/core/command/Kick.java @@ -37,8 +37,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.Collections; import java.util.HashSet; 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 a6666f84c..8e2897bf4 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Leave.java +++ b/Core/src/main/java/com/plotsquared/core/command/Leave.java @@ -33,8 +33,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.UUID; import java.util.concurrent.CompletableFuture; 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 cab2dc433..a504451e5 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Like.java +++ b/Core/src/main/java/com/plotsquared/core/command/Like.java @@ -40,8 +40,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; 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 d2a573b64..d39bd75d7 100644 --- a/Core/src/main/java/com/plotsquared/core/command/ListCmd.java +++ b/Core/src/main/java/com/plotsquared/core/command/ListCmd.java @@ -27,7 +27,6 @@ package com.plotsquared.core.command; import com.google.inject.Inject; import com.plotsquared.core.PlotSquared; -import com.plotsquared.core.configuration.CaptionUtility; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.caption.Templates; @@ -50,9 +49,9 @@ import com.plotsquared.core.util.TabCompletions; import com.plotsquared.core.util.query.PlotQuery; import com.plotsquared.core.util.query.SortingStrategy; import com.plotsquared.core.uuid.UUIDMapping; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; 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 cc099687b..77327d662 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Load.java +++ b/Core/src/main/java/com/plotsquared/core/command/Load.java @@ -39,8 +39,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.net.MalformedURLException; import java.net.URL; import java.util.List; 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 49d275246..4650fc277 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Merge.java +++ b/Core/src/main/java/com/plotsquared/core/command/Merge.java @@ -42,9 +42,9 @@ 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 javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.UUID; @CommandDeclaration(command = "merge", 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 2ae527f54..0cd328f05 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Move.java +++ b/Core/src/main/java/com/plotsquared/core/command/Move.java @@ -36,8 +36,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.concurrent.CompletableFuture; @CommandDeclaration(usage = "/plot move ", 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 e3ee4afeb..6892231db 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Music.java +++ b/Core/src/main/java/com/plotsquared/core/command/Music.java @@ -39,8 +39,8 @@ 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 javax.annotation.Nullable; +import javax.annotation.Nullable; import java.util.Arrays; import java.util.Collection; import java.util.Locale; 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 c4b0938fb..a15f1de80 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Owner.java +++ b/Core/src/main/java/com/plotsquared/core/command/Owner.java @@ -38,8 +38,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Set; import java.util.UUID; import java.util.concurrent.TimeoutException; 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 4b51144b1..398713849 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Purge.java +++ b/Core/src/main/java/com/plotsquared/core/command/Purge.java @@ -40,8 +40,8 @@ import com.plotsquared.core.util.StringMan; import com.plotsquared.core.util.task.TaskManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; 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 64f21a381..dedfdccd4 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Rate.java +++ b/Core/src/main/java/com/plotsquared/core/command/Rate.java @@ -44,8 +44,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.HashMap; import java.util.Map.Entry; 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 e159e85e7..cbf304bf2 100644 --- a/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java +++ b/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java @@ -34,6 +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 javax.annotation.Nonnull; @CommandDeclaration(command = "regenallroads", 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 72ec89596..150d60544 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Reload.java +++ b/Core/src/main/java/com/plotsquared/core/command/Reload.java @@ -27,18 +27,18 @@ 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; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.MemorySection; import com.plotsquared.core.configuration.file.YamlConfiguration; +import com.plotsquared.core.inject.annotations.WorldConfig; +import com.plotsquared.core.inject.annotations.WorldFile; 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.io.IOException; import java.util.Objects; 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 b20a4da3a..500a53212 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Remove.java +++ b/Core/src/main/java/com/plotsquared/core/command/Remove.java @@ -35,8 +35,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.Collections; import java.util.UUID; 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 3c814c655..760c9e38c 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Save.java +++ b/Core/src/main/java/com/plotsquared/core/command/Save.java @@ -38,8 +38,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.net.URL; import java.util.List; import java.util.UUID; 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 131549d76..927998d1d 100644 --- a/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java +++ b/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java @@ -42,8 +42,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.net.URL; import java.util.ArrayList; import java.util.Collection; 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 743433ad2..35f11b822 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Set.java +++ b/Core/src/main/java/com/plotsquared/core/command/Set.java @@ -45,8 +45,8 @@ 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 javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; 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 cf412656a..9f4041da3 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Setup.java +++ b/Core/src/main/java/com/plotsquared/core/command/Setup.java @@ -34,8 +34,8 @@ 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 javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; 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 5e90d5a90..7794b81d8 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Template.java +++ b/Core/src/main/java/com/plotsquared/core/command/Template.java @@ -27,8 +27,6 @@ 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; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.ConfigurationNode; import com.plotsquared.core.configuration.ConfigurationSection; @@ -36,6 +34,8 @@ import com.plotsquared.core.configuration.InvalidConfigurationException; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.events.TeleportCause; +import com.plotsquared.core.inject.annotations.WorldConfig; +import com.plotsquared.core.inject.annotations.WorldFile; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotManager; @@ -48,8 +48,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; 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 abdfb0a23..a12124ab3 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Trim.java +++ b/Core/src/main/java/com/plotsquared/core/command/Trim.java @@ -47,8 +47,8 @@ import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.regions.CuboidRegion; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.HashSet; import java.util.Iterator; import java.util.List; 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 a84feffc3..616df92cc 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Trust.java +++ b/Core/src/main/java/com/plotsquared/core/command/Trust.java @@ -36,8 +36,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.Collections; import java.util.Iterator; 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 3c56e3dd3..27f05b618 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Unlink.java +++ b/Core/src/main/java/com/plotsquared/core/command/Unlink.java @@ -37,6 +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 javax.annotation.Nonnull; @CommandDeclaration(command = "unlink", 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 5982d9337..b843ae3c3 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Visit.java +++ b/Core/src/main/java/com/plotsquared/core/command/Visit.java @@ -42,8 +42,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; 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 32d18c13b..f56668805 100644 --- a/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java +++ b/Core/src/main/java/com/plotsquared/core/components/ComponentPreset.java @@ -30,8 +30,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.HashMap; import java.util.List; 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 d856944e0..34a4c528b 100644 --- a/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java +++ b/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java @@ -44,11 +44,11 @@ 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 javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.util.ArrayList; diff --git a/Core/src/main/java/com/plotsquared/core/configuration/ChatFormatter.java b/Core/src/main/java/com/plotsquared/core/configuration/ChatFormatter.java index e873d1c41..96b04e91c 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/ChatFormatter.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/ChatFormatter.java @@ -26,9 +26,6 @@ package com.plotsquared.core.configuration; import com.plotsquared.core.player.PlotPlayer; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; import java.util.ArrayList; import java.util.Collection; @@ -42,14 +39,40 @@ public interface ChatFormatter { void format(ChatContext context); - @AllArgsConstructor final class ChatContext { - @Getter private final PlotPlayer recipient; - @Getter @Setter private String message; - @Getter private final Object[] args; - @Getter private final boolean rawOutput; + private final PlotPlayer recipient; + private String message; + private final Object[] args; + private final boolean rawOutput; + public ChatContext(final PlotPlayer recipient, final String message, final Object[] args, + final boolean rawOutput) { + this.recipient = recipient; + this.message = message; + this.args = args; + this.rawOutput = rawOutput; + } + + public PlotPlayer getRecipient() { + return this.recipient; + } + + public String getMessage() { + return this.message; + } + + public Object[] getArgs() { + return this.args; + } + + public boolean isRawOutput() { + return this.rawOutput; + } + + public void setMessage(String message) { + this.message = message; + } } } diff --git a/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationNode.java b/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationNode.java index cd3d524a8..89b130d46 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationNode.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationNode.java @@ -28,7 +28,6 @@ package com.plotsquared.core.configuration; import com.plotsquared.core.plot.BlockBucket; import com.plotsquared.core.util.StringMan; import com.sk89q.worldedit.world.block.BlockState; -import lombok.Getter; import java.util.ArrayList; import java.util.Arrays; @@ -40,11 +39,11 @@ import java.util.List; */ public class ConfigurationNode { - @Getter private final String constant; + private final String constant; private final Object defaultValue; - @Getter private final String description; + private final String description; private final ConfigurationUtil.SettingValue type; - @Getter private final Collection suggestions; + private final Collection suggestions; private Object value; public ConfigurationNode(String constant, Object defaultValue, String description, @@ -112,4 +111,16 @@ public class ConfigurationNode { } return this.defaultValue; } + + public String getConstant() { + return this.constant; + } + + public String getDescription() { + return this.description; + } + + public Collection getSuggestions() { + return this.suggestions; + } } 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 a5dd65f8e..2b5680ec2 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationUtil.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/ConfigurationUtil.java @@ -30,11 +30,9 @@ import com.sk89q.worldedit.function.pattern.Pattern; 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 javax.annotation.Nonnull; - /** * Main Configuration Utility */ @@ -104,13 +102,16 @@ public class ConfigurationUtil { public static final class UnknownBlockException extends IllegalArgumentException { - @Getter private final String unknownValue; + private final String unknownValue; UnknownBlockException(@Nonnull final String unknownValue) { super(String.format("\"%s\" is not a valid block", unknownValue)); this.unknownValue = unknownValue; } + public String getUnknownValue() { + return this.unknownValue; + } } @@ -137,13 +138,16 @@ public class ConfigurationUtil { public static final class UnsafeBlockException extends IllegalArgumentException { - @Getter private final BlockState unsafeBlock; + private final BlockState unsafeBlock; UnsafeBlockException(@Nonnull final BlockState unsafeBlock) { super(String.format("%s is not a valid block", unsafeBlock)); this.unsafeBlock = unsafeBlock; } + public BlockState getUnsafeBlock() { + return this.unsafeBlock; + } } } diff --git a/Core/src/main/java/com/plotsquared/core/configuration/StaticCaption.java b/Core/src/main/java/com/plotsquared/core/configuration/StaticCaption.java index be3cc364b..381b76227 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/StaticCaption.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/StaticCaption.java @@ -27,21 +27,18 @@ package com.plotsquared.core.configuration; import com.google.common.base.Preconditions; import com.plotsquared.core.configuration.caption.LocaleHolder; -import lombok.RequiredArgsConstructor; import javax.annotation.Nonnull; -@RequiredArgsConstructor public final class StaticCaption implements Caption { private final String value; - private final boolean usePrefix; /** * @deprecated Use {@link #of(String)} */ @Deprecated public StaticCaption(final String value) { - this(value, true); + this.value = value; } /** diff --git a/Core/src/main/java/com/plotsquared/core/configuration/caption/KeyedCaption.java b/Core/src/main/java/com/plotsquared/core/configuration/caption/KeyedCaption.java index 753d0abc6..e59210670 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/caption/KeyedCaption.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/caption/KeyedCaption.java @@ -26,7 +26,8 @@ package com.plotsquared.core.configuration.caption; import com.plotsquared.core.configuration.Caption; -import org.checkerframework.checker.nullness.qual.NonNull; + +import javax.annotation.Nonnull; /** * A {@link com.plotsquared.core.configuration.Caption} that can be identified by a key @@ -38,6 +39,6 @@ public interface KeyedCaption extends Caption { * * @return Caption key */ - @NonNull String getKey(); + @Nonnull String getKey(); } diff --git a/Core/src/main/java/com/plotsquared/core/configuration/caption/Templates.java b/Core/src/main/java/com/plotsquared/core/configuration/caption/Templates.java index 91e1fa4ef..63266c5a4 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/caption/Templates.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/caption/Templates.java @@ -28,7 +28,6 @@ package com.plotsquared.core.configuration.caption; import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.util.MainUtil; -import lombok.experimental.UtilityClass; import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.minimessage.Template; @@ -38,10 +37,14 @@ import java.util.UUID; /** * Utility class that generates {@link net.kyori.adventure.text.minimessage.Template templates} */ -@UtilityClass -public class Templates { +public final class Templates { - private final MiniMessage MINI_MESSAGE = MiniMessage.builder().build(); + private static final MiniMessage MINI_MESSAGE = MiniMessage.builder().build(); + + private Templates() { + throw new UnsupportedOperationException( + "This is a utility class and cannot be instantiated"); + } /** * Create a {@link net.kyori.adventure.text.minimessage.Template} from a PlotSquared {@link Caption} @@ -52,10 +55,9 @@ public class Templates { * @param replacements Replacements * @return Generated template */ - @Nonnull public Template of(@Nonnull final LocaleHolder localeHolder, - @Nonnull final String key, - @Nonnull final Caption caption, - @Nonnull final Template... replacements) { + @Nonnull public static Template of(@Nonnull final LocaleHolder localeHolder, + @Nonnull final String key, @Nonnull final Caption caption, + @Nonnull final Template... replacements) { return Template.of(key, MINI_MESSAGE.parse(caption.getComponent(localeHolder), replacements)); } @@ -66,8 +68,7 @@ public class Templates { * @param uuid Player UUID * @return Generated template */ - @Nonnull public Template of(@Nonnull final String key, - @Nonnull final UUID uuid) { + @Nonnull public static Template of(@Nonnull final String key, @Nonnull final UUID uuid) { final String username = MainUtil.getName(uuid); return Template.of(key, username); } @@ -79,8 +80,7 @@ public class Templates { * @param value Template value * @return Generated template */ - @Nonnull public Template of(@Nonnull final String key, - @Nonnull final String value) { + @Nonnull public static Template of(@Nonnull final String key, @Nonnull final String value) { return Template.of(key, value); } @@ -91,8 +91,7 @@ public class Templates { * @param area Plot area * @return Generated template */ - @Nonnull public Template of(@Nonnull final String key, - @Nonnull final PlotArea area) { + @Nonnull public static Template of(@Nonnull final String key, @Nonnull final PlotArea area) { return Template.of(key, area.toString()); } @@ -103,8 +102,7 @@ public class Templates { * @param number Number * @return Generated template */ - @Nonnull public Template of(@Nonnull final String key, - @Nonnull final Number number) { + @Nonnull public static Template of(@Nonnull final String key, @Nonnull final Number number) { return Template.of(key, number.toString()); } diff --git a/Core/src/main/java/com/plotsquared/core/configuration/caption/TranslatableCaption.java b/Core/src/main/java/com/plotsquared/core/configuration/caption/TranslatableCaption.java index 91042f99f..80ccf5bbe 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/caption/TranslatableCaption.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/caption/TranslatableCaption.java @@ -26,7 +26,6 @@ package com.plotsquared.core.configuration.caption; import com.plotsquared.core.PlotSquared; -import lombok.Getter; import javax.annotation.Nonnull; import java.util.Locale; @@ -36,7 +35,7 @@ import java.util.Locale; */ public final class TranslatableCaption implements KeyedCaption { - @Getter private final String key; + private final String key; private TranslatableCaption(@Nonnull final String key) { this.key = key; @@ -56,4 +55,7 @@ public final class TranslatableCaption implements KeyedCaption { return PlotSquared.get().getCaptionMap().getMessage(this, localeHolder); } + @Nonnull public String getKey() { + return this.key; + } } 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 ab8c50282..4bb366b6f 100644 --- a/Core/src/main/java/com/plotsquared/core/database/AbstractDB.java +++ b/Core/src/main/java/com/plotsquared/core/database/AbstractDB.java @@ -32,8 +32,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.HashMap; import java.util.List; import java.util.Map; 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 051e4ac3b..65da0087e 100644 --- a/Core/src/main/java/com/plotsquared/core/database/SQLManager.java +++ b/Core/src/main/java/com/plotsquared/core/database/SQLManager.java @@ -27,12 +27,11 @@ package com.plotsquared.core.database; import com.google.common.base.Charsets; import com.plotsquared.core.PlotSquared; -import com.plotsquared.core.inject.annotations.WorldConfig; -import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Storage; import com.plotsquared.core.configuration.file.YamlConfiguration; +import com.plotsquared.core.inject.annotations.WorldConfig; import com.plotsquared.core.listener.PlotListener; import com.plotsquared.core.location.BlockLoc; import com.plotsquared.core.plot.Plot; @@ -51,10 +50,10 @@ 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 javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; diff --git a/Core/src/main/java/com/plotsquared/core/events/PlayerAutoPlotEvent.java b/Core/src/main/java/com/plotsquared/core/events/PlayerAutoPlotEvent.java index 7bb935791..c0b3e3999 100644 --- a/Core/src/main/java/com/plotsquared/core/events/PlayerAutoPlotEvent.java +++ b/Core/src/main/java/com/plotsquared/core/events/PlayerAutoPlotEvent.java @@ -28,8 +28,6 @@ package com.plotsquared.core.events; import com.plotsquared.core.command.Claim; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.PlotArea; -import lombok.Getter; -import lombok.Setter; import javax.annotation.Nullable; @@ -37,10 +35,10 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve private Result eventResult; private String schematic; - @Getter private PlotPlayer player; - @Getter private PlotArea plotArea; - @Getter @Setter private int size_x; - @Getter @Setter private int size_z; + private final PlotPlayer player; + private final PlotArea plotArea; + private int size_x; + private int size_z; /** * PlayerAutoPlotEvent: called when a player attempts to auto claim a plot. @@ -51,7 +49,7 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve * @param size_x The size of the auto area * @param size_z The size of the auto area */ - public PlayerAutoPlotEvent(PlotPlayer player, PlotArea plotArea, @Nullable String schematic, + public PlayerAutoPlotEvent(PlotPlayer player, PlotArea plotArea, @Nullable String schematic, int size_x, int size_z) { super(null); this.player = player; @@ -84,4 +82,28 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve @Override public void setEventResult(Result e) { this.eventResult = e; } + + public PlotPlayer getPlayer() { + return this.player; + } + + public PlotArea getPlotArea() { + return this.plotArea; + } + + public int getSize_x() { + return this.size_x; + } + + public int getSize_z() { + return this.size_z; + } + + public void setSize_x(int size_x) { + this.size_x = size_x; + } + + public void setSize_z(int size_z) { + this.size_z = size_z; + } } 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 81653ffe4..83754ecb4 100644 --- a/Core/src/main/java/com/plotsquared/core/events/PlotAutoMergeEvent.java +++ b/Core/src/main/java/com/plotsquared/core/events/PlotAutoMergeEvent.java @@ -27,9 +27,8 @@ package com.plotsquared.core.events; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotId; -import lombok.Getter; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collections; import java.util.List; @@ -40,7 +39,7 @@ import java.util.List; public final class PlotAutoMergeEvent extends PlotEvent implements CancellablePlotEvent { private final List plots; - @Getter private final String world; + private final String world; private Result eventResult; /** @@ -73,4 +72,8 @@ public final class PlotAutoMergeEvent extends PlotEvent implements CancellablePl @Override public void setEventResult(Result e) { this.eventResult = e; } + + public String getWorld() { + return this.world; + } } 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 10b3d6c5f..e756c3835 100644 --- a/Core/src/main/java/com/plotsquared/core/events/PlotChangeOwnerEvent.java +++ b/Core/src/main/java/com/plotsquared/core/events/PlotChangeOwnerEvent.java @@ -28,8 +28,8 @@ package com.plotsquared.core.events; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotId; -import javax.annotation.Nullable; +import javax.annotation.Nullable; import java.util.UUID; public class PlotChangeOwnerEvent extends PlotEvent implements CancellablePlotEvent { 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 bec3a5bfa..db1dd2b00 100644 --- a/Core/src/main/java/com/plotsquared/core/events/PlotEvent.java +++ b/Core/src/main/java/com/plotsquared/core/events/PlotEvent.java @@ -26,6 +26,7 @@ package com.plotsquared.core.events; import com.plotsquared.core.plot.Plot; + import javax.annotation.Nonnull; public abstract class PlotEvent { 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 a6cbe6adc..a5f69bdc4 100644 --- a/Core/src/main/java/com/plotsquared/core/events/PlotMergeEvent.java +++ b/Core/src/main/java/com/plotsquared/core/events/PlotMergeEvent.java @@ -28,8 +28,7 @@ package com.plotsquared.core.events; import com.plotsquared.core.location.Direction; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; -import lombok.Getter; -import lombok.Setter; + import javax.annotation.Nonnull; /** @@ -38,11 +37,11 @@ import javax.annotation.Nonnull; */ public final class PlotMergeEvent extends PlotPlayerEvent implements CancellablePlotEvent { - @Getter private final String world; - @Getter @Setter private Direction dir; - @Getter @Setter private int max; + private final String world; + private Direction dir; + private int max; private Result eventResult; - @Getter private PlotPlayer player; + private PlotPlayer player; /** * PlotMergeEvent: Called when plots are merged @@ -54,7 +53,7 @@ public final class PlotMergeEvent extends PlotPlayerEvent implements Cancellable * @param player The player attempting the merge */ public PlotMergeEvent(@Nonnull final String world, @Nonnull final Plot plot, - @Nonnull final Direction dir, final int max, PlotPlayer player) { + @Nonnull final Direction dir, final int max, final PlotPlayer player) { super(player, plot); this.world = world; this.dir = dir; @@ -70,4 +69,28 @@ public final class PlotMergeEvent extends PlotPlayerEvent implements Cancellable @Override public void setEventResult(Result e) { this.eventResult = e; } + + public String getWorld() { + return this.world; + } + + public Direction getDir() { + return this.dir; + } + + public int getMax() { + return this.max; + } + + public PlotPlayer getPlayer() { + return this.player; + } + + public void setDir(Direction dir) { + this.dir = dir; + } + + public void setMax(int max) { + this.max = max; + } } 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 0590644b7..337eb84ab 100644 --- a/Core/src/main/java/com/plotsquared/core/events/PlotRateEvent.java +++ b/Core/src/main/java/com/plotsquared/core/events/PlotRateEvent.java @@ -28,6 +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 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 827be63d6..6f3ff82a7 100644 --- a/Core/src/main/java/com/plotsquared/core/events/PlotUnlinkEvent.java +++ b/Core/src/main/java/com/plotsquared/core/events/PlotUnlinkEvent.java @@ -27,8 +27,7 @@ package com.plotsquared.core.events; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; -import lombok.Getter; -import lombok.Setter; + import javax.annotation.Nonnull; /** @@ -37,10 +36,10 @@ import javax.annotation.Nonnull; */ public final class PlotUnlinkEvent extends PlotEvent implements CancellablePlotEvent { - @Getter private final PlotArea area; - @Getter @Setter boolean createRoad; - @Getter @Setter boolean createSign; - @Getter REASON reason; + private final PlotArea area; + boolean createRoad; + boolean createSign; + REASON reason; private Result eventResult = Result.ACCEPT; /** @@ -69,6 +68,30 @@ public final class PlotUnlinkEvent extends PlotEvent implements CancellablePlotE this.eventResult = e; } + public PlotArea getArea() { + return this.area; + } + + public boolean isCreateRoad() { + return this.createRoad; + } + + public boolean isCreateSign() { + return this.createSign; + } + + public REASON getReason() { + return this.reason; + } + + public void setCreateRoad(boolean createRoad) { + this.createRoad = createRoad; + } + + public void setCreateSign(boolean createSign) { + this.createSign = createSign; + } + public enum REASON { NEW_OWNER, PLAYER_COMMAND, CLEAR, DELETE, EXPIRE_DELETE } 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 e672a1fdf..0574b2422 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/AugmentedUtils.java +++ b/Core/src/main/java/com/plotsquared/core/generator/AugmentedUtils.java @@ -39,9 +39,9 @@ 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 javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Set; public class AugmentedUtils { 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 ac6aca214..787376ea3 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java +++ b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java @@ -40,8 +40,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.List; import java.util.Optional; 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 adeb5222c..d66b6db8b 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManagerComponent.java +++ b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManagerComponent.java @@ -26,7 +26,6 @@ package com.plotsquared.core.generator; import javax.annotation.Nonnull; - import java.util.Optional; /** 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 a09901c2c..ed6789cbb 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotWorld.java +++ b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotWorld.java @@ -35,6 +35,7 @@ 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 javax.annotation.Nonnull; import javax.annotation.Nullable; 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 108796e45..6269b62b2 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/GridPlotWorld.java +++ b/Core/src/main/java/com/plotsquared/core/generator/GridPlotWorld.java @@ -31,6 +31,7 @@ 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 javax.annotation.Nonnull; import javax.annotation.Nullable; 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 2560981ab..e29d38bd1 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/HybridGen.java +++ b/Core/src/main/java/com/plotsquared/core/generator/HybridGen.java @@ -38,6 +38,7 @@ 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 javax.annotation.Nonnull; public class HybridGen extends IndependentPlotGenerator { 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 e7fd298a0..d152d4bd4 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java +++ b/Core/src/main/java/com/plotsquared/core/generator/HybridPlotManager.java @@ -46,9 +46,8 @@ 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.BlockTypes; -import lombok.Getter; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -58,7 +57,7 @@ public class HybridPlotManager extends ClassicPlotManager { public static boolean REGENERATIVE_CLEAR = true; - @Getter private final HybridPlotWorld hybridPlotWorld; + private final HybridPlotWorld hybridPlotWorld; private final RegionManager regionManager; public HybridPlotManager(@Nonnull final HybridPlotWorld hybridPlotWorld, @@ -280,4 +279,8 @@ public class HybridPlotManager extends ClassicPlotManager { @Override public Location getSignLoc(Plot plot) { return hybridPlotWorld.getSignLocation(plot); } + + public HybridPlotWorld getHybridPlotWorld() { + return this.hybridPlotWorld; + } } 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 a4a0d3a28..611c4d249 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java +++ b/Core/src/main/java/com/plotsquared/core/generator/HybridPlotWorld.java @@ -55,12 +55,11 @@ import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; -import lombok.Getter; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import javax.inject.Inject; import java.io.File; import java.lang.reflect.Field; @@ -80,7 +79,7 @@ public class HybridPlotWorld extends ClassicPlotWorld { public HashMap G_SCH_B; public int SCHEM_Y; private Location SIGN_LOCATION; - @Getter private File root = null; + private File root = null; private final RegionManager regionManager; private final SchematicHandler schematicHandler; @@ -404,4 +403,8 @@ public class HybridPlotWorld extends ClassicPlotWorld { int pair = MathMan.pair(x, z); this.G_SCH_B.put(pair, id); } + + public File getRoot() { + return this.root; + } } 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 30586db05..927086cbc 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/HybridUtils.java +++ b/Core/src/main/java/com/plotsquared/core/generator/HybridUtils.java @@ -26,7 +26,6 @@ package com.plotsquared.core.generator; import com.google.inject.Inject; -import com.plotsquared.core.PlotSquared; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.events.PlotFlagAddEvent; import com.plotsquared.core.events.Result; @@ -65,8 +64,8 @@ import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.util.ArrayDeque; import java.util.ArrayList; 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 7e2f164d3..12df0288f 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/SingleWorldGenerator.java +++ b/Core/src/main/java/com/plotsquared/core/generator/SingleWorldGenerator.java @@ -35,6 +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 javax.annotation.Nonnull; public class SingleWorldGenerator extends IndependentPlotGenerator { 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 27e093f1b..68e31e590 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java +++ b/Core/src/main/java/com/plotsquared/core/generator/SquarePlotManager.java @@ -35,8 +35,8 @@ import com.plotsquared.core.util.RegionManager; import com.sk89q.worldedit.regions.CuboidRegion; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Iterator; import java.util.Set; 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 7215f94c6..74e3768d9 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/SquarePlotWorld.java +++ b/Core/src/main/java/com/plotsquared/core/generator/SquarePlotWorld.java @@ -32,11 +32,12 @@ 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 javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + public abstract class SquarePlotWorld extends GridPlotWorld { private static final Logger logger = LoggerFactory.getLogger("P2/" + SquarePlotWorld.class.getSimpleName()); 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 53c446949..dc6adfe7b 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 @@ -29,6 +29,7 @@ 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 javax.annotation.Nonnull; import javax.annotation.Nullable; 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 512a6256f..0dd259df9 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,8 +27,8 @@ package com.plotsquared.core.inject.factory; import com.plotsquared.core.backup.PlayerBackupProfile; import com.plotsquared.core.plot.Plot; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.UUID; public interface PlayerBackupProfileFactory { 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 06f011437..dc9eb8263 100644 --- a/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java +++ b/Core/src/main/java/com/plotsquared/core/listener/PlotListener.java @@ -67,9 +67,8 @@ 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 net.kyori.adventure.text.minimessage.Template; -import javax.annotation.Nullable; +import javax.annotation.Nullable; import java.util.HashMap; import java.util.Iterator; import java.util.Map; 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 fafaa9b1b..94b899eb9 100644 --- a/Core/src/main/java/com/plotsquared/core/listener/ProcessedWEExtent.java +++ b/Core/src/main/java/com/plotsquared/core/listener/ProcessedWEExtent.java @@ -44,8 +44,8 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; 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 4ae1c5c1f..be4eee802 100644 --- a/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java +++ b/Core/src/main/java/com/plotsquared/core/listener/WESubscriber.java @@ -45,8 +45,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Set; public class WESubscriber { 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 53db29ed7..0b232200a 100644 --- a/Core/src/main/java/com/plotsquared/core/location/Location.java +++ b/Core/src/main/java/com/plotsquared/core/location/Location.java @@ -31,8 +31,6 @@ import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; -import lombok.EqualsAndHashCode; -import lombok.Getter; import org.khelekore.prtree.MBR; import org.khelekore.prtree.SimpleMBR; @@ -42,12 +40,12 @@ import javax.annotation.Nullable; /** * An unmodifiable 6-tuple (world,x,y,z,yaw,pitch) */ -@EqualsAndHashCode @SuppressWarnings("unused") +@SuppressWarnings("unused") public final class Location implements Comparable { - @Getter private final float yaw; - @Getter private final float pitch; - @Getter private final BlockVector3 blockVector3; + private final float yaw; + private final float pitch; + private final BlockVector3 blockVector3; private final World world; private Location(@Nonnull final World world, @Nonnull final BlockVector3 blockVector3, @@ -451,4 +449,51 @@ public final class Location implements Comparable { + this.getZ() + ",\"yaw\":" + this.yaw + ",\"pitch\":" + this.pitch + ",\"world\":\"" + this.world + "\"}"; } + + public boolean equals(final Object o) { + if (o == this) + return true; + if (!(o instanceof Location)) + return false; + final Location other = (Location) o; + if (Float.compare(this.yaw, other.yaw) != 0) + return false; + if (Float.compare(this.pitch, other.pitch) != 0) + return false; + final Object this$blockVector3 = this.blockVector3; + final Object other$blockVector3 = other.blockVector3; + if (this$blockVector3 == null ? + other$blockVector3 != null : + !this$blockVector3.equals(other$blockVector3)) + return false; + final Object this$world = this.getWorld(); + final Object other$world = other.getWorld(); + if (this$world == null ? other$world != null : !this$world.equals(other$world)) + return false; + return true; + } + + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + Float.floatToIntBits(this.yaw); + result = result * PRIME + Float.floatToIntBits(this.pitch); + final Object $blockVector3 = this.blockVector3; + result = result * PRIME + ($blockVector3 == null ? 43 : $blockVector3.hashCode()); + final Object $world = this.getWorld(); + result = result * PRIME + ($world == null ? 43 : $world.hashCode()); + return result; + } + + public float getYaw() { + return this.yaw; + } + + public float getPitch() { + return this.pitch; + } + + public BlockVector3 getBlockVector3() { + return this.blockVector3; + } } 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 8301f23a7..d2aec4149 100644 --- a/Core/src/main/java/com/plotsquared/core/location/PlotLoc.java +++ b/Core/src/main/java/com/plotsquared/core/location/PlotLoc.java @@ -26,16 +26,12 @@ package com.plotsquared.core.location; import com.plotsquared.core.util.StringMan; -import lombok.AllArgsConstructor; + import javax.annotation.Nullable; -//todo better description needed - - /** * (x,y,z) or (x,z) representation for PlotSquared (hence the "Plot" prefix) */ -@AllArgsConstructor public final class PlotLoc { private final int x; @@ -52,6 +48,12 @@ public final class PlotLoc { this(x, -1, z); } + public PlotLoc(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + @Nullable public static PlotLoc fromString(final String input) { if (input == null || "side".equalsIgnoreCase(input)) { return null; 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 f467c595f..932e5e4fa 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/BlockBucket.java +++ b/Core/src/main/java/com/plotsquared/core/plot/BlockBucket.java @@ -36,21 +36,18 @@ import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; -import lombok.EqualsAndHashCode; -import lombok.Getter; +import org.jetbrains.annotations.NotNull; -import lombok.RequiredArgsConstructor; import javax.annotation.Nonnull; - import java.util.Arrays; import java.util.Map; +import java.util.Objects; import java.util.regex.Matcher; /** * A block bucket is a container of block types, where each block * has a specified chance of being randomly picked */ -@EqualsAndHashCode(of = {"input"}) @SuppressWarnings({"unused", "WeakerAccess"}) public final class BlockBucket implements ConfigurationSerializable { private static java.util.regex.Pattern regex = java.util.regex.Pattern.compile( @@ -60,21 +57,21 @@ public final class BlockBucket implements ConfigurationSerializable { private BlockState single; private Pattern pattern; - public BlockBucket(BlockType type) { + public BlockBucket(@NotNull final BlockType type) { this(type.getId()); this.single = type.getDefaultState(); this.pattern = new BlockPattern(this.single); this.compiled = true; } - public BlockBucket(BlockState state) { + public BlockBucket(@NotNull final BlockState state) { this(state.getAsString()); this.single = state; this.pattern = new BlockPattern(this.single); this.compiled = true; } - public BlockBucket(String input) { + public BlockBucket(@NotNull final String input) { this.input = new StringBuilder(input); } @@ -194,14 +191,38 @@ public final class BlockBucket implements ConfigurationSerializable { return ImmutableMap.of("blocks", this.toString()); } - @Getter - @EqualsAndHashCode - @RequiredArgsConstructor + public boolean equals(final Object o) { + if (o == this) { + return true; + } + if (!(o instanceof BlockBucket)) { + return false; + } + final BlockBucket other = (BlockBucket) o; + final Object this$input = this.input; + final Object other$input = other.input; + return Objects.equals(this$input, other$input); + } + + public int hashCode() { + final int PRIME = 59; + int result = 1; + final Object $input = this.input; + result = result * PRIME + ($input == null ? 43 : $input.hashCode()); + return result; + } + private static final class Range { private final int min; private final int max; - @Getter private final boolean automatic; + private final boolean automatic; + + public Range(int min, int max, boolean automatic) { + this.min = min; + this.max = max; + this.automatic = automatic; + } public int getWeight() { return max - min; @@ -210,5 +231,41 @@ public final class BlockBucket implements ConfigurationSerializable { public boolean isInRange(final int num) { return num <= max && num >= min; } + + public int getMin() { + return this.min; + } + + public int getMax() { + return this.max; + } + + public boolean equals(final Object o) { + if (o == this) + return true; + if (!(o instanceof Range)) + return false; + final Range other = (Range) o; + if (this.getMin() != other.getMin()) + return false; + if (this.getMax() != other.getMax()) + return false; + if (this.isAutomatic() != other.isAutomatic()) + return false; + return true; + } + + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + this.getMin(); + result = result * PRIME + this.getMax(); + result = result * PRIME + (this.isAutomatic() ? 79 : 97); + return result; + } + + public boolean isAutomatic() { + return this.automatic; + } } } 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 70f39aa08..99e7be7c6 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -74,12 +74,11 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockTypes; -import lombok.Getter; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.awt.geom.Area; import java.awt.geom.PathIterator; import java.awt.geom.Rectangle2D; @@ -112,7 +111,6 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_MOB; import static com.plotsquared.core.util.entity.EntityCategories.CAP_MONSTER; import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE; - /** * The plot class
* [IMPORTANT] @@ -144,7 +142,7 @@ public class Plot { /** * Plot flag container */ - @Getter private final FlagContainer flagContainer = new FlagContainer(null); + private final FlagContainer flagContainer = new FlagContainer(null); /** * Has the plot changed since the last save cycle? */ @@ -3398,4 +3396,7 @@ public class Plot { return FlagContainer.castUnsafe(flagInstance).getValue(); } + public FlagContainer getFlagContainer() { + return this.flagContainer; + } } 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 9ad26c0aa..b6faf2fa4 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java @@ -27,7 +27,6 @@ package com.plotsquared.core.plot; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import com.plotsquared.core.PlotSquared; import com.plotsquared.core.collection.QuadMap; import com.plotsquared.core.configuration.CaptionUtility; import com.plotsquared.core.configuration.Captions; @@ -63,14 +62,11 @@ import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeTypes; import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameModes; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.Setter; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -92,39 +88,39 @@ public abstract class PlotArea { private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotArea.class.getSimpleName()); protected final ConcurrentHashMap plots = new ConcurrentHashMap<>(); - @Getter @Nonnull private final String worldName; - @Getter private final String id; - @Getter @Nonnull private final PlotManager plotManager; - @Getter private final int worldHash; + @Nonnull private final String worldName; + private final String id; + @Nonnull private final PlotManager plotManager; + private final int worldHash; private final PlotId min; private final PlotId max; - @Getter @Nonnull private final IndependentPlotGenerator generator; - @Getter private int maxPlotMembers = 128; - @Getter private boolean autoMerge = false; - @Setter private boolean allowSigns = true; - @Getter private boolean miscSpawnUnowned = false; - @Getter private boolean mobSpawning = false; - @Getter private boolean mobSpawnerSpawning = false; - @Getter private BiomeType plotBiome = BiomeTypes.FOREST; - @Getter private boolean plotChat = true; - @Getter private boolean forcingPlotChat = false; - @Getter private boolean schematicClaimSpecify = false; - @Getter private boolean schematicOnClaim = false; - @Getter private String schematicFile = "null"; - @Getter private boolean spawnEggs = false; - @Getter private boolean spawnCustom = true; - @Getter private boolean spawnBreeding = false; - @Getter private PlotAreaType type = PlotAreaType.NORMAL; - @Getter private PlotAreaTerrainType terrain = PlotAreaTerrainType.NONE; - @Getter private boolean homeAllowNonmember = false; - @Getter private PlotLoc nonmemberHome; - @Getter @Setter(AccessLevel.PROTECTED) private PlotLoc defaultHome; - @Getter private int maxBuildHeight = 256; - @Getter private int minBuildHeight = 1; - @Getter private GameMode gameMode = GameModes.CREATIVE; - @Getter private Map> prices = new HashMap<>(); - @Getter(AccessLevel.PROTECTED) private List schematics = new ArrayList<>(); - @Getter private boolean roadFlags = false; + @Nonnull private final IndependentPlotGenerator generator; + private int maxPlotMembers = 128; + private boolean autoMerge = false; + private boolean allowSigns = true; + private boolean miscSpawnUnowned = false; + private boolean mobSpawning = false; + private boolean mobSpawnerSpawning = false; + private BiomeType plotBiome = BiomeTypes.FOREST; + private boolean plotChat = true; + private boolean forcingPlotChat = false; + private boolean schematicClaimSpecify = false; + private boolean schematicOnClaim = false; + private String schematicFile = "null"; + private boolean spawnEggs = false; + private boolean spawnCustom = true; + private boolean spawnBreeding = false; + private PlotAreaType type = PlotAreaType.NORMAL; + private PlotAreaTerrainType terrain = PlotAreaTerrainType.NONE; + private boolean homeAllowNonmember = false; + private PlotLoc nonmemberHome; + private PlotLoc defaultHome; + private int maxBuildHeight = 256; + private int minBuildHeight = 1; + private GameMode gameMode = GameModes.CREATIVE; + private Map> prices = new HashMap<>(); + private List schematics = new ArrayList<>(); + private boolean roadFlags = false; private boolean worldBorder = false; private boolean useEconomy = false; private int hash; @@ -134,9 +130,9 @@ public abstract class PlotArea { /** * Area flag container */ - @Getter private final FlagContainer flagContainer = + private final FlagContainer flagContainer = new FlagContainer(GlobalFlagContainer.getInstance()); - @Getter private final FlagContainer roadFlagContainer = + private final FlagContainer roadFlagContainer = new FlagContainer(GlobalFlagContainer.getInstance()); private final YamlConfiguration worldConfiguration; @@ -1176,4 +1172,140 @@ public abstract class PlotArea { final PlotFlag flagInstance = this.roadFlagContainer.getFlagErased(flagClass); return FlagContainer.castUnsafe(flagInstance).getValue(); } + + @Nonnull public String getWorldName() { + return this.worldName; + } + + public String getId() { + return this.id; + } + + @Nonnull public PlotManager getPlotManager() { + return this.plotManager; + } + + public int getWorldHash() { + return this.worldHash; + } + + @Nonnull public IndependentPlotGenerator getGenerator() { + return this.generator; + } + + public int getMaxPlotMembers() { + return this.maxPlotMembers; + } + + public boolean isAutoMerge() { + return this.autoMerge; + } + + public boolean isMiscSpawnUnowned() { + return this.miscSpawnUnowned; + } + + public boolean isMobSpawning() { + return this.mobSpawning; + } + + public boolean isMobSpawnerSpawning() { + return this.mobSpawnerSpawning; + } + + public BiomeType getPlotBiome() { + return this.plotBiome; + } + + public boolean isPlotChat() { + return this.plotChat; + } + + public boolean isForcingPlotChat() { + return this.forcingPlotChat; + } + + public boolean isSchematicClaimSpecify() { + return this.schematicClaimSpecify; + } + + public boolean isSchematicOnClaim() { + return this.schematicOnClaim; + } + + public String getSchematicFile() { + return this.schematicFile; + } + + public boolean isSpawnEggs() { + return this.spawnEggs; + } + + public boolean isSpawnCustom() { + return this.spawnCustom; + } + + public boolean isSpawnBreeding() { + return this.spawnBreeding; + } + + public PlotAreaType getType() { + return this.type; + } + + public PlotAreaTerrainType getTerrain() { + return this.terrain; + } + + public boolean isHomeAllowNonmember() { + return this.homeAllowNonmember; + } + + public PlotLoc getNonmemberHome() { + return this.nonmemberHome; + } + + public PlotLoc getDefaultHome() { + return this.defaultHome; + } + + public int getMaxBuildHeight() { + return this.maxBuildHeight; + } + + public int getMinBuildHeight() { + return this.minBuildHeight; + } + + public GameMode getGameMode() { + return this.gameMode; + } + + public Map> getPrices() { + return this.prices; + } + + protected List getSchematics() { + return this.schematics; + } + + public boolean isRoadFlags() { + return this.roadFlags; + } + + public FlagContainer getFlagContainer() { + return this.flagContainer; + } + + public FlagContainer getRoadFlagContainer() { + return this.roadFlagContainer; + } + + public void setAllowSigns(boolean allowSigns) { + this.allowSigns = allowSigns; + } + + protected void setDefaultHome(PlotLoc defaultHome) { + this.defaultHome = defaultHome; + } } diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotAreaType.java b/Core/src/main/java/com/plotsquared/core/plot/PlotAreaType.java index 9ed4cb0f0..3e73dd2fb 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotAreaType.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotAreaType.java @@ -27,8 +27,8 @@ package com.plotsquared.core.plot; import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; -import lombok.Getter; +import javax.annotation.Nonnull; import java.util.Map; import java.util.Optional; import java.util.function.Function; @@ -40,12 +40,12 @@ public enum PlotAreaType { AUGMENTED(Captions.PLOT_AREA_TYPE_AUGMENTED), PARTIAL(Captions.PLOT_AREA_TYPE_PARTIAL); - @Getter private final Caption description; + private final Caption description; private static final Map types = Stream.of(values()) .collect(Collectors.toMap(e -> e.toString().toLowerCase(), Function.identity())); - PlotAreaType(Caption description) { + PlotAreaType(@Nonnull final Caption description) { this.description = description; } @@ -63,4 +63,8 @@ public enum PlotAreaType { } return Optional.of(values()[typeId]); } + + public Caption getDescription() { + return this.description; + } } 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 ea7484129..805b602ff 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotCluster.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotCluster.java @@ -31,8 +31,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.HashSet; import java.util.UUID; import java.util.function.Consumer; 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 3327c1473..7f014fde6 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotId.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotId.java @@ -26,6 +26,7 @@ package com.plotsquared.core.plot; import com.plotsquared.core.location.Direction; + import javax.annotation.Nonnull; import javax.annotation.Nullable; 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 a810093b0..159cb71a0 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java @@ -27,11 +27,11 @@ package com.plotsquared.core.plot; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.util.InventoryUtil; - -import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; + public class PlotInventory { private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotInventory.class.getSimpleName()); diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotItemStack.java b/Core/src/main/java/com/plotsquared/core/plot/PlotItemStack.java index a5c071476..56c691fdc 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotItemStack.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotItemStack.java @@ -29,14 +29,13 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.LegacyMapper; -import lombok.Getter; public class PlotItemStack { public final int amount; public final String name; public final String[] lore; - @Getter private final ItemType type; + private final ItemType type; /** * @param id Legacy numerical item ID @@ -72,4 +71,8 @@ public class PlotItemStack { public BlockState getBlockState() { return type.getBlockType().getDefaultState(); } + + public ItemType getType() { + return this.type; + } } diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotSettings.java b/Core/src/main/java/com/plotsquared/core/plot/PlotSettings.java index d873d6800..fc5d0ca72 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotSettings.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotSettings.java @@ -29,8 +29,6 @@ import com.google.common.collect.ImmutableList; import com.plotsquared.core.location.BlockLoc; import com.plotsquared.core.location.Direction; import com.plotsquared.core.plot.comment.PlotComment; -import lombok.Getter; -import lombok.Setter; import java.util.ArrayList; import java.util.Collections; @@ -49,19 +47,19 @@ public class PlotSettings { /** * Merged plots. */ - @Getter private boolean[] merged = new boolean[] {false, false, false, false}; + private boolean[] merged = new boolean[] {false, false, false, false}; /** * Plot alias. */ - @Getter @Setter private String alias = ""; + private String alias = ""; /** * The ratings for a plot. */ - @Setter private HashMap ratings; + private HashMap ratings; /** * Plot comments. */ - @Setter private List comments = null; + private List comments = null; /** * Home Position. */ @@ -148,4 +146,24 @@ public class PlotSettings { } this.comments.add(comment); } + + public boolean[] getMerged() { + return this.merged; + } + + public String getAlias() { + return this.alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + public void setRatings(HashMap ratings) { + this.ratings = ratings; + } + + public void setComments(List comments) { + this.comments = comments; + } } 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 76f9d4c9f..873bbf615 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java @@ -27,16 +27,15 @@ package com.plotsquared.core.plot; import com.plotsquared.core.location.Location; import com.sk89q.worldedit.regions.CuboidRegion; -import lombok.EqualsAndHashCode; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Collection; +import java.util.Objects; /** * A world that contains plots */ -@EqualsAndHashCode public abstract class PlotWorld { private final String world; @@ -102,4 +101,31 @@ public abstract class PlotWorld { return this.world; } + public boolean equals(final Object o) { + if (o == this) { + return true; + } + if (!(o instanceof PlotWorld)) { + return false; + } + final PlotWorld other = (PlotWorld) o; + if (!other.canEqual(this)) { + return false; + } + final Object this$world = this.getWorld(); + final Object other$world = other.getWorld(); + return Objects.equals(this$world, other$world); + } + + protected boolean canEqual(final Object other) { + return other instanceof PlotWorld; + } + + public int hashCode() { + final int PRIME = 59; + int result = 1; + final Object $world = this.getWorld(); + result = result * PRIME + ($world == null ? 43 : $world.hashCode()); + return result; + } } 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 e805ff87a..b5fbbd385 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 @@ -43,15 +43,14 @@ import com.plotsquared.core.plot.flag.implementations.KeepFlag; import com.plotsquared.core.plot.message.PlotMessage; import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.MainUtil; -import com.plotsquared.core.util.StringMan; 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.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; 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 022a3dc93..70da33a63 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,8 +30,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; 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 b93d912c1..d6940b74d 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 @@ -27,23 +27,22 @@ package com.plotsquared.core.plot.flag; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; -import lombok.EqualsAndHashCode; -import lombok.Setter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Locale; import java.util.Map; +import java.util.Objects; /** * Container type for {@link PlotFlag plot flags}. */ -@EqualsAndHashCode(of = "flagMap") public class FlagContainer { +public class FlagContainer { private static final Logger logger = LoggerFactory.getLogger("P2/" + FlagContainer.class.getSimpleName()); @@ -51,7 +50,7 @@ import java.util.Map; private final Map, PlotFlag> flagMap = new HashMap<>(); private final PlotFlagUpdateHandler plotFlagUpdateHandler; private final Collection updateSubscribers = new ArrayList<>(); - @Setter private FlagContainer parentContainer; + private FlagContainer parentContainer; /** * Construct a new flag container with an optional parent container and update handler. @@ -318,6 +317,38 @@ import java.util.Map; this.unknownFlags.put(flagName.toLowerCase(Locale.ENGLISH), value); } + public boolean equals(final Object o) { + if (o == this) { + return true; + } + if (!(o instanceof FlagContainer)) { + return false; + } + final FlagContainer other = (FlagContainer) o; + if (!other.canEqual(this)) { + return false; + } + final Object this$flagMap = this.getFlagMap(); + final Object other$flagMap = other.getFlagMap(); + return Objects.equals(this$flagMap, other$flagMap); + } + + protected boolean canEqual(final Object other) { + return other instanceof FlagContainer; + } + + public int hashCode() { + final int PRIME = 59; + int result = 1; + final Object $flagMap = this.getFlagMap(); + result = result * PRIME + ($flagMap == null ? 43 : $flagMap.hashCode()); + return result; + } + + public void setParentContainer(FlagContainer parentContainer) { + this.parentContainer = parentContainer; + } + /** * Update event types used in {@link PlotFlagUpdateHandler}. */ diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/GlobalFlagContainer.java b/Core/src/main/java/com/plotsquared/core/plot/flag/GlobalFlagContainer.java index 4d7fdd396..b321fa1f2 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/GlobalFlagContainer.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/GlobalFlagContainer.java @@ -104,7 +104,6 @@ import com.plotsquared.core.plot.flag.implementations.VehicleUseFlag; import com.plotsquared.core.plot.flag.implementations.VillagerInteractFlag; import com.plotsquared.core.plot.flag.implementations.VineGrowFlag; import com.plotsquared.core.plot.flag.implementations.WeatherFlag; -import lombok.Getter; import javax.annotation.Nonnull; import java.util.Collections; @@ -114,7 +113,7 @@ import java.util.Map; public final class GlobalFlagContainer extends FlagContainer { - @Getter private static final GlobalFlagContainer instance = new GlobalFlagContainer(); + private static final GlobalFlagContainer instance = new GlobalFlagContainer(); private static Map> stringClassMap; private GlobalFlagContainer() { @@ -221,6 +220,10 @@ public final class GlobalFlagContainer extends FlagContainer { this.addFlag(new DoneFlag("")); } + public static GlobalFlagContainer getInstance() { + return GlobalFlagContainer.instance; + } + @Override public PlotFlag getFlagErased(Class flagClass) { final PlotFlag flag = super.getFlagErased(flagClass); if (flag != null) { 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 1007726df..b8507b982 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 @@ -28,9 +28,8 @@ package com.plotsquared.core.plot.flag; import com.google.common.base.Preconditions; import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; -import lombok.EqualsAndHashCode; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.Collections; @@ -41,7 +40,7 @@ import java.util.Collections; * * @param Value contained in the flag. */ -@EqualsAndHashCode(of = "value") public abstract class PlotFlag> { +public abstract class PlotFlag> { private final T value; private final Caption flagCategory; @@ -177,4 +176,30 @@ import java.util.Collections; return Collections.emptyList(); } + public boolean equals(final Object o) { + if (o == this) + return true; + if (!(o instanceof PlotFlag)) + return false; + final PlotFlag other = (PlotFlag) o; + if (!other.canEqual((Object) this)) + return false; + final Object this$value = this.getValue(); + final Object other$value = other.getValue(); + if (this$value == null ? other$value != null : !this$value.equals(other$value)) + return false; + return true; + } + + protected boolean canEqual(final Object other) { + return other instanceof PlotFlag; + } + + public int hashCode() { + final int PRIME = 59; + int result = 1; + final Object $value = this.getValue(); + result = result * PRIME + ($value == null ? 43 : $value.hashCode()); + return result; + } } 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 173d8caf2..d0543e6c5 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,8 +29,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; 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 8eb750aa7..2f93b304d 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class AnimalAttackFlag extends BooleanFlag { 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 78bdf65b2..99285b407 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag; + import javax.annotation.Nonnull; public class AnimalCapFlag extends NonNegativeIntegerFlag { 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 00c854f88..66bcd83e8 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class AnimalInteractFlag extends BooleanFlag { 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 202513067..c28387c40 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class BlockBurnFlag extends BooleanFlag { 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 add18aebf..7c708cb09 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class BlockIgnitionFlag extends BooleanFlag { 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 1bcdb39c2..5c916d933 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,8 +28,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Arrays; import java.util.Collections; import java.util.List; 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 c005efe5f..435d2143c 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,8 +28,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collections; import java.util.List; 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 8975375b0..9114788b9 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class ChatFlag extends BooleanFlag { 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 da501eb6c..595cc8d74 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class CoralDryFlag extends BooleanFlag { 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 e02a1b0e8..afd048335 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,9 +30,9 @@ 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 javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Arrays; import java.util.Collection; diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DescriptionFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DescriptionFlag.java index 0d8b2cd9b..4633c2c25 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DescriptionFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/DescriptionFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.PlotFlag; + import javax.annotation.Nonnull; public class DescriptionFlag extends PlotFlag { 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 981c4bfe4..6500c33ea 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class DeviceInteractFlag extends BooleanFlag { 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 a0578b1fe..f4693bcb2 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class DisablePhysicsFlag extends BooleanFlag { 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 be94170fe..e1273654d 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,6 +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 javax.annotation.Nonnull; public class DoneFlag extends PlotFlag implements InternalFlag { 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 785d29b6e..07d444838 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class DropProtectionFlag extends BooleanFlag { 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 13b7b4d21..3ed36a55c 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag; + import javax.annotation.Nonnull; public class EntityCapFlag extends NonNegativeIntegerFlag { 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 ed611d57d..7f80a7714 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class ExplosionFlag extends BooleanFlag { 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 1231d64a4..9e751a678 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.PlotFlag; + import javax.annotation.Nonnull; public class FarewellFlag extends PlotFlag { 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 05164b8d2..495122293 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,6 +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.TimedFlag; + import javax.annotation.Nonnull; public class FeedFlag extends TimedFlag { 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 478e17858..70fcfbf28 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,8 +27,8 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.PlotFlag; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Arrays; import java.util.Collection; 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 98136a7b3..107a24c07 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class ForcefieldFlag extends BooleanFlag { 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 4c6b60020..8dfba1761 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,6 +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 javax.annotation.Nonnull; public class GamemodeFlag extends PlotFlag { 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 ad63de5ee..4747e6157 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class GrassGrowFlag extends BooleanFlag { 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 3c6cc0163..d1cd9020a 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.PlotFlag; + import javax.annotation.Nonnull; public class GreetingFlag extends PlotFlag { 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 090b056ea..e4a3f546e 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,6 +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 javax.annotation.Nonnull; public class GuestGamemodeFlag extends PlotFlag { 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 ca7f1fb37..bcbccd675 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class HangingBreakFlag extends BooleanFlag { 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 eb3441ee1..fd5c47730 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class HangingPlaceFlag extends BooleanFlag { 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 e683b82a6..d53ceaeb7 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,6 +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.TimedFlag; + import javax.annotation.Nonnull; public class HealFlag extends TimedFlag { 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 81d85906f..260eca55a 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class HideInfoFlag extends BooleanFlag { 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 da5e8e4af..1548d2974 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class HostileAttackFlag extends BooleanFlag { 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 9d442bb00..dc2ea8a4b 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag; + import javax.annotation.Nonnull; public class HostileCapFlag extends NonNegativeIntegerFlag { 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 e903cd76c..38f84f682 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class HostileInteractFlag extends BooleanFlag { 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 b380d0773..1a28e114c 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class IceFormFlag extends BooleanFlag { 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 ef97c8964..a6ee3f00b 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class IceMeltFlag extends BooleanFlag { 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 90d5632f1..831dd8255 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class InstabreakFlag extends BooleanFlag { 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 e3328a6a2..832c2ea01 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class InvincibleFlag extends BooleanFlag { 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 654505a38..e292c8df8 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,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class ItemDropFlag extends BooleanFlag { 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 187237f2a..78689a154 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,6 +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 javax.annotation.Nonnull; public class KeepFlag extends PlotFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KeepInventoryFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KeepInventoryFlag.java index 40592bfd3..fca69a1e3 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KeepInventoryFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KeepInventoryFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class KeepInventoryFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KelpGrowFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KelpGrowFlag.java index 43bcb5398..e2e972a3e 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KelpGrowFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/KelpGrowFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class KelpGrowFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/LiquidFlowFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/LiquidFlowFlag.java index c0c0e4f17..ed06554b9 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/LiquidFlowFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/LiquidFlowFlag.java @@ -27,8 +27,8 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.PlotFlag; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Arrays; import java.util.Collection; diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscBreakFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscBreakFlag.java index e0fdd3e8e..fe3abab2d 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscBreakFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscBreakFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class MiscBreakFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscCapFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscCapFlag.java index dfe55373e..39c795250 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscCapFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscCapFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag; + import javax.annotation.Nonnull; public class MiscCapFlag extends NonNegativeIntegerFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscInteractFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscInteractFlag.java index a64116119..4c002f51b 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscInteractFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscInteractFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class MiscInteractFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscPlaceFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscPlaceFlag.java index 2cf52f8e0..8c2d3b2e5 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscPlaceFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MiscPlaceFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class MiscPlaceFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobBreakFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobBreakFlag.java index e0d8e88e5..45f4fba54 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobBreakFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobBreakFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class MobBreakFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobCapFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobCapFlag.java index a1e202984..01ecfd319 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobCapFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobCapFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag; + import javax.annotation.Nonnull; public class MobCapFlag extends NonNegativeIntegerFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobPlaceFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobPlaceFlag.java index ae54d6321..2385e2d66 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobPlaceFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MobPlaceFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class MobPlaceFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MusicFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MusicFlag.java index d03a212cd..ef1fcfc67 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MusicFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MusicFlag.java @@ -31,6 +31,7 @@ import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.util.ItemUtil; import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; + import javax.annotation.Nonnull; public class MusicFlag extends PlotFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MycelGrowFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MycelGrowFlag.java index c54fe938b..dcb70bb21 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MycelGrowFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/MycelGrowFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class MycelGrowFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NoWorldeditFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NoWorldeditFlag.java index e3760ee1a..5bf272d41 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NoWorldeditFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NoWorldeditFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class NoWorldeditFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NotifyEnterFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NotifyEnterFlag.java index 7cb4c3422..db9b31afa 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NotifyEnterFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NotifyEnterFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class NotifyEnterFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NotifyLeaveFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NotifyLeaveFlag.java index 55734a57a..ea57ddf6d 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NotifyLeaveFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/NotifyLeaveFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class NotifyLeaveFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PlaceFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PlaceFlag.java index 25c3ae0d6..106ea6bb5 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PlaceFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PlaceFlag.java @@ -28,8 +28,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collections; import java.util.List; diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PlayerInteractFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PlayerInteractFlag.java index 859cd98f9..f50bf9156 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PlayerInteractFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PlayerInteractFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class PlayerInteractFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PreventCreativeCopyFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PreventCreativeCopyFlag.java index fd74c9f30..57139054a 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PreventCreativeCopyFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PreventCreativeCopyFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class PreventCreativeCopyFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PriceFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PriceFlag.java index 287e64d87..febdea95a 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PriceFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PriceFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.DoubleFlag; + import javax.annotation.Nonnull; public class PriceFlag extends DoubleFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PveFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PveFlag.java index 3fafa389a..d0222e790 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PveFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PveFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class PveFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PvpFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PvpFlag.java index 98d7bea46..0699d57cf 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PvpFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/PvpFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class PvpFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/RedstoneFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/RedstoneFlag.java index c31105a46..1fcefa066 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/RedstoneFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/RedstoneFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class RedstoneFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ServerPlotFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ServerPlotFlag.java index a3ca35bdf..a6af472a5 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ServerPlotFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/ServerPlotFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class ServerPlotFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SnowFormFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SnowFormFlag.java index 74da52ee7..25df819f4 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SnowFormFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SnowFormFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class SnowFormFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SnowMeltFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SnowMeltFlag.java index 1384ebcba..8f4ed2817 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SnowMeltFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SnowMeltFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class SnowMeltFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SoilDryFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SoilDryFlag.java index 6787bbc07..b40b3d442 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SoilDryFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/SoilDryFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class SoilDryFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TamedAttackFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TamedAttackFlag.java index 03ad2ab4f..1161c5fe2 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TamedAttackFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TamedAttackFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class TamedAttackFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TamedInteractFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TamedInteractFlag.java index 0c10d9c82..b4d2e8b44 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TamedInteractFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TamedInteractFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class TamedInteractFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TimeFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TimeFlag.java index f1e16d435..700e56a76 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TimeFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TimeFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.LongFlag; + import javax.annotation.Nonnull; public class TimeFlag extends LongFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TitlesFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TitlesFlag.java index 18cdd907f..bf521ff40 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TitlesFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/TitlesFlag.java @@ -28,9 +28,9 @@ 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.PlotFlag; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Arrays; import java.util.Collection; import java.util.Locale; diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/UntrustedVisitFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/UntrustedVisitFlag.java index 4f0014709..37804030f 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/UntrustedVisitFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/UntrustedVisitFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class UntrustedVisitFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/UseFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/UseFlag.java index 76b62d1e3..7b8306201 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/UseFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/UseFlag.java @@ -28,8 +28,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collections; import java.util.List; diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleBreakFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleBreakFlag.java index 88ff325b5..fc0575d7b 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleBreakFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleBreakFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class VehicleBreakFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleCapFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleCapFlag.java index d221546ea..cc159f3d9 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleCapFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleCapFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.NonNegativeIntegerFlag; + import javax.annotation.Nonnull; public class VehicleCapFlag extends NonNegativeIntegerFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehiclePlaceFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehiclePlaceFlag.java index ce64a50c9..bc41a3201 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehiclePlaceFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehiclePlaceFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class VehiclePlaceFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleUseFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleUseFlag.java index a9d1b151c..91630c4e7 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleUseFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VehicleUseFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class VehicleUseFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VillagerInteractFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VillagerInteractFlag.java index 6721afb08..cef044da8 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VillagerInteractFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VillagerInteractFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class VillagerInteractFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VineGrowFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VineGrowFlag.java index a19a7b361..3702a88df 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VineGrowFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/VineGrowFlag.java @@ -27,6 +27,7 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.types.BooleanFlag; + import javax.annotation.Nonnull; public class VineGrowFlag extends BooleanFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/WeatherFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/WeatherFlag.java index 708833c9a..de9a12327 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/WeatherFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/implementations/WeatherFlag.java @@ -28,8 +28,8 @@ package com.plotsquared.core.plot.flag.implementations; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.PlotWeather; import com.plotsquared.core.plot.flag.PlotFlag; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Arrays; import java.util.Collection; diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeListFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeListFlag.java index bc6317009..64bc26b98 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeListFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeListFlag.java @@ -32,8 +32,8 @@ import com.plotsquared.core.util.BlockUtil; import com.sk89q.worldedit.world.block.BlockCategory; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java index 11d31304f..268f0cd81 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/BlockTypeWrapper.java @@ -31,12 +31,11 @@ import com.plotsquared.core.configuration.Settings; import com.sk89q.worldedit.world.block.BlockCategory; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; -import lombok.Getter; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.HashMap; import java.util.Map; @@ -50,7 +49,7 @@ public class BlockTypeWrapper { private static final Map blockTypes = new HashMap<>(); private static final Map blockCategories = new HashMap<>(); - @Nullable @Getter private final BlockType blockType; + @Nullable private final BlockType blockType; @Nullable private final String blockCategoryId; @Nullable private BlockCategory blockCategory; @@ -156,6 +155,10 @@ public class BlockTypeWrapper { return Objects.hashCode(this.blockType, this.blockCategoryId); } + @Nullable public BlockType getBlockType() { + return this.blockType; + } + /** * Prevents exceptions when loading/saving block categories diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/BooleanFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/BooleanFlag.java index 463e31e8f..aed71fec4 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/BooleanFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/BooleanFlag.java @@ -29,8 +29,8 @@ import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.FlagParseException; import com.plotsquared.core.plot.flag.PlotFlag; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Arrays; import java.util.Collection; import java.util.Locale; diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/DoubleFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/DoubleFlag.java index 1ee9f8ed8..11338ce9f 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/DoubleFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/DoubleFlag.java @@ -28,6 +28,7 @@ package com.plotsquared.core.plot.flag.types; import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.FlagParseException; + import javax.annotation.Nonnull; public abstract class DoubleFlag> extends NumberFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/IntegerFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/IntegerFlag.java index 2968ef52e..393b222c3 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/IntegerFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/IntegerFlag.java @@ -28,6 +28,7 @@ package com.plotsquared.core.plot.flag.types; import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.FlagParseException; + import javax.annotation.Nonnull; public abstract class IntegerFlag> extends NumberFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/ListFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/ListFlag.java index ef6e11cc8..e7bcf716e 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/ListFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/ListFlag.java @@ -29,8 +29,8 @@ import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.util.StringMan; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/LongFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/LongFlag.java index 8d25aa830..b0a155e6d 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/LongFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/LongFlag.java @@ -28,6 +28,7 @@ package com.plotsquared.core.plot.flag.types; import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.FlagParseException; + import javax.annotation.Nonnull; public abstract class LongFlag> extends NumberFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/NonNegativeIntegerFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/NonNegativeIntegerFlag.java index d2ae43232..f057d3e12 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/NonNegativeIntegerFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/NonNegativeIntegerFlag.java @@ -26,6 +26,7 @@ package com.plotsquared.core.plot.flag.types; import com.plotsquared.core.configuration.Caption; + import javax.annotation.Nonnull; public abstract class NonNegativeIntegerFlag> extends IntegerFlag { diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/NumberFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/NumberFlag.java index ea7b491ed..177062291 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/NumberFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/NumberFlag.java @@ -29,6 +29,7 @@ import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.FlagParseException; import com.plotsquared.core.plot.flag.PlotFlag; + import javax.annotation.Nonnull; public abstract class NumberFlag, F extends PlotFlag> diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/types/TimedFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/types/TimedFlag.java index 22d6e859f..054887104 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/types/TimedFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/types/TimedFlag.java @@ -29,6 +29,7 @@ import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.plot.flag.FlagParseException; import com.plotsquared.core.plot.flag.PlotFlag; + import javax.annotation.Nonnull; public abstract class TimedFlag, F>> diff --git a/Core/src/main/java/com/plotsquared/core/plot/schematic/Schematic.java b/Core/src/main/java/com/plotsquared/core/plot/schematic/Schematic.java index 8f08b91cf..e9b3dafbf 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/schematic/Schematic.java +++ b/Core/src/main/java/com/plotsquared/core/plot/schematic/Schematic.java @@ -32,7 +32,6 @@ import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicWriter; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BaseBlock; -import lombok.Getter; import java.io.File; import java.io.FileOutputStream; @@ -41,11 +40,12 @@ import java.util.HashMap; import java.util.Map; public class Schematic { - // Lossy but fast - @Getter private final Clipboard clipboard; - @Getter private Map flags = new HashMap<>(); - public Schematic(Clipboard clip) { + // Lossy but fast + private final Clipboard clipboard; + private Map flags = new HashMap<>(); + + public Schematic(final Clipboard clip) { this.clipboard = clip; } @@ -69,4 +69,12 @@ public class Schematic { schematicWriter.write(clipboard); } } + + public Clipboard getClipboard() { + return this.clipboard; + } + + public Map getFlags() { + return this.flags; + } } diff --git a/Core/src/main/java/com/plotsquared/core/plot/world/DefaultPlotAreaManager.java b/Core/src/main/java/com/plotsquared/core/plot/world/DefaultPlotAreaManager.java index 56b39f252..819e57b2e 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/world/DefaultPlotAreaManager.java +++ b/Core/src/main/java/com/plotsquared/core/plot/world/DefaultPlotAreaManager.java @@ -32,9 +32,9 @@ import com.plotsquared.core.plot.PlotAreaType; import com.plotsquared.core.plot.PlotWorld; import com.plotsquared.core.util.StringMan; import com.sk89q.worldedit.regions.CuboidRegion; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; diff --git a/Core/src/main/java/com/plotsquared/core/plot/world/PlotAreaManager.java b/Core/src/main/java/com/plotsquared/core/plot/world/PlotAreaManager.java index 2529bf1be..14071178f 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/world/PlotAreaManager.java +++ b/Core/src/main/java/com/plotsquared/core/plot/world/PlotAreaManager.java @@ -33,7 +33,6 @@ import com.sk89q.worldedit.regions.CuboidRegion; import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Collections; import java.util.HashSet; import java.util.Set; diff --git a/Core/src/main/java/com/plotsquared/core/plot/world/ScatteredPlotWorld.java b/Core/src/main/java/com/plotsquared/core/plot/world/ScatteredPlotWorld.java index 992f8330b..5f53ce329 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/world/ScatteredPlotWorld.java +++ b/Core/src/main/java/com/plotsquared/core/plot/world/ScatteredPlotWorld.java @@ -32,12 +32,12 @@ import com.plotsquared.core.util.PlotAreaConverter; import com.plotsquared.core.util.RegionUtil; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.khelekore.prtree.MBR; import org.khelekore.prtree.PRTree; import org.khelekore.prtree.SimpleMBR; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; diff --git a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlot.java b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlot.java index f0e2dfbdf..9131d8c93 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlot.java @@ -33,8 +33,8 @@ import com.plotsquared.core.plot.PlotId; import com.plotsquared.core.plot.flag.PlotFlag; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.Collections; import java.util.HashSet; diff --git a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotArea.java b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotArea.java index a7dcd8f22..d8c325b72 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotArea.java +++ b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotArea.java @@ -49,9 +49,9 @@ import com.plotsquared.core.util.EconHandler; import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.task.RunnableVal; import com.plotsquared.core.util.task.TaskManager; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.io.File; import java.io.IOException; import java.nio.file.Files; diff --git a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotAreaManager.java b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotAreaManager.java index fc48f8900..f0b4c250f 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotAreaManager.java +++ b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotAreaManager.java @@ -26,10 +26,10 @@ package com.plotsquared.core.plot.world; import com.google.inject.Singleton; -import com.plotsquared.core.inject.annotations.WorldConfig; import com.plotsquared.core.collection.ArrayUtil; import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.generator.SingleWorldGenerator; +import com.plotsquared.core.inject.annotations.WorldConfig; import com.plotsquared.core.listener.PlotListener; import com.plotsquared.core.location.Location; import com.plotsquared.core.plot.PlotArea; @@ -38,9 +38,9 @@ import com.plotsquared.core.util.EconHandler; import com.plotsquared.core.util.EventDispatcher; import com.plotsquared.core.util.SetupUtils; import com.sk89q.worldedit.regions.CuboidRegion; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import javax.inject.Inject; @Singleton public class SinglePlotAreaManager extends DefaultPlotAreaManager { diff --git a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java index 096f3f6c8..ed4a29f4b 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java +++ b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java @@ -34,8 +34,8 @@ import com.plotsquared.core.plot.PlotManager; import com.plotsquared.core.util.MainUtil; import com.plotsquared.core.util.task.TaskManager; import com.sk89q.worldedit.function.pattern.Pattern; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.util.List; diff --git a/Core/src/main/java/com/plotsquared/core/plot/world/StandardPlotWorld.java b/Core/src/main/java/com/plotsquared/core/plot/world/StandardPlotWorld.java index b0c5290da..131a26fd0 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/world/StandardPlotWorld.java +++ b/Core/src/main/java/com/plotsquared/core/plot/world/StandardPlotWorld.java @@ -29,9 +29,9 @@ import com.plotsquared.core.location.Location; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotWorld; import com.sk89q.worldedit.regions.CuboidRegion; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Collection; import java.util.Collections; diff --git a/Core/src/main/java/com/plotsquared/core/queue/AreaBoundDelegateLocalBlockQueue.java b/Core/src/main/java/com/plotsquared/core/queue/AreaBoundDelegateLocalBlockQueue.java index 75de960f1..7bafdfcfa 100644 --- a/Core/src/main/java/com/plotsquared/core/queue/AreaBoundDelegateLocalBlockQueue.java +++ b/Core/src/main/java/com/plotsquared/core/queue/AreaBoundDelegateLocalBlockQueue.java @@ -30,15 +30,14 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; -import lombok.Getter; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Objects; public class AreaBoundDelegateLocalBlockQueue extends DelegateLocalBlockQueue { - @Getter private final PlotArea area; + private final PlotArea area; public AreaBoundDelegateLocalBlockQueue(@Nonnull final PlotArea area, @Nullable final LocalBlockQueue parent) { @@ -74,4 +73,7 @@ public class AreaBoundDelegateLocalBlockQueue extends DelegateLocalBlockQueue { return false; } + public PlotArea getArea() { + return this.area; + } } diff --git a/Core/src/main/java/com/plotsquared/core/queue/BasicLocalBlockQueue.java b/Core/src/main/java/com/plotsquared/core/queue/BasicLocalBlockQueue.java index e2bdd37e6..aa2d6d386 100644 --- a/Core/src/main/java/com/plotsquared/core/queue/BasicLocalBlockQueue.java +++ b/Core/src/main/java/com/plotsquared/core/queue/BasicLocalBlockQueue.java @@ -34,8 +34,8 @@ import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedDeque; import java.util.concurrent.ExecutionException; diff --git a/Core/src/main/java/com/plotsquared/core/queue/ChunkBlockQueue.java b/Core/src/main/java/com/plotsquared/core/queue/ChunkBlockQueue.java index fcd40d26e..4fb47ed90 100644 --- a/Core/src/main/java/com/plotsquared/core/queue/ChunkBlockQueue.java +++ b/Core/src/main/java/com/plotsquared/core/queue/ChunkBlockQueue.java @@ -31,9 +31,9 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Arrays; public class ChunkBlockQueue extends ScopedLocalBlockQueue { diff --git a/Core/src/main/java/com/plotsquared/core/queue/LocalBlockQueue.java b/Core/src/main/java/com/plotsquared/core/queue/LocalBlockQueue.java index 1f2ccb995..c97013458 100644 --- a/Core/src/main/java/com/plotsquared/core/queue/LocalBlockQueue.java +++ b/Core/src/main/java/com/plotsquared/core/queue/LocalBlockQueue.java @@ -39,15 +39,14 @@ import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; -import lombok.Getter; -import lombok.Setter; + import javax.annotation.Nonnull; import javax.annotation.Nullable; public abstract class LocalBlockQueue { - @Getter @Setter private boolean forceSync = false; - @Getter @Setter @Nullable private Object chunkObject; + private boolean forceSync = false; + @Nullable private Object chunkObject; @Inject private SchematicHandler schematicHandler; @Inject private WorldUtil worldUtil; @@ -174,4 +173,20 @@ public abstract class LocalBlockQueue { } } } + + public boolean isForceSync() { + return this.forceSync; + } + + @Nullable public Object getChunkObject() { + return this.chunkObject; + } + + public void setForceSync(boolean forceSync) { + this.forceSync = forceSync; + } + + public void setChunkObject(@Nullable Object chunkObject) { + this.chunkObject = chunkObject; + } } diff --git a/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java b/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java index 2f1f2ee2b..ec871cdcb 100644 --- a/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java +++ b/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java @@ -37,10 +37,9 @@ import com.plotsquared.core.plot.PlotAreaType; import com.plotsquared.core.plot.PlotId; import com.plotsquared.core.util.SetupUtils; import com.plotsquared.core.util.StringMan; -import lombok.Getter; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -227,7 +226,7 @@ public enum CommonSetupSteps implements SetupStep { } }; - @Getter @Nonnull private final Collection suggestions; + @Nonnull private final Collection suggestions; private final Caption description; /** @@ -268,4 +267,8 @@ public enum CommonSetupSteps implements SetupStep { return i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 48 && i <= 57 || i == 46; }); } + + @Nonnull public Collection getSuggestions() { + return this.suggestions; + } } diff --git a/Core/src/main/java/com/plotsquared/core/setup/PlotAreaBuilder.java b/Core/src/main/java/com/plotsquared/core/setup/PlotAreaBuilder.java index aa7e46290..2f3e2f36a 100644 --- a/Core/src/main/java/com/plotsquared/core/setup/PlotAreaBuilder.java +++ b/Core/src/main/java/com/plotsquared/core/setup/PlotAreaBuilder.java @@ -32,22 +32,19 @@ import com.plotsquared.core.plot.PlotAreaTerrainType; import com.plotsquared.core.plot.PlotAreaType; import com.plotsquared.core.plot.PlotId; import com.plotsquared.core.util.SetupUtils; -import lombok.Getter; -import lombok.Setter; -import lombok.experimental.Accessors; -@Accessors(fluent = true) public class PlotAreaBuilder { - @Getter @Setter private String generatorName; - @Getter @Setter private String plotManager; - @Getter @Setter private PlotAreaType plotAreaType; - @Getter @Setter private PlotAreaTerrainType terrainType; - @Getter @Setter private String worldName; - @Getter @Setter private String areaName; - @Getter private PlotId minimumId; - @Getter private PlotId maximumId; - @Getter @Setter private SettingsNodesWrapper settingsNodesWrapper; - @Getter @Setter private SetupUtils setupManager; + + private String generatorName; + private String plotManager; + private PlotAreaType plotAreaType; + private PlotAreaTerrainType terrainType; + private String worldName; + private String areaName; + private PlotId minimumId; + private PlotId maximumId; + private SettingsNodesWrapper settingsNodesWrapper; + private SetupUtils setupManager; private PlotAreaBuilder() { } @@ -87,4 +84,83 @@ public class PlotAreaBuilder { return this; } + public String generatorName() { + return this.generatorName; + } + + public String plotManager() { + return this.plotManager; + } + + public PlotAreaType plotAreaType() { + return this.plotAreaType; + } + + public PlotAreaTerrainType terrainType() { + return this.terrainType; + } + + public String worldName() { + return this.worldName; + } + + public String areaName() { + return this.areaName; + } + + public PlotId minimumId() { + return this.minimumId; + } + + public PlotId maximumId() { + return this.maximumId; + } + + public SettingsNodesWrapper settingsNodesWrapper() { + return this.settingsNodesWrapper; + } + + public SetupUtils setupManager() { + return this.setupManager; + } + + public PlotAreaBuilder generatorName(String generatorName) { + this.generatorName = generatorName; + return this; + } + + public PlotAreaBuilder plotManager(String plotManager) { + this.plotManager = plotManager; + return this; + } + + public PlotAreaBuilder plotAreaType(PlotAreaType plotAreaType) { + this.plotAreaType = plotAreaType; + return this; + } + + public PlotAreaBuilder terrainType(PlotAreaTerrainType terrainType) { + this.terrainType = terrainType; + return this; + } + + public PlotAreaBuilder worldName(String worldName) { + this.worldName = worldName; + return this; + } + + public PlotAreaBuilder areaName(String areaName) { + this.areaName = areaName; + return this; + } + + public PlotAreaBuilder settingsNodesWrapper(SettingsNodesWrapper settingsNodesWrapper) { + this.settingsNodesWrapper = settingsNodesWrapper; + return this; + } + + public PlotAreaBuilder setupManager(SetupUtils setupManager) { + this.setupManager = setupManager; + return this; + } } diff --git a/Core/src/main/java/com/plotsquared/core/setup/SettingsNodeStep.java b/Core/src/main/java/com/plotsquared/core/setup/SettingsNodeStep.java index f53359f5d..9b1be1f53 100644 --- a/Core/src/main/java/com/plotsquared/core/setup/SettingsNodeStep.java +++ b/Core/src/main/java/com/plotsquared/core/setup/SettingsNodeStep.java @@ -32,10 +32,9 @@ import com.plotsquared.core.configuration.ConfigurationNode; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.util.MainUtil; import com.plotsquared.core.util.TabCompletions; -import lombok.Getter; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Collection; import java.util.Collections; @@ -43,11 +42,13 @@ import java.util.Collections; * A SettingsNodeStep is a step wrapping a {@link ConfigurationNode}. */ public class SettingsNodeStep implements SetupStep { - @Getter private final ConfigurationNode configurationNode; - @Getter private final int id; + + private final ConfigurationNode configurationNode; + private final int id; private final SetupStep next; - public SettingsNodeStep(ConfigurationNode configurationNode, int id, SettingsNodesWrapper wrapper) { + public SettingsNodeStep(final ConfigurationNode configurationNode, final int id, + final SettingsNodesWrapper wrapper) { this.configurationNode = configurationNode; this.id = id; if (wrapper.getSettingsNodes().length > id + 1) { @@ -92,4 +93,12 @@ public class SettingsNodeStep implements SetupStep { } return Collections.emptyList(); } + + public ConfigurationNode getConfigurationNode() { + return this.configurationNode; + } + + public int getId() { + return this.id; + } } diff --git a/Core/src/main/java/com/plotsquared/core/setup/SettingsNodesWrapper.java b/Core/src/main/java/com/plotsquared/core/setup/SettingsNodesWrapper.java index 153ec7d86..cc9a2da63 100644 --- a/Core/src/main/java/com/plotsquared/core/setup/SettingsNodesWrapper.java +++ b/Core/src/main/java/com/plotsquared/core/setup/SettingsNodesWrapper.java @@ -26,16 +26,16 @@ package com.plotsquared.core.setup; import com.plotsquared.core.configuration.ConfigurationNode; -import lombok.Getter; /** * This class wraps an array of {@link ConfigurationNode}s. */ public class SettingsNodesWrapper { - @Getter private final ConfigurationNode[] settingsNodes; - @Getter private final SetupStep afterwards; - public SettingsNodesWrapper(ConfigurationNode[] settingsNodes, SetupStep afterwards) { + private final ConfigurationNode[] settingsNodes; + private final SetupStep afterwards; + + public SettingsNodesWrapper(final ConfigurationNode[] settingsNodes, final SetupStep afterwards) { this.settingsNodes = settingsNodes; this.afterwards = afterwards; } @@ -49,4 +49,12 @@ public class SettingsNodesWrapper { public SetupStep getFirstStep() { return this.settingsNodes.length == 0 ? this.afterwards : new SettingsNodeStep(this.settingsNodes[0], 0, this); } + + public ConfigurationNode[] getSettingsNodes() { + return this.settingsNodes; + } + + public SetupStep getAfterwards() { + return this.afterwards; + } } diff --git a/Core/src/main/java/com/plotsquared/core/setup/SetupStep.java b/Core/src/main/java/com/plotsquared/core/setup/SetupStep.java index 308757c0d..df1abbb1d 100644 --- a/Core/src/main/java/com/plotsquared/core/setup/SetupStep.java +++ b/Core/src/main/java/com/plotsquared/core/setup/SetupStep.java @@ -28,9 +28,9 @@ package com.plotsquared.core.setup; import com.plotsquared.core.command.Command; import com.plotsquared.core.command.RequiredType; import com.plotsquared.core.player.PlotPlayer; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/Core/src/main/java/com/plotsquared/core/util/BlockUtil.java b/Core/src/main/java/com/plotsquared/core/util/BlockUtil.java index a0f4e4f50..a9f1e89db 100644 --- a/Core/src/main/java/com/plotsquared/core/util/BlockUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/BlockUtil.java @@ -35,8 +35,8 @@ import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.FuzzyBlockState; import com.sk89q.worldedit.world.registry.LegacyMapper; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Map; public final class BlockUtil { diff --git a/Core/src/main/java/com/plotsquared/core/util/EntityUtil.java b/Core/src/main/java/com/plotsquared/core/util/EntityUtil.java index 098604597..5429941c9 100644 --- a/Core/src/main/java/com/plotsquared/core/util/EntityUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/EntityUtil.java @@ -29,7 +29,7 @@ import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.plot.flag.implementations.DoneFlag; -import lombok.experimental.UtilityClass; + import javax.annotation.Nonnull; import static com.plotsquared.core.util.entity.EntityCategories.CAP_ANIMAL; @@ -42,9 +42,13 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE; /** * Entity related general utility methods */ -@UtilityClass public final class EntityUtil { + private EntityUtil() { + throw new UnsupportedOperationException( + "This is a utility class and cannot be instantiated"); + } + private static int capNumeral(@Nonnull final String flagName) { int i; switch (flagName) { diff --git a/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java b/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java index 2dc715a09..3b3537181 100644 --- a/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java +++ b/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java @@ -72,9 +72,9 @@ import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.List; import java.util.UUID; diff --git a/Core/src/main/java/com/plotsquared/core/util/MainUtil.java b/Core/src/main/java/com/plotsquared/core/util/MainUtil.java index 8cde56e52..9e01eeaa9 100644 --- a/Core/src/main/java/com/plotsquared/core/util/MainUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/MainUtil.java @@ -55,11 +55,11 @@ import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.biome.BiomeType; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.io.OutputStream; diff --git a/Core/src/main/java/com/plotsquared/core/util/OperationUtil.java b/Core/src/main/java/com/plotsquared/core/util/OperationUtil.java index d4eda5ff4..fb5e30f01 100644 --- a/Core/src/main/java/com/plotsquared/core/util/OperationUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/OperationUtil.java @@ -37,9 +37,9 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.world.World; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.List; import java.util.concurrent.Future; import java.util.function.Consumer; diff --git a/Core/src/main/java/com/plotsquared/core/util/PatternUtil.java b/Core/src/main/java/com/plotsquared/core/util/PatternUtil.java index 5f2487dbc..b25a9465b 100644 --- a/Core/src/main/java/com/plotsquared/core/util/PatternUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/PatternUtil.java @@ -41,8 +41,8 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; diff --git a/Core/src/main/java/com/plotsquared/core/util/PlatformWorldManager.java b/Core/src/main/java/com/plotsquared/core/util/PlatformWorldManager.java index 68a2be439..b8be66f21 100644 --- a/Core/src/main/java/com/plotsquared/core/util/PlatformWorldManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/PlatformWorldManager.java @@ -27,7 +27,6 @@ package com.plotsquared.core.util; import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Collection; /** diff --git a/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java b/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java index 4cba66d9a..c70358d87 100644 --- a/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java @@ -27,9 +27,9 @@ package com.plotsquared.core.util; import com.plotsquared.core.player.OfflinePlotPlayer; import com.plotsquared.core.player.PlotPlayer; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; diff --git a/Core/src/main/java/com/plotsquared/core/util/RegionManager.java b/Core/src/main/java/com/plotsquared/core/util/RegionManager.java index 743395523..9c02c7f57 100644 --- a/Core/src/main/java/com/plotsquared/core/util/RegionManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/RegionManager.java @@ -39,8 +39,8 @@ import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.biome.BiomeType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.File; import java.util.Collection; import java.util.HashSet; diff --git a/Core/src/main/java/com/plotsquared/core/util/RegionUtil.java b/Core/src/main/java/com/plotsquared/core/util/RegionUtil.java index ffce29963..aca51a577 100644 --- a/Core/src/main/java/com/plotsquared/core/util/RegionUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/RegionUtil.java @@ -29,8 +29,8 @@ import com.plotsquared.core.plot.Plot; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.awt.geom.Rectangle2D; public class RegionUtil { diff --git a/Core/src/main/java/com/plotsquared/core/util/RuntimeExceptionRunnableVal.java b/Core/src/main/java/com/plotsquared/core/util/RuntimeExceptionRunnableVal.java index f66b384ed..192ef6c7f 100644 --- a/Core/src/main/java/com/plotsquared/core/util/RuntimeExceptionRunnableVal.java +++ b/Core/src/main/java/com/plotsquared/core/util/RuntimeExceptionRunnableVal.java @@ -26,16 +26,19 @@ package com.plotsquared.core.util; import com.plotsquared.core.util.task.RunnableVal; -import lombok.RequiredArgsConstructor; import java.util.concurrent.atomic.AtomicBoolean; -@RequiredArgsConstructor public class RuntimeExceptionRunnableVal extends RunnableVal { private final RunnableVal function; private final AtomicBoolean running; + public RuntimeExceptionRunnableVal(final RunnableVal function, final AtomicBoolean running) { + this.function = function; + this.running = running; + } + @Override public void run(RuntimeException value) { try { function.run(); diff --git a/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java b/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java index 7f933df24..c4740ec55 100644 --- a/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java +++ b/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java @@ -58,12 +58,12 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; -import javax.annotation.Nonnull; import org.json.JSONArray; import org.json.JSONException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; diff --git a/Core/src/main/java/com/plotsquared/core/util/StringMan.java b/Core/src/main/java/com/plotsquared/core/util/StringMan.java index 791a27783..a6e6fcbfc 100644 --- a/Core/src/main/java/com/plotsquared/core/util/StringMan.java +++ b/Core/src/main/java/com/plotsquared/core/util/StringMan.java @@ -26,8 +26,8 @@ package com.plotsquared.core.util; import com.plotsquared.core.configuration.Caption; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.lang.reflect.Array; import java.util.Arrays; import java.util.Collection; diff --git a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java index 158818719..2ee4a7703 100644 --- a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java +++ b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java @@ -36,9 +36,8 @@ import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.uuid.UUIDMapping; -import lombok.experimental.UtilityClass; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -53,19 +52,23 @@ import java.util.stream.Collectors; /** * Tab completion utilities */ -@UtilityClass -public class TabCompletions { +public final class TabCompletions { - private final Cache> cachedCompletionValues = + private static final Cache> cachedCompletionValues = CacheBuilder.newBuilder() .expireAfterWrite(Settings.Tab_Completions.CACHE_EXPIRATION, TimeUnit.SECONDS) .build(); - private final Command booleanTrueCompletion = new Command(null, false, "true", "", + private static final Command booleanTrueCompletion = new Command(null, false, "true", "", RequiredType.NONE, null) {}; - private final Command booleanFalseCompletion = new Command(null, false, "false", "", + private static final Command booleanFalseCompletion = new Command(null, false, "false", "", RequiredType.NONE, null) {}; + private TabCompletions() { + throw new UnsupportedOperationException( + "This is a utility class and cannot be instantiated"); + } + /** * Get a list of tab completions corresponding to player names. This uses the UUID pipeline * cache, so it will complete will all names known to PlotSquared @@ -74,7 +77,7 @@ public class TabCompletions { * @param existing Players that should not be included in completions * @return List of completions */ - @Nonnull public List completePlayers(@Nonnull final String input, + @Nonnull public static List completePlayers(@Nonnull final String input, @Nonnull final List existing) { return completePlayers("players", input, existing, uuid -> true); } @@ -87,16 +90,16 @@ public class TabCompletions { * @param existing Players that should not be included in completions * @return List of completions */ - @Nonnull public List completeAddedPlayers(@Nonnull final Plot plot, @Nonnull final String input, - @Nonnull final List existing) { + @Nonnull public static List completeAddedPlayers(@Nonnull final Plot plot, + @Nonnull final String input, @Nonnull final List existing) { return completePlayers("added" + plot, input, existing, uuid -> plot.getMembers().contains(uuid) || plot.getTrusted().contains(uuid) || plot.getDenied().contains(uuid)); } - @Nonnull public List completePlayersInPlot(@Nonnull final Plot plot, @Nonnull final String input, - @Nonnull final List existing) { + @Nonnull public static List completePlayersInPlot(@Nonnull final Plot plot, + @Nonnull final String input, @Nonnull final List existing) { List players = cachedCompletionValues.getIfPresent("inPlot" + plot); if (players == null) { final List> inPlot = plot.getPlayersInPlot(); @@ -116,7 +119,7 @@ public class TabCompletions { * @param input Command input * @return List of completions */ - @Nonnull public List completePatterns(@Nonnull final String input) { + @Nonnull public static List completePatterns(@Nonnull final String input) { return PatternUtil.getSuggestions(input.trim()).stream() .map(value -> value.toLowerCase(Locale.ENGLISH).replace("minecraft:", "")) .filter(value -> value.startsWith(input.toLowerCase(Locale.ENGLISH))) @@ -124,7 +127,7 @@ public class TabCompletions { }).collect(Collectors.toList()); } - @Nonnull public List completeBoolean(@Nonnull final String input) { + @Nonnull public static List completeBoolean(@Nonnull final String input) { if (input.isEmpty()) { return Arrays.asList(booleanTrueCompletion, booleanFalseCompletion); } @@ -146,8 +149,8 @@ public class TabCompletions { * @param highestLimit Highest number to include * @return Unmodifiable list of number completions */ - @Nonnull public List completeNumbers(@Nonnull final String input, - final int amountLimit, final int highestLimit) { + @Nonnull public static List completeNumbers(@Nonnull final String input, + final int amountLimit, final int highestLimit) { if (input.isEmpty() || input.length() > highestLimit || !MathMan.isInteger(input)) { return Collections.emptyList(); } @@ -171,7 +174,7 @@ public class TabCompletions { * @param input Input to filter with * @return Unmodifiable list of area completions */ - @Nonnull public List completeAreas(@Nonnull final String input) { + @Nonnull public static List completeAreas(@Nonnull final String input) { final List completions = new ArrayList<>(); for (final PlotArea area : PlotSquared.get().getPlotAreaManager().getAllPlotAreas()) { String areaName = area.getWorldName(); @@ -187,7 +190,7 @@ public class TabCompletions { return Collections.unmodifiableList(completions); } - @Nonnull public List asCompletions(String... toFilter) { + @Nonnull public static List asCompletions(String... toFilter) { final List completions = new ArrayList<>(); for (String completion : toFilter) { completions.add(new Command(null, false, completion, "", @@ -203,9 +206,9 @@ public class TabCompletions { * @param uuidFilter Filter applied before caching values * @return List of completions */ - private List completePlayers(@Nonnull final String cacheIdentifier, @Nonnull final String input, - @Nonnull final List existing, - @Nonnull final Predicate uuidFilter) { + private static List completePlayers(@Nonnull final String cacheIdentifier, + @Nonnull final String input, @Nonnull final List existing, + @Nonnull final Predicate uuidFilter) { List players; if (Settings.Enabled_Components.EXTENDED_USERNAME_COMPLETION) { players = cachedCompletionValues.getIfPresent(cacheIdentifier); @@ -232,7 +235,8 @@ public class TabCompletions { return filterCached(players, input, existing); } - private List filterCached(Collection playerNames, String input, List existing) { + private static List filterCached(Collection playerNames, String input, + List existing) { final String processedInput = input.toLowerCase(Locale.ENGLISH); return playerNames.stream().filter(player -> player.toLowerCase(Locale.ENGLISH).startsWith(processedInput)) .filter(player -> !existing.contains(player)).map( diff --git a/Core/src/main/java/com/plotsquared/core/util/ThreadUtils.java b/Core/src/main/java/com/plotsquared/core/util/ThreadUtils.java index c7c011e3d..34deae5fb 100644 --- a/Core/src/main/java/com/plotsquared/core/util/ThreadUtils.java +++ b/Core/src/main/java/com/plotsquared/core/util/ThreadUtils.java @@ -26,9 +26,13 @@ package com.plotsquared.core.util; import com.plotsquared.core.PlotSquared; -import lombok.experimental.UtilityClass; -@UtilityClass public class ThreadUtils { +public final class ThreadUtils { + + private ThreadUtils() { + throw new UnsupportedOperationException( + "This is a utility class and cannot be instantiated"); + } /** * Throws {@link IllegalStateException} if the method @@ -36,7 +40,7 @@ import lombok.experimental.UtilityClass; * * @param message Message describing the issue */ - public void catchSync(final String message) { + public static void catchSync(final String message) { if (PlotSquared.get().isMainThread(Thread.currentThread())) { throw new IllegalStateException(message); } @@ -48,7 +52,7 @@ import lombok.experimental.UtilityClass; * * @param message Message describing the issue */ - public void catchAsync(final String message) { + public static void catchAsync(final String message) { if (!PlotSquared.get().isMainThread(Thread.currentThread())) { throw new IllegalStateException(message); } diff --git a/Core/src/main/java/com/plotsquared/core/util/WorldUtil.java b/Core/src/main/java/com/plotsquared/core/util/WorldUtil.java index 63c501faf..be4f0a26e 100644 --- a/Core/src/main/java/com/plotsquared/core/util/WorldUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/WorldUtil.java @@ -43,8 +43,8 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.entity.EntityType; import net.kyori.adventure.text.minimessage.Template; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; diff --git a/Core/src/main/java/com/plotsquared/core/util/query/AliasFilter.java b/Core/src/main/java/com/plotsquared/core/util/query/AliasFilter.java index a4e40867c..c2b456c6b 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/AliasFilter.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/AliasFilter.java @@ -26,6 +26,7 @@ package com.plotsquared.core.util.query; import com.plotsquared.core.plot.Plot; + import javax.annotation.Nonnull; class AliasFilter implements PlotFilter { diff --git a/Core/src/main/java/com/plotsquared/core/util/query/FixedPlotProvider.java b/Core/src/main/java/com/plotsquared/core/util/query/FixedPlotProvider.java index a7b2f587a..9b8a40291 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/FixedPlotProvider.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/FixedPlotProvider.java @@ -26,8 +26,8 @@ package com.plotsquared.core.util.query; import com.plotsquared.core.plot.Plot; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.Collections; diff --git a/Core/src/main/java/com/plotsquared/core/util/query/GlobalPlotProvider.java b/Core/src/main/java/com/plotsquared/core/util/query/GlobalPlotProvider.java index 865ae323c..e3a18a9d1 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/GlobalPlotProvider.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/GlobalPlotProvider.java @@ -28,8 +28,8 @@ package com.plotsquared.core.util.query; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.world.PlotAreaManager; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collection; import java.util.HashSet; import java.util.Set; diff --git a/Core/src/main/java/com/plotsquared/core/util/query/MemberFilter.java b/Core/src/main/java/com/plotsquared/core/util/query/MemberFilter.java index fa050ed0c..55ee25adc 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/MemberFilter.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/MemberFilter.java @@ -26,8 +26,8 @@ package com.plotsquared.core.util.query; import com.plotsquared.core.plot.Plot; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.UUID; class MemberFilter implements PlotFilter { diff --git a/Core/src/main/java/com/plotsquared/core/util/query/OwnerFilter.java b/Core/src/main/java/com/plotsquared/core/util/query/OwnerFilter.java index 3d59a70c8..5eb679195 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/OwnerFilter.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/OwnerFilter.java @@ -26,8 +26,8 @@ package com.plotsquared.core.util.query; import com.plotsquared.core.plot.Plot; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Objects; import java.util.UUID; diff --git a/Core/src/main/java/com/plotsquared/core/util/query/PaginatedPlotResult.java b/Core/src/main/java/com/plotsquared/core/util/query/PaginatedPlotResult.java index bb6531e49..bd99d0802 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/PaginatedPlotResult.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/PaginatedPlotResult.java @@ -27,8 +27,8 @@ package com.plotsquared.core.util.query; import com.google.common.base.Preconditions; import com.plotsquared.core.plot.Plot; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collections; import java.util.List; diff --git a/Core/src/main/java/com/plotsquared/core/util/query/PlotFilter.java b/Core/src/main/java/com/plotsquared/core/util/query/PlotFilter.java index 4e93ff5e4..94a728604 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/PlotFilter.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/PlotFilter.java @@ -26,8 +26,8 @@ package com.plotsquared.core.util.query; import com.plotsquared.core.plot.Plot; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.function.Predicate; @FunctionalInterface interface PlotFilter extends Predicate { diff --git a/Core/src/main/java/com/plotsquared/core/util/query/PlotQuery.java b/Core/src/main/java/com/plotsquared/core/util/query/PlotQuery.java index 03c41dd8e..58990c101 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/PlotQuery.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/PlotQuery.java @@ -34,8 +34,8 @@ import com.plotsquared.core.plot.Rating; import com.plotsquared.core.plot.flag.implementations.DoneFlag; import com.plotsquared.core.plot.world.PlotAreaManager; import com.plotsquared.core.util.MathMan; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; diff --git a/Core/src/main/java/com/plotsquared/core/util/query/PredicateFilter.java b/Core/src/main/java/com/plotsquared/core/util/query/PredicateFilter.java index fa07afe80..2d2867e08 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/PredicateFilter.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/PredicateFilter.java @@ -26,8 +26,8 @@ package com.plotsquared.core.util.query; import com.plotsquared.core.plot.Plot; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.function.Predicate; class PredicateFilter implements PlotFilter { diff --git a/Core/src/main/java/com/plotsquared/core/util/query/SearchPlotProvider.java b/Core/src/main/java/com/plotsquared/core/util/query/SearchPlotProvider.java index f838dc807..b2d47b405 100644 --- a/Core/src/main/java/com/plotsquared/core/util/query/SearchPlotProvider.java +++ b/Core/src/main/java/com/plotsquared/core/util/query/SearchPlotProvider.java @@ -27,8 +27,8 @@ package com.plotsquared.core.util.query; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.util.MainUtil; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.Collection; class SearchPlotProvider implements PlotProvider { diff --git a/Core/src/main/java/com/plotsquared/core/util/task/AutoClaimFinishTask.java b/Core/src/main/java/com/plotsquared/core/util/task/AutoClaimFinishTask.java index 543cd978e..c0d2c4b44 100644 --- a/Core/src/main/java/com/plotsquared/core/util/task/AutoClaimFinishTask.java +++ b/Core/src/main/java/com/plotsquared/core/util/task/AutoClaimFinishTask.java @@ -35,9 +35,7 @@ import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.util.EventDispatcher; -import lombok.RequiredArgsConstructor; -@RequiredArgsConstructor public final class AutoClaimFinishTask extends RunnableVal { private final PlotPlayer player; @@ -46,6 +44,15 @@ public final class AutoClaimFinishTask extends RunnableVal { private final String schematic; private final EventDispatcher eventDispatcher; + public AutoClaimFinishTask(final PlotPlayer player, final Plot plot, final PlotArea area, + final String schematic, final EventDispatcher eventDispatcher) { + this.player = player; + this.plot = plot; + this.area = area; + this.schematic = schematic; + this.eventDispatcher = eventDispatcher; + } + @Override public void run(Object value) { player.deleteMeta(Auto.class.getName()); if (plot == null) { diff --git a/Core/src/main/java/com/plotsquared/core/util/task/ObjectTaskRunnable.java b/Core/src/main/java/com/plotsquared/core/util/task/ObjectTaskRunnable.java index 63c0ebc8c..c56a0b820 100644 --- a/Core/src/main/java/com/plotsquared/core/util/task/ObjectTaskRunnable.java +++ b/Core/src/main/java/com/plotsquared/core/util/task/ObjectTaskRunnable.java @@ -25,17 +25,21 @@ */ package com.plotsquared.core.util.task; -import lombok.RequiredArgsConstructor; - import java.util.Iterator; -@RequiredArgsConstructor public class ObjectTaskRunnable implements Runnable { private final Iterator iterator; private final RunnableVal task; private final Runnable whenDone; + public ObjectTaskRunnable(final Iterator iterator, + final RunnableVal task, final Runnable whenDone) { + this.iterator = iterator; + this.task = task; + this.whenDone = whenDone; + } + @Override public void run() { long start = System.currentTimeMillis(); boolean hasNext; diff --git a/Core/src/main/java/com/plotsquared/core/util/task/TaskManager.java b/Core/src/main/java/com/plotsquared/core/util/task/TaskManager.java index 0e2a923e2..c140a7e84 100644 --- a/Core/src/main/java/com/plotsquared/core/util/task/TaskManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/task/TaskManager.java @@ -27,8 +27,6 @@ package com.plotsquared.core.util.task; import com.plotsquared.core.PlotSquared; import com.plotsquared.core.util.RuntimeExceptionRunnableVal; -import lombok.Getter; -import lombok.Setter; import java.util.Collection; import java.util.HashMap; @@ -43,7 +41,7 @@ public abstract class TaskManager { public static final HashMap tasks = new HashMap<>(); public static AtomicInteger index = new AtomicInteger(0); - @Getter @Setter private static TaskManager implementation; + private static TaskManager implementation; public static int runTaskRepeat(Runnable runnable, int interval) { if (runnable != null) { @@ -124,6 +122,14 @@ public abstract class TaskManager { TaskManager.runTask(new ObjectTaskRunnable<>(iterator, task, whenDone)); } + public static TaskManager getImplementation() { + return TaskManager.implementation; + } + + public static void setImplementation(TaskManager implementation) { + TaskManager.implementation = implementation; + } + public T sync(final RunnableVal function) { return sync(function, Integer.MAX_VALUE); } diff --git a/Core/src/main/java/com/plotsquared/core/uuid/CacheUUIDService.java b/Core/src/main/java/com/plotsquared/core/uuid/CacheUUIDService.java index d7aea4a92..5051822aa 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/CacheUUIDService.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/CacheUUIDService.java @@ -27,9 +27,9 @@ package com.plotsquared.core.uuid; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; + import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; diff --git a/Core/src/main/java/com/plotsquared/core/uuid/UUIDMapping.java b/Core/src/main/java/com/plotsquared/core/uuid/UUIDMapping.java index bee1f2d4c..0871dd6c0 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/UUIDMapping.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/UUIDMapping.java @@ -25,15 +25,14 @@ */ package com.plotsquared.core.uuid; -import lombok.EqualsAndHashCode; import javax.annotation.Nonnull; - +import java.util.Objects; import java.util.UUID; /** * A pair consisting of a UUID and a username */ -@EqualsAndHashCode public class UUIDMapping { +public class UUIDMapping { private final UUID uuid; private final String username; @@ -51,4 +50,38 @@ import java.util.UUID; return this.uuid; } + public boolean equals(final Object o) { + if (o == this) { + return true; + } + if (!(o instanceof UUIDMapping)) { + return false; + } + final UUIDMapping other = (UUIDMapping) o; + if (!other.canEqual(this)) { + return false; + } + final Object this$uuid = this.getUuid(); + final Object other$uuid = other.getUuid(); + if (!Objects.equals(this$uuid, other$uuid)) { + return false; + } + final Object this$username = this.getUsername(); + final Object other$username = other.getUsername(); + return Objects.equals(this$username, other$username); + } + + protected boolean canEqual(final Object other) { + return other instanceof UUIDMapping; + } + + public int hashCode() { + final int PRIME = 59; + int result = 1; + final Object $uuid = this.getUuid(); + result = result * PRIME + $uuid.hashCode(); + final Object $username = this.getUsername(); + result = result * PRIME + $username.hashCode(); + return result; + } } diff --git a/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java b/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java index 5e92691b1..0e5c94be1 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java @@ -31,11 +31,11 @@ import com.plotsquared.core.configuration.Captions; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.util.ThreadUtils; import com.plotsquared.core.util.task.TaskManager; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; diff --git a/Core/src/main/java/com/plotsquared/core/uuid/UUIDService.java b/Core/src/main/java/com/plotsquared/core/uuid/UUIDService.java index fd766d2da..d2f69bd4c 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/UUIDService.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/UUIDService.java @@ -27,7 +27,6 @@ package com.plotsquared.core.uuid; import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.Collection; import java.util.Collections; import java.util.List; diff --git a/Core/src/main/java/com/plotsquared/core/uuid/offline/OfflineModeUUIDService.java b/Core/src/main/java/com/plotsquared/core/uuid/offline/OfflineModeUUIDService.java index 15ffc98aa..1a12ff044 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/offline/OfflineModeUUIDService.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/offline/OfflineModeUUIDService.java @@ -29,8 +29,8 @@ import com.google.common.base.Charsets; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDService; -import javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/Core/src/test/java/com/plotsquared/core/database/AbstractDBTest.java b/Core/src/test/java/com/plotsquared/core/database/AbstractDBTest.java index 0f268d3e4..c001b9583 100644 --- a/Core/src/test/java/com/plotsquared/core/database/AbstractDBTest.java +++ b/Core/src/test/java/com/plotsquared/core/database/AbstractDBTest.java @@ -32,8 +32,8 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nonnull; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/Core/src/test/java/com/plotsquared/core/plot/FlagTest.java b/Core/src/test/java/com/plotsquared/core/plot/FlagTest.java index 5f8d2859f..8a9348144 100644 --- a/Core/src/test/java/com/plotsquared/core/plot/FlagTest.java +++ b/Core/src/test/java/com/plotsquared/core/plot/FlagTest.java @@ -30,8 +30,6 @@ import com.plotsquared.core.database.DBFunc; import com.sk89q.worldedit.world.item.ItemType; import org.junit.Before; -import static org.junit.Assert.assertEquals; - public class FlagTest { private ItemType testBlock; diff --git a/build.gradle b/build.gradle index 1cf27d25c..32f1b0b5e 100644 --- a/build.gradle +++ b/build.gradle @@ -79,26 +79,15 @@ subprojects { subproject -> dependencies { compile group: 'org.json', name: 'json', version: '20200518' - implementation("com.sk89q.worldedit:worldedit-core:7.0.0") { exclude(module: "bukkit-classloader-check") exclude(module: "mockito-core") exclude(module: "dummypermscompat") } - - implementation("net.kyori:text-api:3.0.2") - implementation("net.kyori:text-serializer-gson:3.0.2") - implementation("net.kyori:text-serializer-legacy:3.0.2") - implementation("net.kyori:text-serializer-plain:3.0.2") implementation("com.google.guava:guava:21.0") { because("Minecraft uses Guava 21 as of 1.13") } - compileClasspath("org.projectlombok:lombok:1.18.12") - testCompileOnly("org.projectlombok:lombok:1.18.12") - annotationProcessor("org.projectlombok:lombok:1.18.8") - testAnnotationProcessor("org.projectlombok:lombok:1.18.8") testImplementation("junit:junit:4.13") - compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2' }