Address deprecations for removal throughout the plugin

This commit is contained in:
dordsor21 2022-06-08 21:09:55 +01:00
parent 3d87ee41b3
commit 17cbcf394c
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
24 changed files with 0 additions and 671 deletions

View File

@ -31,7 +31,6 @@ import org.bukkit.Bukkit;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Map; import java.util.Map;
import java.util.Objects;
public class BukkitWorld implements World<org.bukkit.World> { public class BukkitWorld implements World<org.bukkit.World> {
@ -140,14 +139,6 @@ public class BukkitWorld implements World<org.bukkit.World> {
return world.hashCode(); 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() { public String toString() {
return "BukkitWorld(world=" + this.world + ")"; return "BukkitWorld(world=" + this.world + ")";
} }

View File

@ -105,11 +105,6 @@ public class FaweRegionManager extends BukkitRegionManager {
delegate.swap(pos1, pos2, swapPos, whenDone); 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 @Override
public void setBiome(CuboidRegion region, int extendBiome, BiomeType biome, PlotArea area, Runnable whenDone) { public void setBiome(CuboidRegion region, int extendBiome, BiomeType biome, PlotArea area, Runnable whenDone) {
delegate.setBiome(region, extendBiome, biome, area.getWorldName(), whenDone); delegate.setBiome(region, extendBiome, biome, area.getWorldName(), whenDone);

View File

@ -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 <https://www.gnu.org/licenses/>.
*/
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;
}
}

View File

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

View File

@ -82,7 +82,6 @@ public class MainCommand extends Command {
commands.add(Buy.class); commands.add(Buy.class);
if (Settings.Web.LEGACY_WEBINTERFACE) { if (Settings.Web.LEGACY_WEBINTERFACE) {
LOGGER.warn("Legacy webinterface is used. Please note that it will be removed in future."); 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(Load.class);
commands.add(Confirm.class); commands.add(Confirm.class);
@ -131,7 +130,6 @@ public class MainCommand extends Command {
commands.add(Move.class); commands.add(Move.class);
commands.add(Condense.class); commands.add(Condense.class);
commands.add(Copy.class); commands.add(Copy.class);
commands.add(Chat.class);
commands.add(Trim.class); commands.add(Trim.class);
commands.add(Done.class); commands.add(Done.class);
commands.add(Continue.class); commands.add(Continue.class);

View File

@ -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 <https://www.gnu.org/licenses/>.
*/
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<List<String>> schematicAccess =
player.accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_SCHEMATICS)) {
schematicAccess.get().ifPresent(schematics -> schematics.add(file + ".schem"));
}
}
});
});
});
return true;
}
}

View File

@ -112,38 +112,6 @@ public class PlayerAutoPlotEvent extends PlotEvent implements CancellablePlotEve
return this.plotArea; 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 * Get the x size of the auto-area
* *

View File

@ -38,15 +38,6 @@ public class PlayerTeleportToPlotEvent extends PlotPlayerEvent implements Cancel
private final TeleportCause cause; private final TeleportCause cause;
private Result eventResult; 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 * PlayerTeleportToPlotEvent: Called when a player teleports to a plot
* *

View File

@ -40,10 +40,6 @@ public enum Permission implements ComponentLike {
PERMISSION_STAR("*"), PERMISSION_STAR("*"),
PERMISSION_ADMIN("plots.admin"), PERMISSION_ADMIN("plots.admin"),
PERMISSION_ADMIN_AREA_SUDO("plots.admin.area.sudo"), 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_ADMIN_INTERACT_BLOCKED_CMDS("plots.admin.interact.blockedcommands"),
PERMISSION_WORLDEDIT_BYPASS("plots.worldedit.bypass"), PERMISSION_WORLDEDIT_BYPASS("plots.worldedit.bypass"),
PERMISSION_PLOT_TOGGLE_TITLES("plots.toggle.titles"), PERMISSION_PLOT_TOGGLE_TITLES("plots.toggle.titles"),

View File

@ -124,9 +124,6 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
*/ */
public class Plot { 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 Logger LOGGER = LogManager.getLogger("PlotSquared/" + Plot.class.getSimpleName());
private static final DecimalFormat FLAG_DECIMAL_FORMAT = new DecimalFormat("0"); private static final DecimalFormat FLAG_DECIMAL_FORMAT = new DecimalFormat("0");
private static final MiniMessage MINI_MESSAGE = MiniMessage.builder().build(); private static final MiniMessage MINI_MESSAGE = MiniMessage.builder().build();
@ -1695,19 +1692,6 @@ public class Plot {
return base.settings != null && base.settings.getRatings() != null; 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 * Claim the plot
* *

View File

@ -42,7 +42,6 @@ import com.plotsquared.core.inject.annotations.WorldConfig;
import com.plotsquared.core.location.BlockLoc; import com.plotsquared.core.location.BlockLoc;
import com.plotsquared.core.location.Direction; import com.plotsquared.core.location.Direction;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.location.PlotLoc;
import com.plotsquared.core.player.ConsolePlayer; import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.MetaDataAccess; import com.plotsquared.core.player.MetaDataAccess;
import com.plotsquared.core.player.PlayerMetaDataKeys; import com.plotsquared.core.player.PlayerMetaDataKeys;
@ -1280,20 +1279,6 @@ public abstract class PlotArea implements ComponentLike {
return this.signMaterial; 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() { public boolean isSpawnCustom() {
return this.spawnCustom; return this.spawnCustom;
} }
@ -1352,22 +1337,6 @@ public abstract class PlotArea implements ComponentLike {
return this.defaultHome; 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) { protected void setDefaultHome(BlockLoc defaultHome) {
this.defaultHome = defaultHome; this.defaultHome = defaultHome;
} }

View File

@ -210,15 +210,6 @@ 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(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). * Sets all the blocks along all the plot walls to their correct state (claimed or unclaimed).
* *

View File

@ -31,7 +31,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Collection; import java.util.Collection;
import java.util.Objects;
/** /**
* A world that contains plots * A world that contains plots
@ -122,12 +121,4 @@ public abstract class PlotWorld {
return world.hashCode(); 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;
}
} }

View File

@ -445,11 +445,6 @@ public class ExpireManager {
plot.getPlotModificationManager().deletePlot(null, whenDone); 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 * Get the age (last play time) of the passed player
* *

View File

@ -39,7 +39,6 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Objects;
/** /**
* Container type for {@link PlotFlag plot flags}. * Container type for {@link PlotFlag plot flags}.
@ -388,14 +387,6 @@ public class FlagContainer {
return flagMap.hashCode(); 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}. * Update event types used in {@link PlotFlagUpdateHandler}.
*/ */

View File

@ -228,13 +228,4 @@ public abstract class PlotFlag<T, F extends PlotFlag<T, F>> {
return value.hashCode(); 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;
}
} }

View File

@ -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 <https://www.gnu.org/licenses/>.
*/
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<br>
* - Used for efficient world generation<br>
*/
@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;
}
}
}
}
}
}

View File

@ -167,56 +167,6 @@ public abstract class PlayerManager<P extends PlotPlayer<? extends T>, T> {
return list.asComponent(); 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 * Attempts to resolve the username by an uuid
* <p> * <p>

View File

@ -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 <https://www.gnu.org/licenses/>.
*/
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<String, Pattern> compiledPatterns;
static {
compiledPatterns = new HashMap<>();
}
}

View File

@ -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. * Set a region to a biome type.
* *

View File

@ -26,7 +26,6 @@
package com.plotsquared.core.util; package com.plotsquared.core.util;
import com.plotsquared.core.location.Location; import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.Plot;
import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
@ -76,11 +75,6 @@ public class RegionUtil {
return new CuboidRegion(min, max); 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( public static CuboidRegion createRegion(
int pos1x, int pos2x, int pos1y, int pos2y, int pos1z, int pos1x, int pos2x, int pos1y, int pos2y, int pos1z,
int pos2z int pos2z

View File

@ -32,13 +32,11 @@ import com.plotsquared.core.command.Command;
import com.plotsquared.core.command.CommandCategory; import com.plotsquared.core.command.CommandCategory;
import com.plotsquared.core.command.RequiredType; import com.plotsquared.core.command.RequiredType;
import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.uuid.UUIDMapping; import com.plotsquared.core.uuid.UUIDMapping;
import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -75,23 +73,6 @@ public final class TabCompletions {
"This is a utility class and cannot be instantiated"); "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<Command> completePlayers(
final @NonNull String input,
final @NonNull List<String> existing
) {
return completePlayers(ConsolePlayer.getConsole(), input, existing);
}
/** /**
* Get a list of tab completions corresponding to player names. This uses the UUID pipeline * 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 * 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); 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<Command> completeAddedPlayers(
final @NonNull Plot plot,
final @NonNull String input, final @NonNull List<String> existing
) {
return completeAddedPlayers(ConsolePlayer.getConsole(), plot, input, existing);
}
/** /**
* Get a list of tab completions corresponding to player names added to the given plot. * 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); 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<Command> completePlayers(
final @NonNull String cacheIdentifier,
final @NonNull String input, final @NonNull List<String> existing,
final @NonNull Predicate<UUID> uuidFilter
) {
return completePlayers(cacheIdentifier, ConsolePlayer.getConsole(), input, existing, uuidFilter);
}
/** /**
* @param cacheIdentifier Cache key * @param cacheIdentifier Cache key
* @param issuer The player who issued the tab completion * @param issuer The player who issued the tab completion

View File

@ -37,7 +37,6 @@ import com.sk89q.jnbt.NBTInputStream;
import com.sk89q.jnbt.NBTOutputStream; import com.sk89q.jnbt.NBTOutputStream;
import com.sk89q.jnbt.Tag; import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
@ -70,26 +69,6 @@ import java.util.zip.ZipOutputStream;
public abstract class WorldUtil { 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 * Set the biome in a region
* *

View File

@ -68,12 +68,4 @@ public class UUIDMapping {
return Objects.hash(uuid, username); 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;
}
} }