More annotation work

This commit is contained in:
Alexander Söderberg
2021-01-10 00:01:48 +01:00
parent 57fc51d013
commit 8292ed9e31
35 changed files with 144 additions and 108 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -49,7 +49,7 @@ public class BukkitWorld implements World<org.bukkit.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<org.bukkit.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;