Address a few deprecations

This commit is contained in:
NotMyFault 2021-05-01 18:33:02 +02:00
parent 11af33f2d5
commit 0106a4222d
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
64 changed files with 133 additions and 126 deletions

View File

@ -69,7 +69,7 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
if (!(commandSender instanceof Player)) { if (!(commandSender instanceof Player)) {
return null; return null;
} }
PlotPlayer player = BukkitUtil.adapt((Player) commandSender); PlotPlayer<?> player = BukkitUtil.adapt((Player) commandSender);
if (args.length == 0) { if (args.length == 0) {
return Collections.singletonList("plots"); return Collections.singletonList("plots");
} }

View File

@ -44,11 +44,11 @@ import java.util.UUID;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class ForceFieldListener { public class ForceFieldListener {
private static Set<PlotPlayer> getNearbyPlayers(Player player, Plot plot) { private static Set<PlotPlayer<?>> getNearbyPlayers(Player player, Plot plot) {
Set<PlotPlayer> players = new HashSet<>(); Set<PlotPlayer<?>> players = new HashSet<>();
for (Player nearPlayer : Iterables for (Player nearPlayer : Iterables
.filter(player.getNearbyEntities(5d, 5d, 5d), Player.class)) { .filter(player.getNearbyEntities(5d, 5d, 5d), Player.class)) {
PlotPlayer plotPlayer; PlotPlayer<?> plotPlayer;
if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot
.equals(plotPlayer.getCurrentPlot())) { .equals(plotPlayer.getCurrentPlot())) {
continue; continue;
@ -60,10 +60,10 @@ public class ForceFieldListener {
return players; return players;
} }
private static PlotPlayer hasNearbyPermitted(Player player, Plot plot) { private static PlotPlayer<?> hasNearbyPermitted(Player player, Plot plot) {
for (Player nearPlayer : Iterables for (Player nearPlayer : Iterables
.filter(player.getNearbyEntities(5d, 5d, 5d), Player.class)) { .filter(player.getNearbyEntities(5d, 5d, 5d), Player.class)) {
PlotPlayer plotPlayer; PlotPlayer<?> plotPlayer;
if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot if ((plotPlayer = BukkitUtil.adapt(nearPlayer)) == null || !plot
.equals(plotPlayer.getCurrentPlot())) { .equals(plotPlayer.getCurrentPlot())) {
continue; continue;
@ -75,7 +75,7 @@ public class ForceFieldListener {
return null; return null;
} }
private static Vector calculateVelocity(PlotPlayer player, PlotPlayer e) { private static Vector calculateVelocity(PlotPlayer<?> player, PlotPlayer<?> e) {
Location playerLocation = player.getLocationFull(); Location playerLocation = player.getLocationFull();
Location oPlayerLocation = e.getLocation(); Location oPlayerLocation = e.getLocation();
double playerX = playerLocation.getX(); double playerX = playerLocation.getX();
@ -105,12 +105,12 @@ public class ForceFieldListener {
return new Vector(x, y, z); return new Vector(x, y, z);
} }
public static void handleForcefield(Player player, PlotPlayer plotPlayer, Plot plot) { public static void handleForcefield(Player player, PlotPlayer<?> plotPlayer, Plot plot) {
if (plot.getFlag(ForcefieldFlag.class)) { if (plot.getFlag(ForcefieldFlag.class)) {
UUID uuid = plotPlayer.getUUID(); UUID uuid = plotPlayer.getUUID();
if (plot.isAdded(uuid)) { if (plot.isAdded(uuid)) {
Set<PlotPlayer> players = getNearbyPlayers(player, plot); Set<PlotPlayer<?>> players = getNearbyPlayers(player, plot);
for (PlotPlayer oPlayer : players) { for (PlotPlayer<?> oPlayer : players) {
if (!Permissions if (!Permissions
.hasPermission(oPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) { .hasPermission(oPlayer, Permission.PERMISSION_ADMIN_ENTRY_FORCEFIELD)) {
((BukkitPlayer) oPlayer).player ((BukkitPlayer) oPlayer).player
@ -118,7 +118,7 @@ public class ForceFieldListener {
} }
} }
} else { } else {
PlotPlayer oPlayer = hasNearbyPermitted(player, plot); PlotPlayer<?> oPlayer = hasNearbyPermitted(player, plot);
if (oPlayer == null) { if (oPlayer == null) {
return; return;
} }

View File

@ -138,7 +138,7 @@ public class BukkitInventoryUtil extends InventoryUtil {
} }
@Override @Override
public PlotItemStack[] getItems(PlotPlayer player) { public PlotItemStack[] getItems(PlotPlayer<?> player) {
BukkitPlayer bp = (BukkitPlayer) player; BukkitPlayer bp = (BukkitPlayer) player;
PlayerInventory inv = bp.player.getInventory(); PlayerInventory inv = bp.player.getInventory();
return IntStream.range(0, 36).mapToObj(i -> getItem(inv.getItem(i))) return IntStream.range(0, 36).mapToObj(i -> getItem(inv.getItem(i)))

View File

@ -430,7 +430,7 @@ public class BukkitUtil extends WorldUtil {
@Override @Override
@NonNegative @NonNegative
public double getHealth(final @NonNull PlotPlayer player) { public double getHealth(final @NonNull PlotPlayer<?> player) {
return Objects.requireNonNull(Bukkit.getPlayer(player.getUUID())).getHealth(); return Objects.requireNonNull(Bukkit.getPlayer(player.getUUID())).getHealth();
} }

View File

@ -45,7 +45,7 @@ public interface BackupManager {
* @param plot Plot to perform the automatic backup on * @param plot Plot to perform the automatic backup on
* @param whenDone Action that runs when the automatic backup has been completed * @param whenDone Action that runs when the automatic backup has been completed
*/ */
static void backup(@Nullable PlotPlayer player, final @NonNull Plot plot, @NonNull Runnable whenDone) { static void backup(@Nullable PlotPlayer<?> player, final @NonNull Plot plot, @NonNull Runnable whenDone) {
Objects.requireNonNull(PlotSquared.platform()).backupManager().automaticBackup(player, plot, whenDone); Objects.requireNonNull(PlotSquared.platform()).backupManager().automaticBackup(player, plot, whenDone);
} }
@ -67,7 +67,7 @@ public interface BackupManager {
* @param plot Plot to perform the automatic backup on * @param plot Plot to perform the automatic backup on
* @param whenDone Action that runs when the automatic backup has been completed * @param whenDone Action that runs when the automatic backup has been completed
*/ */
void automaticBackup(@Nullable PlotPlayer player, final @NonNull Plot plot, @NonNull Runnable whenDone); void automaticBackup(@Nullable PlotPlayer<?> player, final @NonNull Plot plot, @NonNull Runnable whenDone);
/** /**
* Get the directory in which backups are stored * Get the directory in which backups are stored

View File

@ -48,7 +48,7 @@ public class NullBackupManager implements BackupManager {
@Override @Override
public void automaticBackup( public void automaticBackup(
@Nullable PlotPlayer plotPlayer, @Nullable PlotPlayer<?> plotPlayer,
@NonNull Plot plot, @NonNull Runnable whenDone @NonNull Plot plot, @NonNull Runnable whenDone
) { ) {
whenDone.run(); whenDone.run();

View File

@ -99,7 +99,7 @@ public class SimpleBackupManager implements BackupManager {
} }
@Override @Override
public void automaticBackup(@Nullable PlotPlayer player, final @NonNull Plot plot, @NonNull Runnable whenDone) { public void automaticBackup(@Nullable PlotPlayer<?> player, final @NonNull Plot plot, @NonNull Runnable whenDone) {
final BackupProfile profile; final BackupProfile profile;
if (!this.shouldAutomaticallyBackup() || (profile = getProfile(plot)) instanceof NullBackupProfile) { if (!this.shouldAutomaticallyBackup() || (profile = getProfile(plot)) instanceof NullBackupProfile) {
whenDone.run(); whenDone.run();

View File

@ -164,7 +164,7 @@ public class Add extends Command {
} }
@Override @Override
public Collection<Command> tab(final PlotPlayer player, final String[] args, final boolean space) { public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
} }

View File

@ -130,7 +130,7 @@ public class Alias extends SubCommand {
} }
@Override @Override
public Collection<Command> tab(PlotPlayer player, String[] args, boolean space) { public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
final List<Command> commands = new ArrayList<>(2); final List<Command> commands = new ArrayList<>(2);
if (args.length == 1) { if (args.length == 1) {
if ("set".startsWith(args[0])) { if ("set".startsWith(args[0])) {
@ -144,7 +144,7 @@ public class Alias extends SubCommand {
return Collections.emptySet(); return Collections.emptySet();
} }
private void setAlias(PlotPlayer player, Plot plot, String alias) { private void setAlias(PlotPlayer<?> player, Plot plot, String alias) {
if (alias.isEmpty()) { if (alias.isEmpty()) {
sendUsage(player); sendUsage(player);
} else if (alias.length() >= 50) { } else if (alias.length() >= 50) {

View File

@ -96,7 +96,7 @@ public class Auto extends SubCommand {
} }
public static boolean checkAllowedPlots( public static boolean checkAllowedPlots(
PlotPlayer player, PlotArea plotarea, PlotPlayer<?> player, PlotArea plotarea,
@Nullable Integer allowedPlots, int sizeX, int sizeZ @Nullable Integer allowedPlots, int sizeX, int sizeZ
) { ) {
if (allowedPlots == null) { if (allowedPlots == null) {

View File

@ -47,7 +47,7 @@ import java.util.stream.Collectors;
public class Biome extends SetCommand { public class Biome extends SetCommand {
@Override @Override
public boolean set(final PlotPlayer player, final Plot plot, final String value) { public boolean set(final PlotPlayer<?> player, final Plot plot, final String value) {
BiomeType biome = null; BiomeType biome = null;
try { try {
biome = BiomeTypes.get(value.toLowerCase()); biome = BiomeTypes.get(value.toLowerCase());

View File

@ -462,7 +462,7 @@ public class Cluster extends SubCommand {
// add the user if not added // add the user if not added
cluster.invited.add(uuid); cluster.invited.add(uuid);
DBFunc.setInvited(cluster, uuid); DBFunc.setInvited(cluster, uuid);
final PlotPlayer otherPlayer = final PlotPlayer<?> otherPlayer =
PlotSquared.platform().playerManager().getPlayerIfExists(uuid); PlotSquared.platform().playerManager().getPlayerIfExists(uuid);
if (otherPlayer != null) { if (otherPlayer != null) {
player.sendMessage( player.sendMessage(
@ -538,7 +538,7 @@ public class Cluster extends SubCommand {
cluster.invited.remove(uuid); cluster.invited.remove(uuid);
DBFunc.removeInvited(cluster, uuid); DBFunc.removeInvited(cluster, uuid);
final PlotPlayer player2 = final PlotPlayer<?> player2 =
PlotSquared.platform().playerManager().getPlayerIfExists(uuid); PlotSquared.platform().playerManager().getPlayerIfExists(uuid);
if (player2 != null) { if (player2 != null) {
player.sendMessage( player.sendMessage(

View File

@ -75,7 +75,7 @@ public abstract class Command {
private String permission; private String permission;
private boolean confirmation; private boolean confirmation;
private CommandCategory category; private CommandCategory category;
private Argument[] arguments; private Argument<?>[] arguments;
public Command( public Command(
Command parent, boolean isStatic, String id, String permission, Command parent, boolean isStatic, String id, String permission,
@ -183,11 +183,11 @@ public abstract class Command {
return this.required; return this.required;
} }
public Argument[] getRequiredArguments() { public Argument<?>[] getRequiredArguments() {
return this.arguments; return this.arguments;
} }
public void setRequiredArguments(Argument[] arguments) { public void setRequiredArguments(Argument<?>[] arguments) {
this.arguments = arguments; this.arguments = arguments;
} }
@ -460,7 +460,7 @@ public abstract class Command {
return cmd; return cmd;
} }
public Command getCommand(Class clazz) { public Command getCommand(Class<?> clazz) {
for (Command cmd : this.allCommands) { for (Command cmd : this.allCommands) {
if (cmd.getClass() == clazz) { if (cmd.getClass() == clazz) {
return cmd; return cmd;

View File

@ -110,7 +110,7 @@ public class Comment extends SubCommand {
return false; return false;
} }
for (final PlotPlayer pp : PlotSquared.platform().playerManager().getPlayers()) { for (final PlotPlayer<?> pp : PlotSquared.platform().playerManager().getPlayers()) {
if (pp.getAttribute("chatspy")) { if (pp.getAttribute("chatspy")) {
pp.sendMessage(StaticCaption.of("/plot comment " + StringMan.join(args, " "))); pp.sendMessage(StaticCaption.of("/plot comment " + StringMan.join(args, " ")));
} }

View File

@ -86,7 +86,7 @@ public class DatabaseCommand extends SubCommand {
public static void insertPlots( public static void insertPlots(
final SQLManager manager, final List<Plot> plots, final SQLManager manager, final List<Plot> plots,
final PlotPlayer player final PlotPlayer<?> player
) { ) {
TaskManager.runTaskAsync(() -> { TaskManager.runTaskAsync(() -> {
try { try {

View File

@ -108,7 +108,7 @@ public class DebugExec extends SubCommand {
return true; return true;
} }
player.sendMessage(TranslatableCaption.of("debugexec.starting_task")); player.sendMessage(TranslatableCaption.of("debugexec.starting_task"));
this.hybridUtils.analyzePlot(plot, new RunnableVal<PlotAnalysis>() { this.hybridUtils.analyzePlot(plot, new RunnableVal<>() {
@Override @Override
public void run(PlotAnalysis value) { public void run(PlotAnalysis value) {
player.sendMessage( player.sendMessage(

View File

@ -89,7 +89,7 @@ public class DebugRoadRegen extends SubCommand {
} }
} }
public boolean regenPlot(PlotPlayer player) { public boolean regenPlot(PlotPlayer<?> player) {
Location location = player.getLocation(); Location location = player.getLocation();
PlotArea area = location.getPlotArea(); PlotArea area = location.getPlotArea();
if (area == null) { if (area == null) {
@ -122,7 +122,7 @@ public class DebugRoadRegen extends SubCommand {
return true; return true;
} }
public boolean regenRegion(PlotPlayer player, String[] args) { public boolean regenRegion(PlotPlayer<?> player, String[] args) {
int height = 0; int height = 0;
if (args.length == 1) { if (args.length == 1) {
try { try {

View File

@ -138,7 +138,7 @@ public class Deny extends SubCommand {
if (!uuid.equals(DBFunc.EVERYONE)) { if (!uuid.equals(DBFunc.EVERYONE)) {
handleKick(PlotSquared.platform().playerManager().getPlayerIfExists(uuid), plot); handleKick(PlotSquared.platform().playerManager().getPlayerIfExists(uuid), plot);
} else { } else {
for (PlotPlayer plotPlayer : plot.getPlayersInPlot()) { for (PlotPlayer<?> plotPlayer : plot.getPlayersInPlot()) {
// Ignore plot-owners // Ignore plot-owners
if (plot.isAdded(plotPlayer.getUUID())) { if (plot.isAdded(plotPlayer.getUUID())) {
continue; continue;
@ -156,11 +156,11 @@ public class Deny extends SubCommand {
} }
@Override @Override
public Collection<Command> tab(final PlotPlayer player, final String[] args, final boolean space) { public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
} }
private void handleKick(PlotPlayer player, Plot plot) { private void handleKick(PlotPlayer<?> player, Plot plot) {
if (player == null) { if (player == null) {
return; return;
} }

View File

@ -53,7 +53,7 @@ public class Desc extends SetCommand {
} }
@Override @Override
public boolean set(PlotPlayer player, Plot plot, String desc) { public boolean set(PlotPlayer<?> player, Plot plot, String desc) {
if (desc.isEmpty()) { if (desc.isEmpty()) {
PlotFlagRemoveEvent event = this.eventDispatcher.callFlagRemove(plot PlotFlagRemoveEvent event = this.eventDispatcher.callFlagRemove(plot
.getFlagContainer() .getFlagContainer()

View File

@ -115,7 +115,7 @@ public class Done extends SubCommand {
return true; return true;
} }
private void finish(Plot plot, PlotPlayer player, boolean success) { private void finish(Plot plot, PlotPlayer<?> player, boolean success) {
if (!success) { if (!success) {
player.sendMessage(TranslatableCaption.of("done.done_insufficient_complexity")); player.sendMessage(TranslatableCaption.of("done.done_insufficient_complexity"));
return; return;

View File

@ -51,7 +51,7 @@ public class Help extends Command {
} }
@Override @Override
public boolean canExecute(PlotPlayer player, boolean message) { public boolean canExecute(PlotPlayer<?> player, boolean message) {
return true; return true;
} }
@ -90,7 +90,7 @@ public class Help extends Command {
} }
public CompletableFuture<Boolean> displayHelp( public CompletableFuture<Boolean> displayHelp(
final PlotPlayer player, final String catRaw, final PlotPlayer<?> player, final String catRaw,
final int page final int page
) { ) {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {

View File

@ -223,7 +223,7 @@ public class HomeCommand extends Command {
} }
@Override @Override
public Collection<Command> tab(PlotPlayer player, String[] args, boolean space) { public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
final List<Command> completions = new ArrayList<>(); final List<Command> completions = new ArrayList<>();
switch (args.length - 1) { switch (args.length - 1) {
case 0: case 0:

View File

@ -153,7 +153,7 @@ public class Kick extends SubCommand {
} }
@Override @Override
public Collection<Command> tab(final PlotPlayer player, final String[] args, final boolean space) { public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
Location location = player.getLocation(); Location location = player.getLocation();
Plot plot = location.getPlotAbs(); Plot plot = location.getPlotAbs();
if (plot == null) { if (plot == null) {

View File

@ -86,7 +86,7 @@ public class ListCmd extends SubCommand {
this.econHandler = econHandler; this.econHandler = econHandler;
} }
private String[] getArgumentList(PlotPlayer player) { private String[] getArgumentList(PlotPlayer<?> player) {
List<String> args = new ArrayList<>(); List<String> args = new ArrayList<>();
if (this.econHandler != null && Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) { if (this.econHandler != null && Permissions.hasPermission(player, Permission.PERMISSION_LIST_FOR_SALE)) {
args.add("forsale"); args.add("forsale");

View File

@ -348,7 +348,7 @@ public class MainCommand extends Command {
} }
@Override @Override
public boolean canExecute(PlotPlayer player, boolean message) { public boolean canExecute(PlotPlayer<?> player, boolean message) {
return true; return true;
} }

View File

@ -260,7 +260,7 @@ public class Merge extends SubCommand {
java.util.Set<UUID> uuids = adjacent.getOwners(); java.util.Set<UUID> uuids = adjacent.getOwners();
boolean isOnline = false; boolean isOnline = false;
for (final UUID owner : uuids) { for (final UUID owner : uuids) {
final PlotPlayer accepter = PlotSquared.platform().playerManager().getPlayerIfExists(owner); final PlotPlayer<?> accepter = PlotSquared.platform().playerManager().getPlayerIfExists(owner);
if (!force && accepter == null) { if (!force && accepter == null) {
continue; continue;
} }

View File

@ -68,7 +68,7 @@ public class Owner extends SetCommand {
} }
@Override @Override
public boolean set(final PlotPlayer player, final Plot plot, String value) { public boolean set(final PlotPlayer<?> player, final Plot plot, String value) {
if (value == null || value.isEmpty()) { if (value == null || value.isEmpty()) {
player.sendMessage(TranslatableCaption.of("owner.set_owner_missing_player")); player.sendMessage(TranslatableCaption.of("owner.set_owner_missing_player"));
player.sendMessage( player.sendMessage(

View File

@ -136,7 +136,7 @@ public class Remove extends SubCommand {
} }
@Override @Override
public Collection<Command> tab(final PlotPlayer player, final String[] args, final boolean space) { public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
Location location = player.getLocation(); Location location = player.getLocation();
Plot plot = location.getPlotAbs(); Plot plot = location.getPlotAbs();
if (plot == null) { if (plot == null) {

View File

@ -83,7 +83,7 @@ public class Set extends SubCommand {
} }
@Override @Override
public boolean set(PlotPlayer player, final Plot plot, String value) { public boolean set(PlotPlayer<?> player, final Plot plot, String value) {
final PlotArea plotArea = player.getLocation().getPlotArea(); final PlotArea plotArea = player.getLocation().getPlotArea();
if (plotArea == null) { if (plotArea == null) {
return false; return false;
@ -190,7 +190,7 @@ public class Set extends SubCommand {
@Override @Override
public Collection<Command> tab( public Collection<Command> tab(
final PlotPlayer player, final String[] args, final PlotPlayer<?> player, final String[] args,
final boolean space final boolean space
) { ) {
return TabCompletions.completePatterns(StringMan.join(args, ",")); return TabCompletions.completePatterns(StringMan.join(args, ","));
@ -198,7 +198,7 @@ public class Set extends SubCommand {
}; };
} }
public boolean noArgs(PlotPlayer player) { public boolean noArgs(PlotPlayer<?> player) {
ArrayList<String> newValues = new ArrayList<>(Arrays.asList("biome", "alias", "home")); ArrayList<String> newValues = new ArrayList<>(Arrays.asList("biome", "alias", "home"));
Plot plot = player.getCurrentPlot(); Plot plot = player.getCurrentPlot();
if (plot != null) { if (plot != null) {

View File

@ -70,6 +70,6 @@ public abstract class SetCommand extends SubCommand {
return set(player, plot, StringMan.join(args, " ")); return set(player, plot, StringMan.join(args, " "));
} }
public abstract boolean set(PlotPlayer player, Plot plot, String value); public abstract boolean set(PlotPlayer<?> player, Plot plot, String value);
} }

View File

@ -41,7 +41,7 @@ import net.kyori.adventure.text.minimessage.Template;
public class SetHome extends SetCommand { public class SetHome extends SetCommand {
@Override @Override
public boolean set(PlotPlayer player, Plot plot, String value) { public boolean set(PlotPlayer<?> player, Plot plot, String value) {
switch (value.toLowerCase()) { switch (value.toLowerCase()) {
case "unset": case "unset":
case "reset": case "reset":

View File

@ -118,7 +118,7 @@ public class Setup extends SubCommand {
} }
@Override @Override
public Collection<Command> tab(PlotPlayer player, String[] args, boolean space) { public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
SetupProcess process; SetupProcess process;
try (final MetaDataAccess<SetupProcess> metaDataAccess = try (final MetaDataAccess<SetupProcess> metaDataAccess =
player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_SETUP)) { player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_SETUP)) {

View File

@ -166,7 +166,7 @@ public class Trust extends Command {
} }
@Override @Override
public Collection<Command> tab(final PlotPlayer player, final String[] args, final boolean space) { public Collection<Command> tab(final PlotPlayer<?> player, final String[] args, final boolean space) {
return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList()); return TabCompletions.completePlayers(String.join(",", args).trim(), Collections.emptyList());
} }

View File

@ -73,7 +73,7 @@ public class Visit extends Command {
} }
private void visit( private void visit(
final @NonNull PlotPlayer player, final @NonNull PlotQuery query, final PlotArea sortByArea, final @NonNull PlotPlayer<?> player, final @NonNull PlotQuery query, final PlotArea sortByArea,
final RunnableVal3<Command, Runnable, Runnable> confirm, final RunnableVal2<Command, CommandResult> whenDone, int page final RunnableVal3<Command, Runnable, Runnable> confirm, final RunnableVal2<Command, CommandResult> whenDone, int page
) { ) {
// We get the query once, // We get the query once,
@ -311,7 +311,7 @@ public class Visit extends Command {
} }
@Override @Override
public Collection<Command> tab(PlotPlayer player, String[] args, boolean space) { public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean space) {
final List<Command> completions = new ArrayList<>(); final List<Command> completions = new ArrayList<>();
switch (args.length - 1) { switch (args.length - 1) {
case 0: case 0:

View File

@ -134,7 +134,7 @@ public class Config {
file.createNewFile(); file.createNewFile();
} }
try (PrintWriter writer = new PrintWriter(file)) { try (PrintWriter writer = new PrintWriter(file)) {
Object instance = root.newInstance(); Object instance = root.getDeclaredConstructor().newInstance();
save(writer, root, instance, 0); save(writer, root, instance, 0);
} }
} catch (Throwable e) { } catch (Throwable e) {
@ -184,7 +184,7 @@ public class Config {
return value != null ? value.toString() : "null"; return value != null ? value.toString() : "null";
} }
private static void save(PrintWriter writer, Class clazz, Object instance, int indent) { private static void save(PrintWriter writer, Class<?> clazz, Object instance, int indent) {
try { try {
String lineSeparator = System.lineSeparator(); String lineSeparator = System.lineSeparator();
String spacing = StringMan.repeat(" ", indent); String spacing = StringMan.repeat(" ", indent);
@ -204,9 +204,9 @@ public class Config {
if (value == null && field.getType() != ConfigBlock.class) { if (value == null && field.getType() != ConfigBlock.class) {
setAccessible(field); setAccessible(field);
Class<?>[] classes = clazz.getDeclaredClasses(); Class<?>[] classes = clazz.getDeclaredClasses();
for (Class current : classes) { for (Class<?> current : classes) {
if (StringMan.isEqual(current.getSimpleName(), field.getName())) { if (StringMan.isEqual(current.getSimpleName(), field.getName())) {
field.set(instance, current.newInstance()); field.set(instance, current.getDeclaredConstructor().newInstance());
break; break;
} }
} }
@ -235,12 +235,12 @@ public class Config {
Field instanceField = Field instanceField =
clazz.getDeclaredField(toFieldName(current.getSimpleName())); clazz.getDeclaredField(toFieldName(current.getSimpleName()));
setAccessible(instanceField); setAccessible(instanceField);
ConfigBlock value = (ConfigBlock) instanceField.get(instance); ConfigBlock value = (ConfigBlock<?>) instanceField.get(instance);
if (value == null) { if (value == null) {
value = new ConfigBlock(); value = new ConfigBlock();
instanceField.set(instance, value); instanceField.set(instance, value);
for (String blockName : blockNames.value()) { for (String blockName : blockNames.value()) {
value.put(blockName, current.newInstance()); value.put(blockName, current.getDeclaredConstructor().newInstance());
} }
} }
// Save each instance // Save each instance
@ -250,9 +250,8 @@ public class Config {
writer.write(spacing + " " + toNodeName(key) + ":" + lineSeparator); writer.write(spacing + " " + toNodeName(key) + ":" + lineSeparator);
save(writer, current, entry.getValue(), indent + 4); save(writer, current, entry.getValue(), indent + 4);
} }
continue;
} else { } else {
save(writer, current, current.newInstance(), indent + 2); save(writer, current, current.getDeclaredConstructor().newInstance(), indent + 2);
} }
} }
} catch (Throwable e) { } catch (Throwable e) {
@ -307,7 +306,7 @@ public class Config {
private static Object getInstance(String[] split, Class<?> root) { private static Object getInstance(String[] split, Class<?> root) {
try { try {
Class<?> clazz = root == null ? MethodHandles.lookup().lookupClass() : root; Class<?> clazz = root == null ? MethodHandles.lookup().lookupClass() : root;
Object instance = clazz.newInstance(); Object instance = clazz.getDeclaredConstructor().newInstance();
while (split.length > 0) { while (split.length > 0) {
if (split.length == 1) { if (split.length == 1) {
return instance; return instance;
@ -326,7 +325,7 @@ public class Config {
if (instanceField.getType() != ConfigBlock.class) { if (instanceField.getType() != ConfigBlock.class) {
Object value = instanceField.get(instance); Object value = instanceField.get(instance);
if (value == null) { if (value == null) {
value = found.newInstance(); value = found.getDeclaredConstructor().newInstance();
instanceField.set(instance, value); instanceField.set(instance, value);
} }
clazz = found; clazz = found;
@ -334,14 +333,14 @@ public class Config {
split = Arrays.copyOfRange(split, 1, split.length); split = Arrays.copyOfRange(split, 1, split.length);
continue; continue;
} }
ConfigBlock value = (ConfigBlock) instanceField.get(instance); ConfigBlock value = (ConfigBlock<?>) instanceField.get(instance);
if (value == null) { if (value == null) {
value = new ConfigBlock(); value = new ConfigBlock();
instanceField.set(instance, value); instanceField.set(instance, value);
} }
instance = value.get(split[1]); instance = value.get(split[1]);
if (instance == null) { if (instance == null) {
instance = found.newInstance(); instance = found.getDeclaredConstructor().newInstance();
value.put(split[1], instance); value.put(split[1], instance);
} }
clazz = found; clazz = found;
@ -352,7 +351,7 @@ public class Config {
if (found != null) { if (found != null) {
split = Arrays.copyOfRange(split, 1, split.length); split = Arrays.copyOfRange(split, 1, split.length);
clazz = found; clazz = found;
instance = clazz.newInstance(); instance = clazz.getDeclaredConstructor().newInstance();
continue; continue;
} }
return null; return null;

View File

@ -42,20 +42,20 @@ public class ConfigurationNode {
private final String constant; private final String constant;
private final Object defaultValue; private final Object defaultValue;
private final String description; private final String description;
private final ConfigurationUtil.SettingValue type; private final ConfigurationUtil.SettingValue<?> type;
private final Collection<String> suggestions; private final Collection<String> suggestions;
private Object value; private Object value;
public ConfigurationNode( public ConfigurationNode(
String constant, Object defaultValue, String description, String constant, Object defaultValue, String description,
ConfigurationUtil.SettingValue type ConfigurationUtil.SettingValue<?> type
) { ) {
this(constant, defaultValue, description, type, new ArrayList<>()); this(constant, defaultValue, description, type, new ArrayList<>());
} }
public ConfigurationNode( public ConfigurationNode(
String constant, Object defaultValue, String description, String constant, Object defaultValue, String description,
ConfigurationUtil.SettingValue type, Collection<String> suggestions ConfigurationUtil.SettingValue<?> type, Collection<String> suggestions
) { ) {
this.constant = constant; this.constant = constant;
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
@ -65,7 +65,7 @@ public class ConfigurationNode {
this.suggestions = suggestions; this.suggestions = suggestions;
} }
public ConfigurationUtil.SettingValue getType() { public ConfigurationUtil.SettingValue<?> getType() {
return this.type; return this.type;
} }

View File

@ -42,7 +42,7 @@ public class PlayerClaimPlotEvent extends PlotPlayerEvent implements Cancellable
* @param plot Plot that was claimed * @param plot Plot that was claimed
* @param schematic The schematic defined or null * @param schematic The schematic defined or null
*/ */
public PlayerClaimPlotEvent(PlotPlayer player, Plot plot, @Nullable String schematic) { public PlayerClaimPlotEvent(PlotPlayer<?> player, Plot plot, @Nullable String schematic) {
super(player, plot); super(player, plot);
this.schematic = schematic; this.schematic = schematic;
} }

View File

@ -36,7 +36,7 @@ public class PlayerEnterPlotEvent extends PlotPlayerEvent {
* @param player Player that entered the plot * @param player Player that entered the plot
* @param plot Plot that was entered * @param plot Plot that was entered
*/ */
public PlayerEnterPlotEvent(PlotPlayer player, Plot plot) { public PlayerEnterPlotEvent(PlotPlayer<?> player, Plot plot) {
super(player, plot); super(player, plot);
} }

View File

@ -39,7 +39,7 @@ public class PlayerLeavePlotEvent extends PlotPlayerEvent {
* @param player Player that left the plot * @param player Player that left the plot
* @param plot Plot that was left * @param plot Plot that was left
*/ */
public PlayerLeavePlotEvent(PlotPlayer player, Plot plot) { public PlayerLeavePlotEvent(PlotPlayer<?> player, Plot plot) {
super(player, plot); super(player, plot);
} }

View File

@ -32,7 +32,7 @@ import java.util.UUID;
public class PlayerPlotDeniedEvent extends PlotEvent { public class PlayerPlotDeniedEvent extends PlotEvent {
private final PlotPlayer initiator; private final PlotPlayer<?> initiator;
private final boolean added; private final boolean added;
private final UUID player; private final UUID player;
@ -44,7 +44,7 @@ public class PlayerPlotDeniedEvent extends PlotEvent {
* @param player Player that was denied/un-denied * @param player Player that was denied/un-denied
* @param added true of add to deny list, false if removed * @param added true of add to deny list, false if removed
*/ */
public PlayerPlotDeniedEvent(PlotPlayer initiator, Plot plot, UUID player, boolean added) { public PlayerPlotDeniedEvent(PlotPlayer<?> initiator, Plot plot, UUID player, boolean added) {
super(plot); super(plot);
this.initiator = initiator; this.initiator = initiator;
this.added = added; this.added = added;
@ -74,7 +74,7 @@ public class PlayerPlotDeniedEvent extends PlotEvent {
* *
* @return PlotPlayer * @return PlotPlayer
*/ */
public PlotPlayer getInitiator() { public PlotPlayer<?> getInitiator() {
return this.initiator; return this.initiator;
} }

View File

@ -35,7 +35,7 @@ import java.util.UUID;
*/ */
public class PlayerPlotHelperEvent extends PlotEvent { public class PlayerPlotHelperEvent extends PlotEvent {
private final PlotPlayer initiator; private final PlotPlayer<?> initiator;
private final boolean added; private final boolean added;
private final UUID player; private final UUID player;
@ -47,7 +47,7 @@ public class PlayerPlotHelperEvent extends PlotEvent {
* @param player Player that was added/removed from the helper list * @param player Player that was added/removed from the helper list
* @param added true of the player was added, false if the player was removed * @param added true of the player was added, false if the player was removed
*/ */
public PlayerPlotHelperEvent(PlotPlayer initiator, Plot plot, UUID player, boolean added) { public PlayerPlotHelperEvent(PlotPlayer<?> initiator, Plot plot, UUID player, boolean added) {
super(plot); super(plot);
this.initiator = initiator; this.initiator = initiator;
this.added = added; this.added = added;
@ -77,7 +77,7 @@ public class PlayerPlotHelperEvent extends PlotEvent {
* *
* @return PlotPlayer * @return PlotPlayer
*/ */
public PlotPlayer getInitiator() { public PlotPlayer<?> getInitiator() {
return this.initiator; return this.initiator;
} }

View File

@ -32,7 +32,7 @@ import java.util.UUID;
public class PlayerPlotTrustedEvent extends PlotEvent { public class PlayerPlotTrustedEvent extends PlotEvent {
private final PlotPlayer initiator; private final PlotPlayer<?> initiator;
private final boolean added; private final boolean added;
private final UUID player; private final UUID player;
@ -44,7 +44,7 @@ public class PlayerPlotTrustedEvent extends PlotEvent {
* @param player Player that was added/removed from the trusted list * @param player Player that was added/removed from the trusted list
* @param added true of the player was added, false if the player was removed * @param added true of the player was added, false if the player was removed
*/ */
public PlayerPlotTrustedEvent(PlotPlayer initiator, Plot plot, UUID player, boolean added) { public PlayerPlotTrustedEvent(PlotPlayer<?> initiator, Plot plot, UUID player, boolean added) {
super(plot); super(plot);
this.initiator = initiator; this.initiator = initiator;
this.added = added; this.added = added;
@ -74,7 +74,7 @@ public class PlayerPlotTrustedEvent extends PlotEvent {
* *
* @return PlotPlayer * @return PlotPlayer
*/ */
public PlotPlayer getInitiator() { public PlotPlayer<?> getInitiator() {
return this.initiator; return this.initiator;
} }

View File

@ -44,7 +44,7 @@ public class PlayerTeleportToPlotEvent extends PlotPlayerEvent implements Cancel
* @param from Start location * @param from Start location
* @param plot Plot to which the player was teleported * @param plot Plot to which the player was teleported
*/ */
public PlayerTeleportToPlotEvent(PlotPlayer player, Location from, Plot plot) { public PlayerTeleportToPlotEvent(PlotPlayer<?> player, Location from, Plot plot) {
super(player, plot); super(player, plot);
this.from = from; this.from = from;
} }

View File

@ -34,12 +34,12 @@ import java.util.UUID;
public class PlotChangeOwnerEvent extends PlotEvent implements CancellablePlotEvent { public class PlotChangeOwnerEvent extends PlotEvent implements CancellablePlotEvent {
private final PlotPlayer initiator; private final PlotPlayer<?> initiator;
@Nullable @Nullable
private final UUID oldOwner; private final UUID oldOwner;
@Nullable @Nullable
private UUID newOwner; private UUID newOwner;
private boolean hasOldOwner; private final boolean hasOldOwner;
private Result eventResult; private Result eventResult;
/** /**
@ -52,7 +52,7 @@ public class PlotChangeOwnerEvent extends PlotEvent implements CancellablePlotEv
* @param hasOldOwner If the plot has an old owner * @param hasOldOwner If the plot has an old owner
*/ */
public PlotChangeOwnerEvent( public PlotChangeOwnerEvent(
PlotPlayer initiator, Plot plot, @Nullable UUID oldOwner, PlotPlayer<?> initiator, Plot plot, @Nullable UUID oldOwner,
@Nullable UUID newOwner, boolean hasOldOwner @Nullable UUID newOwner, boolean hasOldOwner
) { ) {
super(plot); super(plot);
@ -81,11 +81,11 @@ public class PlotChangeOwnerEvent extends PlotEvent implements CancellablePlotEv
} }
/** /**
* Get the change-owner initator * Get the change-owner initiator
* *
* @return Player * @return Player
*/ */
public PlotPlayer getInitiator() { public PlotPlayer<?> getInitiator() {
return this.initiator; return this.initiator;
} }

View File

@ -40,7 +40,7 @@ public final class PlotMergeEvent extends PlotPlayerEvent implements Cancellable
private Direction dir; private Direction dir;
private int max; private int max;
private Result eventResult; private Result eventResult;
private PlotPlayer player; private final PlotPlayer<?> player;
/** /**
* PlotMergeEvent: Called when plots are merged * PlotMergeEvent: Called when plots are merged
@ -93,7 +93,7 @@ public final class PlotMergeEvent extends PlotPlayerEvent implements Cancellable
this.max = max; this.max = max;
} }
public PlotPlayer getPlayer() { public PlotPlayer<?> getPlayer() {
return this.player; return this.player;
} }

View File

@ -30,14 +30,14 @@ import com.plotsquared.core.plot.Plot;
public abstract class PlotPlayerEvent extends PlotEvent { public abstract class PlotPlayerEvent extends PlotEvent {
private final PlotPlayer plotPlayer; private final PlotPlayer<?> plotPlayer;
public PlotPlayerEvent(PlotPlayer plotPlayer, Plot plot) { public PlotPlayerEvent(PlotPlayer<?> plotPlayer, Plot plot) {
super(plot); super(plot);
this.plotPlayer = plotPlayer; this.plotPlayer = plotPlayer;
} }
public PlotPlayer getPlotPlayer() { public PlotPlayer<?> getPlotPlayer() {
return this.plotPlayer; return this.plotPlayer;
} }

View File

@ -32,7 +32,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
public class PlotRateEvent extends PlotEvent implements CancellablePlotEvent { public class PlotRateEvent extends PlotEvent implements CancellablePlotEvent {
private final PlotPlayer rater; private final PlotPlayer<?> rater;
@Nullable @Nullable
private Rating rating; private Rating rating;
private Result eventResult; private Result eventResult;
@ -44,13 +44,13 @@ public class PlotRateEvent extends PlotEvent implements CancellablePlotEvent {
* @param rating The rating being given * @param rating The rating being given
* @param plot The plot being rated * @param plot The plot being rated
*/ */
public PlotRateEvent(PlotPlayer rater, @Nullable Rating rating, Plot plot) { public PlotRateEvent(PlotPlayer<?> rater, @Nullable Rating rating, Plot plot) {
super(plot); super(plot);
this.rater = rater; this.rater = rater;
this.rating = rating; this.rating = rating;
} }
public PlotPlayer getRater() { public PlotPlayer<?> getRater() {
return this.rater; return this.rater;
} }

View File

@ -173,7 +173,7 @@ public class PlotListener {
if (plot.getFlag(NotifyEnterFlag.class)) { if (plot.getFlag(NotifyEnterFlag.class)) {
if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) { if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) {
for (UUID uuid : plot.getOwners()) { for (UUID uuid : plot.getOwners()) {
final PlotPlayer owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid); final PlotPlayer<?> owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid);
if (owner != null && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) { if (owner != null && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("notification.notify_enter"), TranslatableCaption.of("notification.notify_enter"),
@ -381,7 +381,7 @@ public class PlotListener {
if (plot.getFlag(NotifyLeaveFlag.class)) { if (plot.getFlag(NotifyLeaveFlag.class)) {
if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) { if (!Permissions.hasPermission(player, "plots.flag.notify-enter.bypass")) {
for (UUID uuid : plot.getOwners()) { for (UUID uuid : plot.getOwners()) {
final PlotPlayer owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid); final PlotPlayer<?> owner = PlotSquared.platform().playerManager().getPlayerIfExists(uuid);
if ((owner != null) && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) { if ((owner != null) && !owner.getUUID().equals(player.getUUID()) && owner.canSee(player)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("notification.notify_leave"), TranslatableCaption.of("notification.notify_leave"),

View File

@ -41,7 +41,7 @@ import java.util.Map;
*/ */
public final class MetaDataKey<T> { public final class MetaDataKey<T> {
private static final Map<String, MetaDataKey> keyMap = new HashMap<>(); private static final Map<String, MetaDataKey<?>> keyMap = new HashMap<>();
private static final Object keyMetaData = new Object(); private static final Object keyMetaData = new Object();
private final String key; private final String key;
@ -82,7 +82,7 @@ public final class MetaDataKey<T> {
if (o == null || getClass() != o.getClass()) { if (o == null || getClass() != o.getClass()) {
return false; return false;
} }
final MetaDataKey lockKey = (MetaDataKey) o; final MetaDataKey<?> lockKey = (MetaDataKey<?>) o;
return Objects.equal(this.key, lockKey.key); return Objects.equal(this.key, lockKey.key);
} }

View File

@ -121,6 +121,7 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
*/ */
public class Plot { public class Plot {
public static final int MAX_HEIGHT = 256; public static final int MAX_HEIGHT = 256;
private static final Logger logger = LoggerFactory.getLogger("P2/" + Plot.class.getSimpleName()); private static final Logger logger = LoggerFactory.getLogger("P2/" + Plot.class.getSimpleName());
@ -2134,7 +2135,7 @@ public class Plot {
* @param player the claiming player * @param player the claiming player
* @return if the given player can claim the plot * @return if the given player can claim the plot
*/ */
public boolean canClaim(@NonNull PlotPlayer player) { public boolean canClaim(@NonNull PlotPlayer<?> player) {
PlotCluster cluster = this.getCluster(); PlotCluster cluster = this.getCluster();
if (cluster != null) { if (cluster != null) {
if (!cluster.isAdded(player.getUUID()) && !Permissions.hasPermission(player, "plots.admin.command.claim")) { if (!cluster.isAdded(player.getUUID()) && !Permissions.hasPermission(player, "plots.admin.command.claim")) {

View File

@ -716,7 +716,7 @@ public abstract class PlotArea {
* @deprecated Use {@link #getPlots(UUID)} * @deprecated Use {@link #getPlots(UUID)}
*/ */
@Deprecated @Deprecated
public Set<Plot> getPlots(final @NonNull PlotPlayer player) { public Set<Plot> getPlots(final @NonNull PlotPlayer<?> player) {
return getPlots(player.getUUID()); return getPlots(player.getUUID());
} }
@ -872,7 +872,7 @@ public abstract class PlotArea {
return this.plots.put(plot.getId(), plot) == null; return this.plots.put(plot.getId(), plot) == null;
} }
public Plot getNextFreePlot(final PlotPlayer player, @Nullable PlotId start) { public Plot getNextFreePlot(final PlotPlayer<?> player, @Nullable PlotId start) {
int plots; int plots;
PlotId center; PlotId center;
PlotId min = getMin(); PlotId min = getMin();
@ -968,7 +968,7 @@ public abstract class PlotArea {
} }
public @Nullable List<Plot> canClaim( public @Nullable List<Plot> canClaim(
final @Nullable PlotPlayer player, final @NonNull PlotId pos1, final @Nullable PlotPlayer<?> player, final @NonNull PlotId pos1,
final @NonNull PlotId pos2 final @NonNull PlotId pos2
) { ) {
if (pos1.getX() == pos2.getX() && pos1.getY() == pos2.getY()) { if (pos1.getX() == pos2.getX() && pos1.getY() == pos2.getY()) {

View File

@ -210,6 +210,11 @@ public abstract class PlotManager {
Template.zipAll(plotArea.getWorldName(), files); Template.zipAll(plotArea.getWorldName(), files);
} }
/**
* @return the world height
* @deprecated In favor of custom world heights within 1.17 and therefore scheduled for removal without replacement
*/
@Deprecated
public int getWorldHeight() { public int getWorldHeight() {
return 255; return 255;
} }

View File

@ -55,7 +55,7 @@ public class DenyTeleportFlag extends PlotFlag<DenyTeleportFlag.DeniedGroup, Den
); );
} }
public static boolean allowsTeleport(PlotPlayer player, Plot plot) { public static boolean allowsTeleport(PlotPlayer<?> player, Plot plot) {
final DeniedGroup value = plot.getFlag(DenyTeleportFlag.class); final DeniedGroup value = plot.getFlag(DenyTeleportFlag.class);
if (value == DeniedGroup.NONE) { if (value == DeniedGroup.NONE) {
return true; return true;

View File

@ -89,7 +89,7 @@ public class ChunkQueueCoordinator extends ScopedQueueCoordinator {
@Override @Override
public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) { public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) {
this.storeCache(x, y, z, pattern.apply(BlockVector3.at(x, y, z)).toImmutableState()); this.storeCache(x, y, z, pattern.applyBlock(BlockVector3.at(x, y, z)).toImmutableState());
return true; return true;
} }

View File

@ -82,7 +82,7 @@ public class LocationOffsetDelegateQueueCoordinator extends DelegateQueueCoordin
@Override @Override
public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) { public boolean setBlock(int x, int y, int z, @NonNull Pattern pattern) {
final BlockVector3 blockVector3 = BlockVector3.at(x + blockX, y, z + blockZ); final BlockVector3 blockVector3 = BlockVector3.at(x + blockX, y, z + blockZ);
return this.setBlock(x, y, z, pattern.apply(blockVector3)); return this.setBlock(x, y, z, pattern.applyBlock(blockVector3));
} }
@Override @Override

View File

@ -199,6 +199,8 @@ public abstract class QueueCoordinator {
* @param z z coordinate * @param z z coordinate
* @param biome biome * @param biome biome
* @return success or not * @return success or not
*
* @deprecated Biomes now take XYZ, see {@code setBiome int x, int y, int z}
*/ */
@Deprecated @Deprecated
public abstract boolean setBiome(int x, int z, @NonNull BiomeType biome); public abstract boolean setBiome(int x, int z, @NonNull BiomeType biome);

View File

@ -101,6 +101,6 @@ public abstract class ChunkManager {
} }
@Deprecated @Deprecated
public abstract CompletableFuture loadChunk(String world, BlockVector2 loc, boolean force); public abstract CompletableFuture<?> loadChunk(String world, BlockVector2 loc, boolean force);
} }

View File

@ -43,7 +43,7 @@ public abstract class InventoryUtil {
final PlotItemStack item final PlotItemStack item
); );
public abstract PlotItemStack[] getItems(final PlotPlayer player); public abstract PlotItemStack[] getItems(final PlotPlayer<?> player);
public abstract boolean isOpen(final PlotInventory plotInventory); public abstract boolean isOpen(final PlotInventory plotInventory);

View File

@ -54,12 +54,12 @@ public class PatternUtil {
if (pattern instanceof BlockPattern || pattern instanceof RandomPattern if (pattern instanceof BlockPattern || pattern instanceof RandomPattern
|| pattern instanceof BlockState || pattern instanceof BlockType || pattern instanceof BlockState || pattern instanceof BlockType
|| pattern instanceof BaseBlock) { || pattern instanceof BaseBlock) {
return pattern.apply(BlockVector3.ZERO); return pattern.applyBlock(BlockVector3.ZERO);
} }
return pattern.apply(BlockVector3.at(x, y, z)); return pattern.applyBlock(BlockVector3.at(x, y, z));
} }
public static Pattern parse(PlotPlayer plotPlayer, String input) { public static Pattern parse(PlotPlayer<?> plotPlayer, String input) {
return parse(plotPlayer, input, true); return parse(plotPlayer, input, true);
} }
@ -71,7 +71,7 @@ public class PatternUtil {
return new ArrayList<>(); return new ArrayList<>();
} }
public static Pattern parse(PlotPlayer plotPlayer, String input, boolean allowLegacy) { public static Pattern parse(PlotPlayer<?> plotPlayer, String input, boolean allowLegacy) {
ParserContext context = new ParserContext(); ParserContext context = new ParserContext();
if (plotPlayer != null) { if (plotPlayer != null) {
Actor actor = plotPlayer.toActor(); Actor actor = plotPlayer.toActor();

View File

@ -100,7 +100,7 @@ public class ReflectionUtils {
* @param clazz class * @param clazz class
* @return RefClass based on passed class * @return RefClass based on passed class
*/ */
public static RefClass getRefClass(Class clazz) { public static RefClass getRefClass(Class<?> clazz) {
return new RefClass(clazz); return new RefClass(clazz);
} }
@ -133,11 +133,11 @@ public class ReflectionUtils {
* @throws NoSuchMethodException if method not found * @throws NoSuchMethodException if method not found
*/ */
public RefMethod getMethod(String name, Object... types) throws NoSuchMethodException { public RefMethod getMethod(String name, Object... types) throws NoSuchMethodException {
Class[] classes = new Class[types.length]; Class<?>[] classes = new Class[types.length];
int i = 0; int i = 0;
for (Object e : types) { for (Object e : types) {
if (e instanceof Class) { if (e instanceof Class) {
classes[i++] = (Class) e; classes[i++] = (Class<?>) e;
} else if (e instanceof RefClass) { } else if (e instanceof RefClass) {
classes[i++] = ((RefClass) e).getRealClass(); classes[i++] = ((RefClass) e).getRealClass();
} else { } else {
@ -232,9 +232,9 @@ public class ReflectionUtils {
*/ */
public static class RefConstructor { public static class RefConstructor {
private final Constructor constructor; private final Constructor<?> constructor;
private RefConstructor(Constructor constructor) { private RefConstructor(Constructor<?> constructor) {
this.constructor = constructor; this.constructor = constructor;
constructor.setAccessible(true); constructor.setAccessible(true);
} }

View File

@ -312,7 +312,7 @@ public class StringMan {
return null; return null;
} }
startsWith = startsWith.toLowerCase(); startsWith = startsWith.toLowerCase();
Iterator iterator = col.iterator(); Iterator<?> iterator = col.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
Object item = iterator.next(); Object item = iterator.next();
if (item == null || !item.toString().toLowerCase().startsWith(startsWith)) { if (item == null || !item.toString().toLowerCase().startsWith(startsWith)) {

View File

@ -36,13 +36,13 @@ public class HelpMenu {
private static final int PER_PAGE = 5; private static final int PER_PAGE = 5;
private final PlotPlayer commandCaller; private final PlotPlayer<?> commandCaller;
private HelpPage page = new HelpPage(CommandCategory.INFO, 0, 0); private HelpPage page = new HelpPage(CommandCategory.INFO, 0, 0);
private int maxPage; private int maxPage;
private CommandCategory commandCategory; private CommandCategory commandCategory;
private List<Command> commands; private List<Command> commands;
public HelpMenu(PlotPlayer commandCaller) { public HelpMenu(PlotPlayer<?> commandCaller) {
this.commandCaller = commandCaller; this.commandCaller = commandCaller;
} }

View File

@ -51,7 +51,7 @@ public class HelpPage {
this.maxTemplate = Template.of("max", String.valueOf(maxPages + 1)); this.maxTemplate = Template.of("max", String.valueOf(maxPages + 1));
} }
public void render(PlotPlayer player) { public void render(PlotPlayer<?> player) {
if (this.helpObjects.size() < 1) { if (this.helpObjects.size() < 1) {
player.sendMessage(TranslatableCaption.of("invalid.not_valid_number"), Template.of("value", "(0)")); player.sendMessage(TranslatableCaption.of("invalid.not_valid_number"), Template.of("value", "(0)"));
} else { } else {

View File

@ -197,7 +197,7 @@ public final class PlotQuery implements Iterable<Plot> {
* @param owner Owner * @param owner Owner
* @return The query instance * @return The query instance
*/ */
public @NonNull PlotQuery ownedBy(final @NonNull PlotPlayer owner) { public @NonNull PlotQuery ownedBy(final @NonNull PlotPlayer<?> owner) {
Preconditions.checkNotNull(owner, "Owner may not be null"); Preconditions.checkNotNull(owner, "Owner may not be null");
return this.addFilter(new OwnerFilter(owner.getUUID())); return this.addFilter(new OwnerFilter(owner.getUUID()));
} }