From 8292ed9e31f010162d3eb4d80ee1b0da7c2e303a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sun, 10 Jan 2021 00:01:48 +0100 Subject: [PATCH] More annotation work --- .../plotsquared/bukkit/BukkitPlatform.java | 14 +++++--- .../plotsquared/bukkit/util/BukkitUtil.java | 8 ++--- .../plotsquared/bukkit/util/BukkitWorld.java | 4 +-- .../java/com/plotsquared/core/PlotAPI.java | 2 -- .../com/plotsquared/core/PlotPlatform.java | 11 +++++-- .../com/plotsquared/core/PlotSquared.java | 15 +++++++++ .../plotsquared/core/command/CmdConfirm.java | 2 +- .../configuration/caption/StaticCaption.java | 2 +- .../core/configuration/caption/Templates.java | 10 +++--- .../caption/TranslatableCaption.java | 4 +-- .../generator/IndependentPlotGenerator.java | 3 +- .../plotsquared/core/location/Location.java | 16 +++++----- .../plotsquared/core/location/PlotLoc.java | 2 +- .../plotsquared/core/player/MetaDataKey.java | 2 +- .../java/com/plotsquared/core/plot/Plot.java | 6 ++-- .../com/plotsquared/core/plot/PlotId.java | 8 ++--- .../implementations/DenyTeleportFlag.java | 2 +- .../plot/flag/implementations/TitlesFlag.java | 2 +- .../core/plot/world/PlotAreaManager.java | 9 ++---- .../core/setup/CommonSetupSteps.java | 2 +- .../core/synchronization/LockKey.java | 2 +- .../com/plotsquared/core/util/BlockUtil.java | 23 ++++++------- .../com/plotsquared/core/util/FileUtils.java | 2 +- .../plotsquared/core/util/PlayerManager.java | 6 ++-- .../com/plotsquared/core/util/RegionUtil.java | 8 ++--- .../plotsquared/core/util/TabCompletions.java | 16 +++++----- .../com/plotsquared/core/util/TimeUtil.java | 2 +- .../core/util/task/TaskManager.java | 6 ++-- .../plotsquared/core/util/task/TaskTime.java | 6 ++-- .../core/uuid/CacheUUIDService.java | 8 ++--- .../plotsquared/core/uuid/ServiceError.java | 5 ++- .../plotsquared/core/uuid/UUIDMapping.java | 2 +- .../plotsquared/core/uuid/UUIDPipeline.java | 32 ++++++++++++------- .../plotsquared/core/uuid/UUIDService.java | 6 ++-- .../uuid/offline/OfflineModeUUIDService.java | 4 +-- 35 files changed, 144 insertions(+), 108 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java index 075260bcb..38f731827 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java @@ -981,7 +981,10 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl } @Override - public @Nullable final ChunkGenerator getDefaultWorldGenerator(final @NonNull String worldName, final String id) { + public @Nullable final ChunkGenerator getDefaultWorldGenerator( + final @NonNull String worldName, + final @Nullable String id) + { final IndependentPlotGenerator result; if (id != null && id.equalsIgnoreCase("single")) { result = injector().getInstance(SingleWorldGenerator.class); @@ -995,7 +998,10 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl } @Override - public @Nullable GeneratorWrapper getGenerator(final @NonNull String world, final @Nullable String name) { + public @Nullable GeneratorWrapper getGenerator( + final @NonNull String world, + final @Nullable String name + ) { if (name == null) { return null; } @@ -1108,7 +1114,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl @Override public @NonNull GeneratorWrapper wrapPlotGenerator( - final @Nullable String world, + final @NonNull String world, final @NonNull IndependentPlotGenerator generator ) { return new BukkitPlotGenerator(world, generator, this.plotAreaManager); @@ -1194,7 +1200,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl @NonNull @Override - public String toLegacyPlatformString(Component component) { + public String toLegacyPlatformString(final @NonNull Component component) { return LegacyComponentSerializer.legacyAmpersand().serialize(component); } 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 dd8f752d6..e72046fa5 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java @@ -125,7 +125,7 @@ public class BukkitUtil extends WorldUtil { * @param player Bukkit player * @return PlotSquared player */ - public @NonNull static BukkitPlayer adapt(final @NonNull Player player) { + public static @NonNull BukkitPlayer adapt(final @NonNull Player player) { final PlayerManager playerManager = PlotSquared.platform().playerManager(); return ((BukkitPlayerManager) playerManager).getPlayer(player); } @@ -137,7 +137,7 @@ public class BukkitUtil extends WorldUtil { * @param location Bukkit location * @return PlotSquared location */ - public @NonNull static Location adapt(final org.bukkit.@NonNull Location location) { + public static @NonNull Location adapt(final org.bukkit.@NonNull Location location) { return Location .at(com.plotsquared.bukkit.util.BukkitWorld.of(location.getWorld()), MathMan.roundInt(location.getX()), @@ -153,7 +153,7 @@ public class BukkitUtil extends WorldUtil { * @param location Bukkit location * @return PlotSquared location */ - public @NonNull static Location adaptComplete(final org.bukkit.@NonNull Location location) { + public static @NonNull Location adaptComplete(final org.bukkit.@NonNull Location location) { return Location .at(com.plotsquared.bukkit.util.BukkitWorld.of(location.getWorld()), MathMan.roundInt(location.getX()), @@ -186,7 +186,7 @@ public class BukkitUtil extends WorldUtil { * @param string World name * @return World if it exists, or {@code null} */ - public @Nullable static World getWorld(final @NonNull String string) { + public static @Nullable World getWorld(final @NonNull String string) { return Bukkit.getWorld(string); } 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 009ae9db2..8a2e9edcb 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java @@ -49,7 +49,7 @@ public class BukkitWorld implements World { * @param worldName World name * @return World instance */ - public @NonNull static BukkitWorld of(final @NonNull String worldName) { + public static @NonNull BukkitWorld of(final @NonNull String worldName) { final org.bukkit.World bukkitWorld = Bukkit.getWorld(worldName); if (bukkitWorld == null) { throw new IllegalArgumentException(String.format("There is no world with the name '%s'", worldName)); @@ -63,7 +63,7 @@ public class BukkitWorld implements World { * @param world Bukkit world * @return World instance */ - public @NonNull static BukkitWorld of(final org.bukkit.World world) { + public static @NonNull BukkitWorld of(final org.bukkit.World world) { BukkitWorld bukkitWorld = worldMap.get(world.getName()); if (bukkitWorld != null && bukkitWorld.getPlatformWorld().equals(world)) { return bukkitWorld; diff --git a/Core/src/main/java/com/plotsquared/core/PlotAPI.java b/Core/src/main/java/com/plotsquared/core/PlotAPI.java index 32fb84f6c..ae4c63250 100644 --- a/Core/src/main/java/com/plotsquared/core/PlotAPI.java +++ b/Core/src/main/java/com/plotsquared/core/PlotAPI.java @@ -154,8 +154,6 @@ public class PlotAPI { final @NonNull String message, final @NonNull Template @NonNull... replacements) { ConsolePlayer.getConsole().sendMessage(StaticCaption.of(message), replacements); - // TODO: Re-implement - // PlotSquared.log(message); } /** diff --git a/Core/src/main/java/com/plotsquared/core/PlotPlatform.java b/Core/src/main/java/com/plotsquared/core/PlotPlatform.java index 77f4f148c..7a61f8c89 100644 --- a/Core/src/main/java/com/plotsquared/core/PlotPlatform.java +++ b/Core/src/main/java/com/plotsquared/core/PlotPlatform.java @@ -85,8 +85,7 @@ public interface PlotPlatform

extends LocaleHolder { * * @return Plugin name */ - @NonNull - default String pluginName() { + default @NonNull String pluginName() { return "PlotSquared"; } @@ -316,6 +315,12 @@ public interface PlotPlatform

extends LocaleHolder { return injector().getInstance(PlaceholderRegistry.class); } - @NonNull String toLegacyPlatformString(Component component); + /** + * Convert a component to a legacy string + * + * @param component Component to convert + * @return Converted string + */ + @NonNull String toLegacyPlatformString(@NonNull Component component); } diff --git a/Core/src/main/java/com/plotsquared/core/PlotSquared.java b/Core/src/main/java/com/plotsquared/core/PlotSquared.java index 7991ad703..dba4e0c07 100644 --- a/Core/src/main/java/com/plotsquared/core/PlotSquared.java +++ b/Core/src/main/java/com/plotsquared/core/PlotSquared.java @@ -1583,10 +1583,25 @@ public class PlotSquared { return this.plotListener; } + /** + * Different ways of sorting {@link Plot plots} + */ public enum SortType { + /** + * Sort plots by their creation, using their index in the database + */ CREATION_DATE, + /** + * Sort plots by their creation timestamp + */ CREATION_DATE_TIMESTAMP, + /** + * Sort plots by when they were last modified + */ LAST_MODIFIED, + /** + * Sort plots based on their distance from the origin of the world + */ DISTANCE_FROM_ORIGIN } diff --git a/Core/src/main/java/com/plotsquared/core/command/CmdConfirm.java b/Core/src/main/java/com/plotsquared/core/command/CmdConfirm.java index d1dc9406b..7f5998691 100644 --- a/Core/src/main/java/com/plotsquared/core/command/CmdConfirm.java +++ b/Core/src/main/java/com/plotsquared/core/command/CmdConfirm.java @@ -36,7 +36,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; public class CmdConfirm { - public @Nullable static CmdInstance getPending(PlotPlayer player) { + public static @Nullable CmdInstance getPending(PlotPlayer player) { try (final MetaDataAccess metaDataAccess = player.accessTemporaryMetaData( PlayerMetaDataKeys.TEMPORARY_CONFIRM)) { return metaDataAccess.get().orElse(null); diff --git a/Core/src/main/java/com/plotsquared/core/configuration/caption/StaticCaption.java b/Core/src/main/java/com/plotsquared/core/configuration/caption/StaticCaption.java index f040fa8ba..675142d30 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/caption/StaticCaption.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/caption/StaticCaption.java @@ -42,7 +42,7 @@ public final class StaticCaption implements Caption { * @param text Text * @return Created caption */ - public @NonNull static StaticCaption of(final @NonNull String text) { + public static @NonNull StaticCaption of(final @NonNull String text) { return new StaticCaption(Preconditions.checkNotNull(text, "Text may not be null")); } 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 60a30dd0b..6cbe382a1 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 @@ -54,7 +54,7 @@ public final class Templates { * @param replacements Replacements * @return Generated template */ - public @NonNull static Template of( + public static @NonNull Template of( final @NonNull LocaleHolder localeHolder, final @NonNull String key, final @NonNull Caption caption, final @NonNull Template... replacements @@ -69,7 +69,7 @@ public final class Templates { * @param uuid Player UUID * @return Generated template */ - public @NonNull static Template of(final @NonNull String key, final @NonNull UUID uuid) { + public static @NonNull Template of(final @NonNull String key, final @NonNull UUID uuid) { final String username = PlayerManager.getName(uuid); return Template.of(key, username); } @@ -81,7 +81,7 @@ public final class Templates { * @param value Template value * @return Generated template */ - public @NonNull static Template of(final @NonNull String key, final @NonNull String value) { + public static @NonNull Template of(final @NonNull String key, final @NonNull String value) { return Template.of(key, value); } @@ -92,7 +92,7 @@ public final class Templates { * @param area Plot area * @return Generated template */ - public @NonNull static Template of(final @NonNull String key, final @NonNull PlotArea area) { + public static @NonNull Template of(final @NonNull String key, final @NonNull PlotArea area) { return Template.of(key, area.toString()); } @@ -103,7 +103,7 @@ public final class Templates { * @param number Number * @return Generated template */ - public @NonNull static Template of(final @NonNull String key, final @NonNull Number number) { + public static @NonNull Template of(final @NonNull String key, final @NonNull 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 a8cbd34ba..270a35ebe 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 @@ -57,7 +57,7 @@ public final class TranslatableCaption implements NamespacedCaption { * included, {@link #DEFAULT_NAMESPACE} will be used. * @return Caption instance */ - public @NonNull static TranslatableCaption of(final @NonNull String rawKey) { + public static @NonNull TranslatableCaption of(final @NonNull String rawKey) { final String namespace; final String key; if (rawKey.contains(":")) { @@ -81,7 +81,7 @@ public final class TranslatableCaption implements NamespacedCaption { * @param key Caption key * @return Caption instance */ - public @NonNull static TranslatableCaption of( + public static @NonNull TranslatableCaption of( final @NonNull String namespace, final @NonNull String key ) { diff --git a/Core/src/main/java/com/plotsquared/core/generator/IndependentPlotGenerator.java b/Core/src/main/java/com/plotsquared/core/generator/IndependentPlotGenerator.java index 1bd8a7058..0d2fde9d2 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/IndependentPlotGenerator.java +++ b/Core/src/main/java/com/plotsquared/core/generator/IndependentPlotGenerator.java @@ -30,6 +30,7 @@ import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotId; import com.plotsquared.core.queue.ScopedQueueCoordinator; import com.plotsquared.core.setup.PlotAreaBuilder; +import org.checkerframework.checker.nullness.qual.NonNull; /** * This class allows for implementation independent world generation. @@ -94,7 +95,7 @@ public abstract class IndependentPlotGenerator { * @param world ChunkGenerator Implementation * @return Chunk generator */ - public GeneratorWrapper specify(String world) { + public GeneratorWrapper specify(final @NonNull String world) { return (GeneratorWrapper) PlotSquared.platform().wrapPlotGenerator(world, this); } 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 11f2f5b50..1a180cd73 100644 --- a/Core/src/main/java/com/plotsquared/core/location/Location.java +++ b/Core/src/main/java/com/plotsquared/core/location/Location.java @@ -84,7 +84,7 @@ public final class Location extends BlockLoc implements Comparable { * @param pitch pitch * @return New location */ - public @NonNull static Location at( + public static @NonNull Location at( final @NonNull String world, final @NonNull BlockVector3 blockVector3, final float yaw, final float pitch ) { @@ -98,7 +98,7 @@ public final class Location extends BlockLoc implements Comparable { * @param blockVector3 (x,y,z) vector * @return New location */ - public @NonNull static Location at( + public static @NonNull Location at( final @NonNull String world, final @NonNull BlockVector3 blockVector3 ) { @@ -116,7 +116,7 @@ public final class Location extends BlockLoc implements Comparable { * @param pitch Pitch * @return New location */ - public @NonNull static Location at( + public static @NonNull Location at( final @NonNull String world, final int x, final int y, final int z, final float yaw, final float pitch ) { @@ -132,7 +132,7 @@ public final class Location extends BlockLoc implements Comparable { * @param z Z coordinate * @return New location */ - public @NonNull static Location at( + public static @NonNull Location at( final @NonNull String world, final int x, final int y, final int z ) { @@ -148,7 +148,7 @@ public final class Location extends BlockLoc implements Comparable { * @param pitch pitch * @return New location */ - public @NonNull static Location at( + public static @NonNull Location at( final @NonNull World world, final @NonNull BlockVector3 blockVector3, final float yaw, final float pitch ) { @@ -162,7 +162,7 @@ public final class Location extends BlockLoc implements Comparable { * @param blockVector3 (x,y,z) vector * @return New location */ - public @NonNull static Location at( + public static @NonNull Location at( final @NonNull World world, final @NonNull BlockVector3 blockVector3 ) { @@ -180,7 +180,7 @@ public final class Location extends BlockLoc implements Comparable { * @param pitch Pitch * @return New location */ - public @NonNull static Location at( + public static @NonNull Location at( final @NonNull World world, final int x, final int y, final int z, final float yaw, final float pitch ) { @@ -196,7 +196,7 @@ public final class Location extends BlockLoc implements Comparable { * @param z Z coordinate * @return New location */ - public @NonNull static Location at( + public static @NonNull Location at( final @NonNull World world, final int x, final int y, final int z ) { 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 4e1d9edfb..d3f04e1de 100644 --- a/Core/src/main/java/com/plotsquared/core/location/PlotLoc.java +++ b/Core/src/main/java/com/plotsquared/core/location/PlotLoc.java @@ -53,7 +53,7 @@ public final class PlotLoc { this.z = z; } - public @Nullable static PlotLoc fromString(final String input) { + public static @Nullable PlotLoc fromString(final String input) { if (input == null || "side".equalsIgnoreCase(input)) { return null; } else if (StringMan.isEqualIgnoreCaseToAny(input, "center", "middle")) { diff --git a/Core/src/main/java/com/plotsquared/core/player/MetaDataKey.java b/Core/src/main/java/com/plotsquared/core/player/MetaDataKey.java index a0806de74..be014393e 100644 --- a/Core/src/main/java/com/plotsquared/core/player/MetaDataKey.java +++ b/Core/src/main/java/com/plotsquared/core/player/MetaDataKey.java @@ -62,7 +62,7 @@ public final class MetaDataKey { * @param Type * @return MetaData key instance */ - public @NonNull static MetaDataKey of(final @NonNull String key, final @NonNull TypeLiteral type) { + public static @NonNull MetaDataKey of(final @NonNull String key, final @NonNull TypeLiteral type) { synchronized (keyMetaData) { return (MetaDataKey) keyMap.computeIfAbsent(key, missingKey -> new MetaDataKey<>(missingKey, type)); 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 efa13b13f..39289b045 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -319,7 +319,7 @@ public class Plot { * @param message If a message should be sent to the player if a plot cannot be found * @return The plot if only 1 result is found, or null */ - public @Nullable static Plot getPlotFromString( + public static @Nullable Plot getPlotFromString( final @Nullable PlotPlayer player, final @Nullable String arg, final boolean message @@ -386,7 +386,7 @@ public class Plot { * @param string plot id/area + id * @return New or existing plot object */ - public @Nullable static Plot fromString(final @Nullable PlotArea defaultArea, final @NonNull String string) { + public static @Nullable Plot fromString(final @Nullable PlotArea defaultArea, final @NonNull String string) { final String[] split = string.split("[;,]"); if (split.length == 2) { if (defaultArea != null) { @@ -416,7 +416,7 @@ public class Plot { * @return plot at location or null * @see PlotPlayer#getCurrentPlot() if a player is expected here. */ - public @Nullable static Plot getPlot(final @NonNull Location location) { + public static @Nullable Plot getPlot(final @NonNull Location location) { final PlotArea pa = location.getPlotArea(); if (pa != null) { return pa.getPlot(location); 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 75e2b0bef..8b050d756 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotId.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotId.java @@ -61,7 +61,7 @@ public final class PlotId { * @param y The plot y coordinate * @return a new PlotId at x,y */ - public @NonNull static PlotId of(final int x, final int y) { + public static @NonNull PlotId of(final int x, final int y) { return new PlotId(x, y); } @@ -72,7 +72,7 @@ public final class PlotId { * @return the PlotId representation of the argument * @throws IllegalArgumentException if the string does not contain a valid PlotId */ - public @NonNull static PlotId fromString(final @NonNull String string) { + public static @NonNull PlotId fromString(final @NonNull String string) { final PlotId plot = fromStringOrNull(string); if (plot == null) { throw new IllegalArgumentException("Cannot create PlotID. String invalid."); @@ -86,7 +86,7 @@ public final class PlotId { * @param string ID string * @return Plot ID, or {@code null} if none could be parsed */ - public @Nullable static PlotId fromStringOrNull(final @NonNull String string) { + public static @Nullable PlotId fromStringOrNull(final @NonNull String string) { final String[] parts = string.split("[;_,.]"); if (parts.length < 2) { return null; @@ -109,7 +109,7 @@ public final class PlotId { * @param hash ID hash * @return Plot ID */ - public @NonNull static PlotId unpair(final int hash) { + public static @NonNull PlotId unpair(final int hash) { return PlotId.of(hash >> 16, hash & 0xFFFF); } 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 11afe7807..1bb0953a3 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 @@ -131,7 +131,7 @@ public class DenyTeleportFlag extends PlotFlag TRUE, FALSE; - public @Nullable static TitlesFlagValue fromString(final String value) { + public static @Nullable TitlesFlagValue fromString(final String value) { if (value.equalsIgnoreCase("true")) { return TRUE; } else if (value.equalsIgnoreCase("false")) { 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 1db8cc05c..db0b4a775 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 @@ -135,8 +135,7 @@ public interface PlotAreaManager { * @param region Optional region * @return All areas in the world (and region) */ - @NonNull - default Set getPlotAreasSet( + default @NonNull Set<@NonNull PlotArea> getPlotAreasSet( final @NonNull String world, final @Nullable CuboidRegion region ) { @@ -153,8 +152,7 @@ public interface PlotAreaManager { * @param world World name * @return Modifiable set containing all plot areas in the specified world */ - @NonNull - default Set getPlotAreasSet(final @NonNull String world) { + default @NonNull Set<@NonNull PlotArea> getPlotAreasSet(final @NonNull String world) { final Set set = new HashSet<>(); Collections.addAll(set, this.getPlotAreas(world, null)); return set; @@ -167,8 +165,7 @@ public interface PlotAreaManager { * @param search Search string * @return An area that matches the search string, or {@code null} */ - @Nullable - default PlotArea getPlotAreaByString(final @NonNull String search) { + default @Nullable PlotArea getPlotAreaByString(final @NonNull String search) { String[] split = search.split("[;,]"); PlotArea[] areas = this.getPlotAreas(split[0], null); if (areas == null) { 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 1e454c318..3a2851b21 100644 --- a/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java +++ b/Core/src/main/java/com/plotsquared/core/setup/CommonSetupSteps.java @@ -60,7 +60,7 @@ public enum CommonSetupSteps implements SetupStep { return CommonSetupSteps.CHOOSE_PLOT_AREA_TYPE; // proceed with next step } - @NonNull + @Override public Collection getSuggestions() { return Collections.unmodifiableSet(SetupUtils.generators.keySet()); diff --git a/Core/src/main/java/com/plotsquared/core/synchronization/LockKey.java b/Core/src/main/java/com/plotsquared/core/synchronization/LockKey.java index 4f9d19230..7b6b469cb 100644 --- a/Core/src/main/java/com/plotsquared/core/synchronization/LockKey.java +++ b/Core/src/main/java/com/plotsquared/core/synchronization/LockKey.java @@ -55,7 +55,7 @@ public final class LockKey { * @param key Key name * @return Lock key instance */ - public @NonNull static LockKey of(final @NonNull String key) { + public static @NonNull LockKey of(final @NonNull String key) { synchronized (keyLock) { return keyMap.computeIfAbsent(key, LockKey::new); } 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 b3ee868a8..d3a78eef6 100644 --- a/Core/src/main/java/com/plotsquared/core/util/BlockUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/BlockUtil.java @@ -64,7 +64,7 @@ public final class BlockUtil { * @param id Legacy ID * @return Block state, or {@code null} */ - public @Nullable static BlockState get(final int id) { + public static @Nullable BlockState get(final int id) { return LegacyMapper.getInstance().getBlockFromLegacy(id); } @@ -75,7 +75,7 @@ public final class BlockUtil { * @param data Legacy data * @return Block state, or {@code null} */ - public @Nullable static BlockState get(final int id, final int data) { + public static @Nullable BlockState get(final int id, final int data) { return LegacyMapper.getInstance().getBlockFromLegacy(id, data); } @@ -83,20 +83,21 @@ public final class BlockUtil { * Get a {@link BlockState} from its ID * * @param id String or integer ID - * @return Parsed block state, or {@code null} if none + * @return Parsed block state, or {@code null} if none * could be parsed */ - public @Nullable static BlockState get(@NonNull String id) { + public static @Nullable BlockState get(final @NonNull String id) { if (id.length() == 1 && id.charAt(0) == '*') { return FuzzyBlockState.builder().type(BlockTypes.AIR).build(); } - id = id.toLowerCase(); - BlockType type = BlockTypes.get(id); + String mutableId = id; + mutableId = id.toLowerCase(); + BlockType type = BlockTypes.get(mutableId ); if (type != null) { return type.getDefaultState(); } - if (Character.isDigit(id.charAt(0))) { - String[] split = id.split(":"); + if (Character.isDigit(mutableId .charAt(0))) { + String[] split = mutableId .split(":"); if (MathMan.isInteger(split[0])) { if (split.length == 2) { if (MathMan.isInteger(split[1])) { @@ -108,7 +109,7 @@ public final class BlockUtil { } } try { - BaseBlock block = PARSER.parseFromInput(id, PARSER_CONTEXT); + BaseBlock block = PARSER.parseFromInput(mutableId, PARSER_CONTEXT); return block.toImmutableState(); } catch (InputParseException e) { return null; @@ -121,7 +122,7 @@ public final class BlockUtil { * @param commaDelimited List of block states * @return Parsed block states */ - public @NonNull static BlockState[] parse(final @NonNull String commaDelimited) { + public static @NonNull BlockState[] parse(final @NonNull String commaDelimited) { final String[] split = commaDelimited.split(",(?![^\\(\\[]*[\\]\\)])"); final BlockState[] result = new BlockState[split.length]; for (int i = 0; i < split.length; i++) { @@ -137,7 +138,7 @@ public final class BlockUtil { * @return Deserialized block state, or {@code null} if the map is * not a properly serialized block state */ - public @Nullable static BlockState deserialize(final @NonNull Map map) { + public static @Nullable BlockState deserialize(final @NonNull Map map) { if (map.containsKey("material")) { final Object object = map.get("material"); return get(object.toString()); diff --git a/Core/src/main/java/com/plotsquared/core/util/FileUtils.java b/Core/src/main/java/com/plotsquared/core/util/FileUtils.java index 4a7bfddcf..1b0e3d396 100644 --- a/Core/src/main/java/com/plotsquared/core/util/FileUtils.java +++ b/Core/src/main/java/com/plotsquared/core/util/FileUtils.java @@ -58,7 +58,7 @@ public final class FileUtils { } } - public @NonNull static File getFile(final @NonNull File base, final @NonNull String path) { + public static @NonNull File getFile(final @NonNull File base, final @NonNull String path) { if (Paths.get(path).isAbsolute()) { return new File(path); } 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 969152d93..1c20da6fd 100644 --- a/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java @@ -117,7 +117,7 @@ public abstract class PlayerManager

, T> { * @param localeHolder the localeHolder to localize the component for * @return Component of name list */ - public @NonNull static Component getPlayerList(final @NonNull Collection uuids, LocaleHolder localeHolder) { + public static @NonNull Component getPlayerList(final @NonNull Collection uuids, LocaleHolder localeHolder) { if (uuids.isEmpty()) { return MINI_MESSAGE.parse(TranslatableCaption.of("info.none").getComponent(localeHolder)); } @@ -163,7 +163,7 @@ public abstract class PlayerManager

, T> { * @param owner Owner UUID * @return The player's name, None, Everyone or Unknown */ - public @NonNull static String getName(final @Nullable UUID owner) { + public static @NonNull String getName(final @Nullable UUID owner) { return getName(owner, true); } @@ -174,7 +174,7 @@ public abstract class PlayerManager

, T> { * @param blocking Whether or not the operation can be blocking * @return The player's name, None, Everyone or Unknown */ - public @NonNull static String getName(final @Nullable UUID owner, final boolean blocking) { + public static @NonNull String getName(final @Nullable UUID owner, final boolean blocking) { if (owner == null) { TranslatableCaption.of("info.none"); } 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 5adef7e51..9369d8bf6 100644 --- a/Core/src/main/java/com/plotsquared/core/util/RegionUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/RegionUtil.java @@ -38,7 +38,7 @@ import java.util.Iterator; public class RegionUtil { - public @NonNull static Location[] getCorners( + public static @NonNull Location[] getCorners( final @NonNull String world, final @NonNull CuboidRegion region ) { @@ -47,7 +47,7 @@ public class RegionUtil { return new Location[]{Location.at(world, min), Location.at(world, max)}; } - public @NonNull static Location[] getCorners(String world, Collection regions) { + public static @NonNull Location[] getCorners(String world, Collection regions) { CuboidRegion aabb = getAxisAlignedBoundingBox(regions); return getCorners(world, aabb); } @@ -58,7 +58,7 @@ public class RegionUtil { * @param regions The regions the bounding box should contain. * @return a CuboidRegion that contains all given regions. */ - public @NonNull static CuboidRegion getAxisAlignedBoundingBox(Iterable regions) { + public static @NonNull CuboidRegion getAxisAlignedBoundingBox(Iterable regions) { Iterator iterator = regions.iterator(); if (!iterator.hasNext()) { throw new IllegalArgumentException("No regions given"); @@ -102,7 +102,7 @@ public class RegionUtil { .getY() && y <= max.getY(); } - public @NonNull static Rectangle2D toRectangle(final @NonNull CuboidRegion region) { + public static @NonNull Rectangle2D toRectangle(final @NonNull CuboidRegion region) { final BlockVector2 min = region.getMinimumPoint().toBlockVector2(); final BlockVector2 max = region.getMaximumPoint().toBlockVector2(); return new Rectangle2D.Double(min.getX(), min.getZ(), max.getX(), max.getZ()); 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 0e9640486..5f68b8323 100644 --- a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java +++ b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java @@ -81,7 +81,7 @@ public final class TabCompletions { * @param existing Players that should not be included in completions * @return List of completions */ - public @NonNull static List completePlayers( + public static @NonNull List completePlayers( final @NonNull String input, final @NonNull List existing ) { @@ -96,7 +96,7 @@ public final class TabCompletions { * @param existing Players that should not be included in completions * @return List of completions */ - public @NonNull static List completeAddedPlayers( + public static @NonNull List completeAddedPlayers( final @NonNull Plot plot, final @NonNull String input, final @NonNull List existing ) { @@ -107,7 +107,7 @@ public final class TabCompletions { ); } - public @NonNull static List completePlayersInPlot( + public static @NonNull List completePlayersInPlot( final @NonNull Plot plot, final @NonNull String input, final @NonNull List existing ) { @@ -130,7 +130,7 @@ public final class TabCompletions { * @param input Command input * @return List of completions */ - public @NonNull static List completePatterns(final @NonNull String input) { + public static @NonNull List completePatterns(final @NonNull String input) { return PatternUtil.getSuggestions(input.trim()).stream() .map(value -> value.toLowerCase(Locale.ENGLISH).replace("minecraft:", "")) .filter(value -> value.startsWith(input.toLowerCase(Locale.ENGLISH))) @@ -138,7 +138,7 @@ public final class TabCompletions { }).collect(Collectors.toList()); } - public @NonNull static List completeBoolean(final @NonNull String input) { + public static @NonNull List completeBoolean(final @NonNull String input) { if (input.isEmpty()) { return Arrays.asList(booleanTrueCompletion, booleanFalseCompletion); } @@ -160,7 +160,7 @@ public final class TabCompletions { * @param highestLimit Highest number to include * @return Unmodifiable list of number completions */ - public @NonNull static List completeNumbers( + public static @NonNull List completeNumbers( final @NonNull String input, final int amountLimit, final int highestLimit ) { @@ -187,7 +187,7 @@ public final class TabCompletions { * @param input Input to filter with * @return Unmodifiable list of area completions */ - public @NonNull static List completeAreas(final @NonNull String input) { + public static @NonNull List completeAreas(final @NonNull String input) { final List completions = new ArrayList<>(); for (final PlotArea area : PlotSquared.get().getPlotAreaManager().getAllPlotAreas()) { String areaName = area.getWorldName(); @@ -205,7 +205,7 @@ public final class TabCompletions { return Collections.unmodifiableList(completions); } - public @NonNull static List asCompletions(String... toFilter) { + public static @NonNull List asCompletions(String... toFilter) { final List completions = new ArrayList<>(); for (String completion : toFilter) { completions.add(new Command(null, false, completion, "", diff --git a/Core/src/main/java/com/plotsquared/core/util/TimeUtil.java b/Core/src/main/java/com/plotsquared/core/util/TimeUtil.java index 899bd7f7e..b20d15025 100644 --- a/Core/src/main/java/com/plotsquared/core/util/TimeUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/TimeUtil.java @@ -40,7 +40,7 @@ public final class TimeUtil { * @param time Time to format * @return Formatted string */ - public @NonNull static String secToTime(@NonNegative long time) { + public static @NonNull String secToTime(@NonNegative long time) { StringBuilder toReturn = new StringBuilder(); if (time >= 33868800) { int years = (int) (time / 33868800); 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 e71e3e608..579064477 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 @@ -92,7 +92,7 @@ public abstract class TaskManager { * @param id Task ID * @return Task if stored, or {@code null} */ - public @Nullable static PlotSquaredTask removeTask(final int id) { + public static @Nullable PlotSquaredTask removeTask(final int id) { return tasks.remove(id); } @@ -104,7 +104,7 @@ public abstract class TaskManager { * @param taskTime Task interval * @return Created task object, can be used to cancel the task */ - public @NonNull static PlotSquaredTask runTaskRepeat( + public static @NonNull PlotSquaredTask runTaskRepeat( final @Nullable Runnable runnable, final @NonNull TaskTime taskTime ) { @@ -188,7 +188,7 @@ public abstract class TaskManager { } } - public @Nullable static TaskManager getPlatformImplementation() { + public static @Nullable TaskManager getPlatformImplementation() { return platformImplementation; } diff --git a/Core/src/main/java/com/plotsquared/core/util/task/TaskTime.java b/Core/src/main/java/com/plotsquared/core/util/task/TaskTime.java index c3f606ca1..b89b715f3 100644 --- a/Core/src/main/java/com/plotsquared/core/util/task/TaskTime.java +++ b/Core/src/main/java/com/plotsquared/core/util/task/TaskTime.java @@ -48,7 +48,7 @@ public final class TaskTime { * @param seconds Seconds * @return Created task time instance */ - public @NonNull static TaskTime seconds(@NonNegative final long seconds) { + public static @NonNull TaskTime seconds(@NonNegative final long seconds) { return new TaskTime(seconds * 1000L, TaskUnit.MILLISECONDS); } @@ -58,7 +58,7 @@ public final class TaskTime { * @param ticks Server ticks * @return Created task time instance */ - public @NonNull static TaskTime ticks(@NonNegative final long ticks) { + public static @NonNull TaskTime ticks(@NonNegative final long ticks) { return new TaskTime(ticks, TaskUnit.TICKS); } @@ -68,7 +68,7 @@ public final class TaskTime { * @param ms Milliseconds * @return Created task time instance */ - public @NonNull static TaskTime ms(@NonNegative final long ms) { + public static @NonNull TaskTime ms(@NonNegative final long ms) { return new TaskTime(ms, TaskUnit.MILLISECONDS); } 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 dba87b492..c7c475599 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/CacheUUIDService.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/CacheUUIDService.java @@ -58,21 +58,21 @@ public class CacheUUIDService implements UUIDService, Consumer } @Override - public @NonNull List getNames(final @NonNull List uuids) { + public @NonNull List getNames(final @NonNull List<@NonNull UUID> uuids) { final List mappings = new ArrayList<>(uuids.size()); mappings.addAll(this.uuidCache.getAllPresent(uuids).values()); return mappings; } @Override - public @NonNull List getUUIDs(final @NonNull List usernames) { + public @NonNull List getUUIDs(final @NonNull List<@NonNull String> usernames) { final List mappings = new ArrayList<>(usernames.size()); mappings.addAll(this.usernameCache.getAllPresent(usernames).values()); return mappings; } @Override - public void accept(final List uuidMappings) { + public void accept(final @NonNull List<@NonNull UUIDMapping> uuidMappings) { for (final UUIDMapping mapping : uuidMappings) { this.uuidCache.put(mapping.getUuid(), mapping); this.usernameCache.put(mapping.getUsername(), mapping); @@ -80,7 +80,7 @@ public class CacheUUIDService implements UUIDService, Consumer } @Override - public @NonNull Collection getImmediately() { + public @NonNull Collection<@NonNull UUIDMapping> getImmediately() { return this.usernameCache.asMap().values(); } diff --git a/Core/src/main/java/com/plotsquared/core/uuid/ServiceError.java b/Core/src/main/java/com/plotsquared/core/uuid/ServiceError.java index 1d012b302..97ad4e5dd 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/ServiceError.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/ServiceError.java @@ -36,7 +36,10 @@ public class ServiceError extends RuntimeException { super(message); } - public ServiceError(final @NonNull String message, final @NonNull Throwable cause) { + public ServiceError( + final @NonNull String message, + final @NonNull Throwable cause + ) { super(message, cause); } 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 920350d65..6b515606d 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/UUIDMapping.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/UUIDMapping.java @@ -38,7 +38,7 @@ public class UUIDMapping { private final UUID uuid; private final String username; - public UUIDMapping(final @NonNull UUID uuid, final String username) { + public UUIDMapping(final @NonNull UUID uuid, final @NonNull String username) { this.uuid = uuid; this.username = username; } 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 36eafe25f..f0150c6e0 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/UUIDPipeline.java @@ -101,7 +101,7 @@ public class UUIDPipeline { * * @param mappingConsumer Consumer to register */ - public void registerConsumer(final @NonNull Consumer> mappingConsumer) { + public void registerConsumer(final @NonNull Consumer<@NonNull List<@NonNull UUIDMapping>> mappingConsumer) { this.consumerList.add(mappingConsumer); } @@ -110,7 +110,7 @@ public class UUIDPipeline { * * @return Copy of service list */ - public List getServiceListInstance() { + public @NonNull List<@NonNull UUIDService> getServiceListInstance() { return Collections.unmodifiableList(this.serviceList); } @@ -119,7 +119,7 @@ public class UUIDPipeline { * * @param mappings Mappings */ - public void consume(final @NonNull List mappings) { + public void consume(final @NonNull List<@NonNull UUIDMapping> mappings) { final Runnable runnable = () -> { for (final Consumer> consumer : this.consumerList) { consumer.accept(mappings); @@ -213,7 +213,7 @@ public class UUIDPipeline { * @param username Username * @param uuid UUID consumer */ - public void getSingle(final @NonNull String username, final @NonNull BiConsumer uuid) { + public void getSingle(final @NonNull String username, final @NonNull BiConsumer<@Nullable UUID, @Nullable Throwable> uuid) { this.getUUIDs(Collections.singletonList(username)).applyToEither( timeoutAfter(Settings.UUID.NON_BLOCKING_TIMEOUT), Function.identity() @@ -237,7 +237,7 @@ public class UUIDPipeline { * @param uuid UUID * @param username Username consumer */ - public void getSingle(final @NonNull UUID uuid, final @NonNull BiConsumer username) { + public void getSingle(final @NonNull UUID uuid, final @NonNull BiConsumer<@Nullable String, @Nullable Throwable> username) { this.getNames(Collections.singletonList(uuid)).applyToEither( timeoutAfter(Settings.UUID.NON_BLOCKING_TIMEOUT), Function.identity() @@ -265,7 +265,10 @@ public class UUIDPipeline { * @param timeout Timeout in milliseconds * @return Mappings */ - public CompletableFuture> getNames(final @NonNull Collection requests, final long timeout) { + public @NonNull CompletableFuture<@NonNull List<@NonNull UUIDMapping>> getNames( + final @NonNull Collection<@NonNull UUID> requests, + final long timeout + ) { return this.getNames(requests).applyToEither(timeoutAfter(timeout), Function.identity()); } @@ -279,11 +282,14 @@ public class UUIDPipeline { * @param timeout Timeout in milliseconds * @return Mappings */ - public CompletableFuture> getUUIDs(final @NonNull Collection requests, final long timeout) { + public @NonNull CompletableFuture> getUUIDs( + final @NonNull Collection requests, + final long timeout + ) { return this.getUUIDs(requests).applyToEither(timeoutAfter(timeout), Function.identity()); } - private CompletableFuture> timeoutAfter(final long timeout) { + private @NonNull CompletableFuture<@NonNull List<@NonNull UUIDMapping>> timeoutAfter(final long timeout) { final CompletableFuture> result = new CompletableFuture<>(); this.timeoutExecutor.schedule(() -> result.completeExceptionally(new TimeoutException()), timeout, TimeUnit.MILLISECONDS); return result; @@ -295,7 +301,9 @@ public class UUIDPipeline { * @param requests UUIDs * @return Mappings */ - public CompletableFuture> getNames(final @NonNull Collection requests) { + public @NonNull CompletableFuture<@NonNull List<@NonNull UUIDMapping>> getNames( + final @NonNull Collection<@NonNull UUID> requests + ) { if (requests.isEmpty()) { return CompletableFuture.completedFuture(Collections.emptyList()); } @@ -362,7 +370,9 @@ public class UUIDPipeline { * @param requests Names * @return Mappings */ - public CompletableFuture> getUUIDs(final @NonNull Collection requests) { + public @NonNull CompletableFuture<@NonNull List<@NonNull UUIDMapping>> getUUIDs( + final @NonNull Collection<@NonNull String> requests + ) { if (requests.isEmpty()) { return CompletableFuture.completedFuture(Collections.emptyList()); } @@ -417,7 +427,7 @@ public class UUIDPipeline { * * @return All mappings that could be provided immediately */ - public @NonNull final Collection getAllImmediately() { + public @NonNull final Collection<@NonNull UUIDMapping> getAllImmediately() { final Set mappings = new LinkedHashSet<>(); for (final UUIDService service : this.getServiceListInstance()) { mappings.addAll(service.getImmediately()); 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 3a9b313a5..927567e0e 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/UUIDService.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/UUIDService.java @@ -45,7 +45,7 @@ public interface UUIDService { * @param uuids Requests * @return Completed requests */ - @NonNull List getNames(final @NonNull List uuids); + @NonNull List<@NonNull UUIDMapping> getNames(final @NonNull List<@NonNull UUID> uuids); /** * Attempt to complete the given requests. Returns the mappings @@ -54,7 +54,7 @@ public interface UUIDService { * @param usernames Requests * @return Completed requests */ - @NonNull List getUUIDs(final @NonNull List usernames); + @NonNull List<@NonNull UUIDMapping> getUUIDs(final @NonNull List<@NonNull String> usernames); /** * Get as many UUID mappings as possible under the condition @@ -62,7 +62,7 @@ public interface UUIDService { * * @return All mappings that could be provided immediately */ - default @NonNull Collection getImmediately() { + default @NonNull Collection<@NonNull UUIDMapping> getImmediately() { return Collections.emptyList(); } 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 67dfd3cd3..793cc3880 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 @@ -51,12 +51,12 @@ public class OfflineModeUUIDService implements UUIDService { } @Override - public @NonNull List getNames(final @NonNull List uuids) { + public @NonNull List<@NonNull UUIDMapping> getNames(final @NonNull List<@NonNull UUID> uuids) { return Collections.emptyList(); } @Override - public @NonNull List getUUIDs(@NonNull List usernames) { + public @NonNull List<@NonNull UUIDMapping> getUUIDs(@NonNull List<@NonNull String> usernames) { final List mappings = new ArrayList<>(usernames.size()); for (final String username : usernames) { mappings.add(new UUIDMapping(getFromUsername(username), username));