mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
More annotation work
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user