From 17cbcf394c6431a36fde1f722af735a817643743 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 8 Jun 2022 21:09:55 +0100 Subject: [PATCH] Address deprecations for removal throughout the plugin --- .../plotsquared/bukkit/util/BukkitWorld.java | 9 -- .../bukkit/util/fawe/FaweRegionManager.java | 5 - .../com/plotsquared/core/command/Chat.java | 63 -------- .../com/plotsquared/core/command/Load.java | 37 ----- .../plotsquared/core/command/MainCommand.java | 2 - .../com/plotsquared/core/command/Save.java | 141 ------------------ .../core/events/PlayerAutoPlotEvent.java | 32 ---- .../events/PlayerTeleportToPlotEvent.java | 9 -- .../core/permissions/Permission.java | 4 - .../java/com/plotsquared/core/plot/Plot.java | 16 -- .../com/plotsquared/core/plot/PlotArea.java | 31 ---- .../plotsquared/core/plot/PlotManager.java | 9 -- .../com/plotsquared/core/plot/PlotWorld.java | 9 -- .../core/plot/expiration/ExpireManager.java | 5 - .../core/plot/flag/FlagContainer.java | 9 -- .../plotsquared/core/plot/flag/PlotFlag.java | 9 -- .../com/plotsquared/core/util/MainUtil.java | 89 ----------- .../plotsquared/core/util/PlayerManager.java | 50 ------- .../com/plotsquared/core/util/RegExUtil.java | 41 ----- .../plotsquared/core/util/RegionManager.java | 11 -- .../com/plotsquared/core/util/RegionUtil.java | 6 - .../plotsquared/core/util/TabCompletions.java | 55 ------- .../com/plotsquared/core/util/WorldUtil.java | 21 --- .../plotsquared/core/uuid/UUIDMapping.java | 8 - 24 files changed, 671 deletions(-) delete mode 100644 Core/src/main/java/com/plotsquared/core/command/Chat.java delete mode 100644 Core/src/main/java/com/plotsquared/core/command/Save.java delete mode 100644 Core/src/main/java/com/plotsquared/core/util/MainUtil.java delete mode 100644 Core/src/main/java/com/plotsquared/core/util/RegExUtil.java 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 3fd32c9a1..9ab17a3f7 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitWorld.java @@ -31,7 +31,6 @@ import org.bukkit.Bukkit; import org.checkerframework.checker.nullness.qual.NonNull; import java.util.Map; -import java.util.Objects; public class BukkitWorld implements World { @@ -140,14 +139,6 @@ public class BukkitWorld implements World { return world.hashCode(); } - /** - * @deprecated This method is not meant to be invoked or overridden, with no replacement. - */ - @Deprecated(forRemoval = true, since = "6.6.0") - protected boolean canEqual(final Object other) { - return other instanceof BukkitWorld; - } - public String toString() { return "BukkitWorld(world=" + this.world + ")"; } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/fawe/FaweRegionManager.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/fawe/FaweRegionManager.java index 7c7cda737..d848f9464 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/fawe/FaweRegionManager.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/fawe/FaweRegionManager.java @@ -105,11 +105,6 @@ public class FaweRegionManager extends BukkitRegionManager { delegate.swap(pos1, pos2, swapPos, whenDone); } - @Override - public void setBiome(CuboidRegion region, int extendBiome, BiomeType biome, String world, Runnable whenDone) { - delegate.setBiome(region, extendBiome, biome, world, whenDone); - } - @Override public void setBiome(CuboidRegion region, int extendBiome, BiomeType biome, PlotArea area, Runnable whenDone) { delegate.setBiome(region, extendBiome, biome, area.getWorldName(), whenDone); diff --git a/Core/src/main/java/com/plotsquared/core/command/Chat.java b/Core/src/main/java/com/plotsquared/core/command/Chat.java deleted file mode 100644 index ced1cd68f..000000000 --- a/Core/src/main/java/com/plotsquared/core/command/Chat.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * _____ _ _ _____ _ - * | __ \| | | | / ____| | | - * | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| | - * | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` | - * | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| | - * |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_| - * | | - * |_| - * PlotSquared plot management system for Minecraft - * Copyright (C) 2014 - 2022 IntellectualSites - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.plotsquared.core.command; - -import com.plotsquared.core.configuration.caption.TranslatableCaption; -import com.plotsquared.core.player.PlotPlayer; -import com.plotsquared.core.plot.PlotArea; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.minimessage.tag.Tag; -import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; - -/** - * @deprecated In favor of "/plot toggle chat" and - * scheduled for removal within the next major release. - */ -@Deprecated(forRemoval = true, since = "6.0.0") -@CommandDeclaration(command = "chat", - usage = "/plot chat", - permission = "plots.chat", - category = CommandCategory.CHAT, - requiredType = RequiredType.PLAYER) -public class Chat extends SubCommand { - - @Override - public boolean onCommand(PlotPlayer player, String[] args) { - PlotArea area = player.getPlotAreaAbs(); - check(area, TranslatableCaption.of("errors.not_in_plot_world")); - player.sendMessage( - TranslatableCaption.of("errors.deprecated_commands"), - TagResolver.resolver("replacement", Tag.inserting(Component.text("/plot toggle chat"))) - ); - if (player.getPlotAreaAbs().isForcingPlotChat()) { - player.sendMessage(TranslatableCaption.of("chat.plot_chat_forced")); - return true; - } - MainCommand.getInstance().toggle.chat(this, player, args, null, null); - return true; - } - -} diff --git a/Core/src/main/java/com/plotsquared/core/command/Load.java b/Core/src/main/java/com/plotsquared/core/command/Load.java index b3342afe1..8dc55df40 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Load.java +++ b/Core/src/main/java/com/plotsquared/core/command/Load.java @@ -229,41 +229,4 @@ public class Load extends SubCommand { } } - /** - * @deprecated Use {@link TimeUtil#secToTime(long)} - */ - @Deprecated(forRemoval = true, since = "6.6.2") - public String secToTime(long time) { - StringBuilder toreturn = new StringBuilder(); - if (time >= 33868800) { - int years = (int) (time / 33868800); - time -= years * 33868800; - toreturn.append(years).append("y "); - } - if (time >= 604800) { - int weeks = (int) (time / 604800); - time -= weeks * 604800; - toreturn.append(weeks).append("w "); - } - if (time >= 86400) { - int days = (int) (time / 86400); - time -= days * 86400; - toreturn.append(days).append("d "); - } - if (time >= 3600) { - int hours = (int) (time / 3600); - time -= hours * 3600; - toreturn.append(hours).append("h "); - } - if (time >= 60) { - int minutes = (int) (time / 60); - time -= minutes * 60; - toreturn.append(minutes).append("m "); - } - if (toreturn.length() == 0 || (time > 0)) { - toreturn.append(time).append("s "); - } - return toreturn.toString().trim(); - } - } diff --git a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java index 5e21fef4e..15fe81a4b 100644 --- a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java @@ -82,7 +82,6 @@ public class MainCommand extends Command { commands.add(Buy.class); if (Settings.Web.LEGACY_WEBINTERFACE) { LOGGER.warn("Legacy webinterface is used. Please note that it will be removed in future."); - commands.add(Save.class); } commands.add(Load.class); commands.add(Confirm.class); @@ -131,7 +130,6 @@ public class MainCommand extends Command { commands.add(Move.class); commands.add(Condense.class); commands.add(Copy.class); - commands.add(Chat.class); commands.add(Trim.class); commands.add(Done.class); commands.add(Continue.class); diff --git a/Core/src/main/java/com/plotsquared/core/command/Save.java b/Core/src/main/java/com/plotsquared/core/command/Save.java deleted file mode 100644 index 8ce2e4dda..000000000 --- a/Core/src/main/java/com/plotsquared/core/command/Save.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * _____ _ _ _____ _ - * | __ \| | | | / ____| | | - * | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| | - * | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` | - * | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| | - * |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_| - * | | - * |_| - * PlotSquared plot management system for Minecraft - * Copyright (C) 2014 - 2022 IntellectualSites - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.plotsquared.core.command; - -import com.google.inject.Inject; -import com.plotsquared.core.configuration.caption.TranslatableCaption; -import com.plotsquared.core.location.Location; -import com.plotsquared.core.permissions.Permission; -import com.plotsquared.core.player.MetaDataAccess; -import com.plotsquared.core.player.PlayerMetaDataKeys; -import com.plotsquared.core.player.PlotPlayer; -import com.plotsquared.core.plot.Plot; -import com.plotsquared.core.plot.PlotId; -import com.plotsquared.core.plot.world.PlotAreaManager; -import com.plotsquared.core.util.Permissions; -import com.plotsquared.core.util.SchematicHandler; -import com.plotsquared.core.util.task.RunnableVal; -import com.plotsquared.core.util.task.TaskManager; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.minimessage.tag.Tag; -import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; -import org.checkerframework.checker.nullness.qual.NonNull; - -import java.net.URL; -import java.util.List; -import java.util.UUID; - -/** - * @deprecated In favor of "/plot download" (Arkitektonika) and scheduled - * for removal within the next major release. - */ -@Deprecated(forRemoval = true, since = "6.0.9") -@CommandDeclaration(command = "save", - category = CommandCategory.SCHEMATIC, - requiredType = RequiredType.NONE, - permission = "plots.save") -public class Save extends SubCommand { - - private final PlotAreaManager plotAreaManager; - private final SchematicHandler schematicHandler; - - @Inject - public Save( - final @NonNull PlotAreaManager plotAreaManager, - final @NonNull SchematicHandler schematicHandler - ) { - this.plotAreaManager = plotAreaManager; - this.schematicHandler = schematicHandler; - } - - @Override - public boolean onCommand(final PlotPlayer player, final String[] args) { - final String world = player.getLocation().getWorldName(); - if (!this.plotAreaManager.hasPlotArea(world)) { - player.sendMessage(TranslatableCaption.of("errors.not_in_plot_world")); - return false; - } - final Plot plot = player.getCurrentPlot(); - if (plot == null) { - player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); - return false; - } - if (!plot.hasOwner()) { - player.sendMessage(TranslatableCaption.of("info.plot_unowned")); - return false; - } - if (plot.getVolume() > Integer.MAX_VALUE) { - player.sendMessage(TranslatableCaption.of("schematics.schematic_too_large")); - return false; - } - if (!plot.isOwner(player.getUUID()) && !Permissions - .hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_SAVE)) { - player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); - return false; - } - if (plot.getRunning() > 0) { - player.sendMessage(TranslatableCaption.of("errors.wait_for_timer")); - return false; - } - plot.addRunning(); - this.schematicHandler.getCompoundTag(plot) - .whenComplete((compoundTag, throwable) -> { - TaskManager.runTaskAsync(() -> { - String time = (System.currentTimeMillis() / 1000) + ""; - Location[] corners = plot.getCorners(); - corners[0] = corners[0].withY(plot.getArea().getMinBuildHeight()); - corners[1] = corners[1].withY(plot.getArea().getMaxBuildHeight()); - int size = (corners[1].getX() - corners[0].getX()) + 1; - PlotId id = plot.getId(); - String world1 = plot.getArea().toString().replaceAll(";", "-") - .replaceAll("[^A-Za-z0-9]", ""); - final String file = time + '_' + world1 + '_' + id.getX() + '_' + id.getY() + '_' + size; - UUID uuid = player.getUUID(); - schematicHandler.upload(compoundTag, uuid, file, new RunnableVal<>() { - @Override - public void run(URL url) { - plot.removeRunning(); - if (url == null) { - player.sendMessage(TranslatableCaption.of("backups.backup_save_failed")); - return; - } - player.sendMessage(TranslatableCaption.of("web.save_success")); - player.sendMessage( - TranslatableCaption.of("errors.deprecated_commands"), - TagResolver.resolver("replacement", Tag.inserting(Component.text("/plot download"))) - ); - try (final MetaDataAccess> schematicAccess = - player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_SCHEMATICS)) { - schematicAccess.get().ifPresent(schematics -> schematics.add(file + ".schem")); - } - } - }); - }); - }); - return true; - } - -} diff --git a/Core/src/main/java/com/plotsquared/core/events/PlayerAutoPlotEvent.java b/Core/src/main/java/com/plotsquared/core/events/PlayerAutoPlotEvent.java index b4246e8b6..516588f83 100644 --- a/Core/src/main/java/com/plotsquared/core/events/PlayerAutoPlotEvent.java +++ b/Core/src/main/java/com/plotsquared/core/events/PlayerAutoPlotEvent.java @@ -112,38 +112,6 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve return this.plotArea; } - /** - * @deprecated for removal. Use {@link PlayerAutoPlotEvent#getSizeX()} - */ - @Deprecated(forRemoval = true, since = "6.1.0") - public int getSize_x() { - return getSizeX(); - } - - /** - * @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeX(int)} )} - */ - @Deprecated(forRemoval = true, since = "6.1.0") - public void setSize_x(int sizeX) { - setSizeX(sizeX); - } - - /** - * @deprecated for removal. Use {@link PlayerAutoPlotEvent#getSizeZ()} - */ - @Deprecated(forRemoval = true, since = "6.1.0") - public int getSize_z() { - return getSizeZ(); - } - - /** - * @deprecated for removal. Use {@link PlayerAutoPlotEvent#setSizeZ(int)} )} - */ - @Deprecated(forRemoval = true, since = "6.1.0") - public void setSize_z(int sizeZ) { - setSizeZ(sizeZ); - } - /** * Get the x size of the auto-area * diff --git a/Core/src/main/java/com/plotsquared/core/events/PlayerTeleportToPlotEvent.java b/Core/src/main/java/com/plotsquared/core/events/PlayerTeleportToPlotEvent.java index 399816e46..ded2b47f7 100644 --- a/Core/src/main/java/com/plotsquared/core/events/PlayerTeleportToPlotEvent.java +++ b/Core/src/main/java/com/plotsquared/core/events/PlayerTeleportToPlotEvent.java @@ -38,15 +38,6 @@ public class PlayerTeleportToPlotEvent extends PlotPlayerEvent implements Cancel private final TeleportCause cause; private Result eventResult; - /** - * @deprecated use {@link PlayerTeleportToPlotEvent#PlayerTeleportToPlotEvent(PlotPlayer, Location, Plot, TeleportCause)}. - * You should not be creating events in the first place. - */ - @Deprecated(forRemoval = true, since = "6.1.0") - public PlayerTeleportToPlotEvent(PlotPlayer player, Location from, Plot plot) { - this(player, from, plot, TeleportCause.UNKNOWN); - } - /** * PlayerTeleportToPlotEvent: Called when a player teleports to a plot * diff --git a/Core/src/main/java/com/plotsquared/core/permissions/Permission.java b/Core/src/main/java/com/plotsquared/core/permissions/Permission.java index 7ca7f076a..e51b53974 100644 --- a/Core/src/main/java/com/plotsquared/core/permissions/Permission.java +++ b/Core/src/main/java/com/plotsquared/core/permissions/Permission.java @@ -40,10 +40,6 @@ public enum Permission implements ComponentLike { PERMISSION_STAR("*"), PERMISSION_ADMIN("plots.admin"), PERMISSION_ADMIN_AREA_SUDO("plots.admin.area.sudo"), - @Deprecated(forRemoval = true, since = "6.2.2") - PERMISSION_PROJECTILE_UNOWNED("plots.projectile.unowned"), - @Deprecated(forRemoval = true, since = "6.2.2") - PERMISSION_PROJECTILE_OTHER("plots.projectile.other"), PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS("plots.admin.interact.blockedcommands"), PERMISSION_WORLDEDIT_BYPASS("plots.worldedit.bypass"), PERMISSION_PLOT_TOGGLE_TITLES("plots.toggle.titles"), 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 18917da24..c4953df2b 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -124,9 +124,6 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE; */ public class Plot { - @Deprecated(forRemoval = true, since = "6.6.0") - public static final int MAX_HEIGHT = 256; - private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + Plot.class.getSimpleName()); private static final DecimalFormat FLAG_DECIMAL_FORMAT = new DecimalFormat("0"); private static final MiniMessage MINI_MESSAGE = MiniMessage.builder().build(); @@ -1695,19 +1692,6 @@ public class Plot { return base.settings != null && base.settings.getRatings() != null; } - @Deprecated(forRemoval = true, since = "6.1.0") - public boolean claim(final @NonNull PlotPlayer player, boolean teleport, String schematic) { - if (!canClaim(player)) { - return false; - } - return claim(player, teleport, schematic, true); - } - - @Deprecated(forRemoval = true, since = "6.1.0") - public boolean claim(final @NonNull PlotPlayer player, boolean teleport, String schematic, boolean updateDB) { - return claim(player, teleport, schematic, updateDB, false); - } - /** * Claim the plot * diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java index afca97b00..5091ae7d0 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java @@ -42,7 +42,6 @@ import com.plotsquared.core.inject.annotations.WorldConfig; import com.plotsquared.core.location.BlockLoc; import com.plotsquared.core.location.Direction; import com.plotsquared.core.location.Location; -import com.plotsquared.core.location.PlotLoc; import com.plotsquared.core.player.ConsolePlayer; import com.plotsquared.core.player.MetaDataAccess; import com.plotsquared.core.player.PlayerMetaDataKeys; @@ -1280,20 +1279,6 @@ public abstract class PlotArea implements ComponentLike { return this.signMaterial; } - /** - * Get the legacy plot sign material before wall signs used a "wall" stance. - * - * @return the legacy sign material. - * @deprecated Use {@link #signMaterial()}. This method is used for 1.13 only and - * will be removed without replacement in favor of {@link #signMaterial()} - * once we remove the support for 1.13. - * @since 6.0.3 - */ - @Deprecated(forRemoval = true, since = "6.0.3") - public String getLegacySignMaterial() { - return this.legacySignMaterial; - } - public boolean isSpawnCustom() { return this.spawnCustom; } @@ -1352,22 +1337,6 @@ public abstract class PlotArea implements ComponentLike { return this.defaultHome; } - /** - * @deprecated Use {@link #nonmemberHome} - */ - @Deprecated(forRemoval = true, since = "6.1.4") - public PlotLoc getNonmemberHome() { - return new PlotLoc(this.defaultHome.getX(), this.defaultHome.getY(), this.defaultHome.getZ()); - } - - /** - * @deprecated Use {@link #defaultHome} - */ - @Deprecated(forRemoval = true, since = "6.1.4") - public PlotLoc getDefaultHome() { - return new PlotLoc(this.defaultHome.getX(), this.defaultHome.getY(), this.defaultHome.getZ()); - } - protected void setDefaultHome(BlockLoc defaultHome) { this.defaultHome = defaultHome; } diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotManager.java b/Core/src/main/java/com/plotsquared/core/plot/PlotManager.java index 57cad1327..e7c310a11 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotManager.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotManager.java @@ -210,15 +210,6 @@ public abstract class PlotManager { 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(forRemoval = true, since = "6.0.0") - public int getWorldHeight() { - return 255; - } - /** * Sets all the blocks along all the plot walls to their correct state (claimed or unclaimed). * diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java b/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java index 826bf46a1..a76bb2fdd 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotWorld.java @@ -31,7 +31,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.Collection; -import java.util.Objects; /** * A world that contains plots @@ -122,12 +121,4 @@ public abstract class PlotWorld { return world.hashCode(); } - /** - * @deprecated This method is not meant to be invoked or overridden, with no replacement. - */ - @Deprecated(forRemoval = true, since = "6.6.0") - protected boolean canEqual(final Object other) { - return other instanceof PlotWorld; - } - } diff --git a/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java b/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java index 5df0c16ff..9461321ff 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java +++ b/Core/src/main/java/com/plotsquared/core/plot/expiration/ExpireManager.java @@ -445,11 +445,6 @@ public class ExpireManager { plot.getPlotModificationManager().deletePlot(null, whenDone); } - @Deprecated(forRemoval = true, since = "6.4.0") - public long getAge(UUID uuid) { - return getAge(uuid, false); - } - /** * Get the age (last play time) of the passed player * diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java b/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java index 63a4f8a56..3692ccd1e 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/FlagContainer.java @@ -39,7 +39,6 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Locale; import java.util.Map; -import java.util.Objects; /** * Container type for {@link PlotFlag plot flags}. @@ -388,14 +387,6 @@ public class FlagContainer { return flagMap.hashCode(); } - /** - * @deprecated This method is not meant to be invoked or overridden, with no replacement. - */ - @Deprecated(forRemoval = true, since = "6.6.0") - protected boolean canEqual(final Object other) { - return other instanceof FlagContainer; - } - /** * Update event types used in {@link PlotFlagUpdateHandler}. */ diff --git a/Core/src/main/java/com/plotsquared/core/plot/flag/PlotFlag.java b/Core/src/main/java/com/plotsquared/core/plot/flag/PlotFlag.java index a922fcafd..095dd5ce8 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/flag/PlotFlag.java +++ b/Core/src/main/java/com/plotsquared/core/plot/flag/PlotFlag.java @@ -228,13 +228,4 @@ public abstract class PlotFlag> { return value.hashCode(); } - /** - * @deprecated This method is not meant to be invoked or overridden, with no replacement. - */ - @Deprecated(forRemoval = true, since = "6.6.0") - protected boolean canEqual(final Object other) { - return other instanceof PlotFlag; - } - - } diff --git a/Core/src/main/java/com/plotsquared/core/util/MainUtil.java b/Core/src/main/java/com/plotsquared/core/util/MainUtil.java deleted file mode 100644 index 768aa6f90..000000000 --- a/Core/src/main/java/com/plotsquared/core/util/MainUtil.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * _____ _ _ _____ _ - * | __ \| | | | / ____| | | - * | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| | - * | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` | - * | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| | - * |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_| - * | | - * |_| - * PlotSquared plot management system for Minecraft - * Copyright (C) 2014 - 2022 IntellectualSites - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.plotsquared.core.util; - -/** - * plot functions - * - * @deprecated Do not use - */ -@Deprecated(forRemoval = true, since = "6.0.0") -public class MainUtil { - - /** - * Cache of mapping x,y,z coordinates to the chunk array
- * - Used for efficient world generation
- */ - @Deprecated(forRemoval = true, since = "6.0.0") - public static short[][] x_loc; - @Deprecated(forRemoval = true, since = "6.0.0") - public static short[][] y_loc; - @Deprecated(forRemoval = true, since = "6.0.0") - public static short[][] z_loc; - @Deprecated(forRemoval = true, since = "6.0.0") - public static short[][][] CACHE_I = null; - @Deprecated(forRemoval = true, since = "6.0.0") - public static short[][][] CACHE_J = null; - - /** - * This cache is used for world generation and just saves a bit of calculation time when checking if something is in the plot area. - */ - @Deprecated(forRemoval = true, since = "6.0.0") - public static void initCache() { - if (x_loc == null) { - x_loc = new short[16][4096]; - y_loc = new short[16][4096]; - z_loc = new short[16][4096]; - for (int i = 0; i < 16; i++) { - int i4 = i << 4; - for (int j = 0; j < 4096; j++) { - int y = i4 + (j >> 8); - int a = j - ((y & 0xF) << 8); - int z1 = a >> 4; - int x1 = a - (z1 << 4); - x_loc[i][j] = (short) x1; - y_loc[i][j] = (short) y; - z_loc[i][j] = (short) z1; - } - } - } - if (CACHE_I == null) { - CACHE_I = new short[256][16][16]; - CACHE_J = new short[256][16][16]; - for (int x = 0; x < 16; x++) { - for (int z = 0; z < 16; z++) { - for (int y = 0; y < 256; y++) { - short i = (short) (y >> 4); - short j = (short) ((y & 0xF) << 8 | z << 4 | x); - CACHE_I[y][x][z] = i; - CACHE_J[y][x][z] = j; - } - } - } - } - } - -} 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 9e8ed2cbd..125ca9679 100644 --- a/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/PlayerManager.java @@ -167,56 +167,6 @@ public abstract class PlayerManager

, T> { return list.asComponent(); } - /** - * Get the name from a UUID. - * - * @param owner Owner UUID - * @return The player's name, None, Everyone or Unknown - * @deprecated Use {@link #resolveName(UUID)} - */ - @Deprecated(forRemoval = true, since = "6.4.0") - public static @NonNull String getName(final @Nullable UUID owner) { - return getName(owner, true); - } - - /** - * Get the name from a UUID. - * - * @param owner Owner UUID - * @param blocking Whether or not the operation can be blocking - * @return The player's name, None, Everyone or Unknown - * @deprecated Use {@link #resolveName(UUID, boolean)} - */ - @Deprecated(forRemoval = true, since = "6.4.0") - public static @NonNull String getName(final @Nullable UUID owner, final boolean blocking) { - if (owner == null) { - TranslatableCaption.of("info.none"); - } - if (owner.equals(DBFunc.EVERYONE)) { - TranslatableCaption.of("info.everyone"); - } - if (owner.equals(DBFunc.SERVER)) { - TranslatableCaption.of("info.server"); - } - final String name; - if (blocking) { - name = PlotSquared.get().getImpromptuUUIDPipeline() - .getSingle(owner, Settings.UUID.BLOCKING_TIMEOUT); - } else { - final UUIDMapping uuidMapping = - PlotSquared.get().getImpromptuUUIDPipeline().getImmediately(owner); - if (uuidMapping != null) { - name = uuidMapping.getUsername(); - } else { - name = null; - } - } - if (name == null) { - TranslatableCaption.of("info.unknown"); - } - return name; - } - /** * Attempts to resolve the username by an uuid *

diff --git a/Core/src/main/java/com/plotsquared/core/util/RegExUtil.java b/Core/src/main/java/com/plotsquared/core/util/RegExUtil.java deleted file mode 100644 index bf6113089..000000000 --- a/Core/src/main/java/com/plotsquared/core/util/RegExUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * _____ _ _ _____ _ - * | __ \| | | | / ____| | | - * | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| | - * | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` | - * | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| | - * |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_| - * | | - * |_| - * PlotSquared plot management system for Minecraft - * Copyright (C) 2014 - 2022 IntellectualSites - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.plotsquared.core.util; - -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Pattern; - -@Deprecated(since = "6.6.2", forRemoval = true) -public class RegExUtil { - - public static Map compiledPatterns; - - static { - compiledPatterns = new HashMap<>(); - } - -} diff --git a/Core/src/main/java/com/plotsquared/core/util/RegionManager.java b/Core/src/main/java/com/plotsquared/core/util/RegionManager.java index 01542ead5..8510d33d2 100644 --- a/Core/src/main/java/com/plotsquared/core/util/RegionManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/RegionManager.java @@ -379,17 +379,6 @@ public abstract class RegionManager { }); } - @Deprecated(forRemoval = true, since = "6.6.0") - public void setBiome( - final CuboidRegion region, - final int extendBiome, - final BiomeType biome, - final String world, - final Runnable whenDone - ) { - setBiome(region, extendBiome, biome, PlotSquared.get().getPlotAreaManager().getPlotAreas(world, region)[0], whenDone); - } - /** * Set a region to a biome type. * 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 7b86490cd..debf89975 100644 --- a/Core/src/main/java/com/plotsquared/core/util/RegionUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/RegionUtil.java @@ -26,7 +26,6 @@ package com.plotsquared.core.util; import com.plotsquared.core.location.Location; -import com.plotsquared.core.plot.Plot; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; @@ -76,11 +75,6 @@ public class RegionUtil { return new CuboidRegion(min, max); } - @Deprecated(forRemoval = true, since = "6.6.0") - public static CuboidRegion createRegion(int pos1x, int pos2x, int pos1z, int pos2z) { - return createRegion(pos1x, pos2x, 0, 255, pos1z, pos2z); - } - public static CuboidRegion createRegion( int pos1x, int pos2x, int pos1y, int pos2y, int pos1z, int pos2z 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 591d16582..0c65f4450 100644 --- a/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java +++ b/Core/src/main/java/com/plotsquared/core/util/TabCompletions.java @@ -32,13 +32,11 @@ import com.plotsquared.core.command.Command; import com.plotsquared.core.command.CommandCategory; import com.plotsquared.core.command.RequiredType; import com.plotsquared.core.configuration.Settings; -import com.plotsquared.core.player.ConsolePlayer; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.uuid.UUIDMapping; import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; import java.util.ArrayList; import java.util.Arrays; @@ -75,23 +73,6 @@ public final class TabCompletions { "This is a utility class and cannot be instantiated"); } - /** - * Get a list of tab completions corresponding to player names. This uses the UUID pipeline - * cache, so it will complete will all names known to PlotSquared - * - * @param input Command input - * @param existing Players that should not be included in completions - * @return List of completions - * @deprecated In favor {@link #completePlayers(PlotPlayer, String, List)} - */ - @Deprecated(forRemoval = true, since = "6.1.3") - public static @NonNull List completePlayers( - final @NonNull String input, - final @NonNull List existing - ) { - return completePlayers(ConsolePlayer.getConsole(), input, existing); - } - /** * Get a list of tab completions corresponding to player names. This uses the UUID pipeline * cache, so it will complete will all names known to PlotSquared @@ -110,24 +91,6 @@ public final class TabCompletions { return completePlayers("players", issuer, input, existing, uuid -> true); } - /** - * Get a list of tab completions corresponding to player names added to the given plot. - * - * @param plot Plot to complete added players for - * @param input Command input - * @param existing Players that should not be included in completions - * @return List of completions - * - * @deprecated In favor {@link #completeAddedPlayers(PlotPlayer, Plot, String, List)} - */ - @Deprecated(forRemoval = true, since = "6.1.3") - public static @NonNull List completeAddedPlayers( - final @NonNull Plot plot, - final @NonNull String input, final @NonNull List existing - ) { - return completeAddedPlayers(ConsolePlayer.getConsole(), plot, input, existing); - } - /** * Get a list of tab completions corresponding to player names added to the given plot. * @@ -259,24 +222,6 @@ public final class TabCompletions { return Collections.unmodifiableList(completions); } - /** - * @param cacheIdentifier Cache key - * @param input Command input - * @param existing Players that should not be included in completions - * @param uuidFilter Filter applied before caching values - * @return List of completions - * @deprecated In favor {@link #completePlayers(String, PlotPlayer, String, List, Predicate)} - */ - @SuppressWarnings("unused") - @Deprecated(forRemoval = true, since = "6.1.3") - private static List completePlayers( - final @NonNull String cacheIdentifier, - final @NonNull String input, final @NonNull List existing, - final @NonNull Predicate uuidFilter - ) { - return completePlayers(cacheIdentifier, ConsolePlayer.getConsole(), input, existing, uuidFilter); - } - /** * @param cacheIdentifier Cache key * @param issuer The player who issued the tab completion diff --git a/Core/src/main/java/com/plotsquared/core/util/WorldUtil.java b/Core/src/main/java/com/plotsquared/core/util/WorldUtil.java index 3474e3bc1..8019f2000 100644 --- a/Core/src/main/java/com/plotsquared/core/util/WorldUtil.java +++ b/Core/src/main/java/com/plotsquared/core/util/WorldUtil.java @@ -37,7 +37,6 @@ import com.sk89q.jnbt.NBTInputStream; import com.sk89q.jnbt.NBTOutputStream; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.math.BlockVector2; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BiomeType; @@ -70,26 +69,6 @@ import java.util.zip.ZipOutputStream; public abstract class WorldUtil { - /** - * Set the biome in a region - * - * @param world World name - * @param p1x Min X - * @param p1z Min Z - * @param p2x Max X - * @param p2z Max Z - * @param biome Biome - * @deprecated use {@link WorldUtil#setBiome(String, CuboidRegion, BiomeType)} - */ - @Deprecated(forRemoval = true) - public static void setBiome(String world, int p1x, int p1z, int p2x, int p2z, BiomeType biome) { - World weWorld = PlotSquared.platform().worldUtil().getWeWorld(world); - BlockVector3 pos1 = BlockVector2.at(p1x, p1z).toBlockVector3(weWorld.getMinY()); - BlockVector3 pos2 = BlockVector2.at(p2x, p2z).toBlockVector3(weWorld.getMaxY()); - CuboidRegion region = new CuboidRegion(pos1, pos2); - PlotSquared.platform().worldUtil().setBiomes(world, region, biome); - } - /** * Set the biome in a region * 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 4325f67b6..2dbbe1be4 100644 --- a/Core/src/main/java/com/plotsquared/core/uuid/UUIDMapping.java +++ b/Core/src/main/java/com/plotsquared/core/uuid/UUIDMapping.java @@ -68,12 +68,4 @@ public class UUIDMapping { return Objects.hash(uuid, username); } - /** - * @deprecated This method is not meant to be invoked or overridden, with no replacement. - */ - @Deprecated(forRemoval = true, since = "6.6.0") - protected boolean canEqual(final Object other) { - return other instanceof UUIDMapping; - } - }