From 404ab738c047d18a77575139b8982bd76540010f Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Wed, 13 Sep 2023 23:21:23 +0800 Subject: [PATCH] Fix imports --- .../multiverse/core/api/SafeTTeleporter.java | 89 ------------------- .../multiverse/core/api/Teleporter.java | 35 -------- .../core/commands/DeleteCommand.java | 2 + .../core/commands/RegenCommand.java | 1 + .../core/commands/RemoveCommand.java | 1 + .../core/commands/UnloadCommand.java | 1 + .../core/event/MVTeleportEvent.java | 6 +- .../core/teleportation/TeleportResultOld.java | 39 -------- 8 files changed, 8 insertions(+), 166 deletions(-) delete mode 100644 src/main/java/org/mvplugins/multiverse/core/api/SafeTTeleporter.java delete mode 100644 src/main/java/org/mvplugins/multiverse/core/api/Teleporter.java delete mode 100644 src/main/java/org/mvplugins/multiverse/core/teleportation/TeleportResultOld.java diff --git a/src/main/java/org/mvplugins/multiverse/core/api/SafeTTeleporter.java b/src/main/java/org/mvplugins/multiverse/core/api/SafeTTeleporter.java deleted file mode 100644 index cb971aa4..00000000 --- a/src/main/java/org/mvplugins/multiverse/core/api/SafeTTeleporter.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.mvplugins.multiverse.core.api; - -import java.util.concurrent.CompletableFuture; - -import co.aikar.commands.BukkitCommandIssuer; -import org.bukkit.Location; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Entity; -import org.jvnet.hk2.annotations.Contract; - -import org.mvplugins.multiverse.core.destination.ParsedDestination; -import org.mvplugins.multiverse.core.teleportation.TeleportResult; - -/** - * Used to safely teleport people. - */ -@Deprecated -@Contract -public interface SafeTTeleporter extends Teleporter { - - /** - * Gets the next safe location around the given location. - * @param l A {@link Location}. - * @return A safe {@link Location}. - */ - Location getSafeLocation(Location l); - - /** - * Gets the next safe location around the given location. - * @param l A {@link Location}. - * @param tolerance The tolerance. - * @param radius The radius. - * @return A safe {@link Location}. - */ - Location getSafeLocation(Location l, int tolerance, int radius); - - /** - * Safely teleport the entity to the MVDestination. This will perform checks to see if the place is safe, and if - * it's not, will adjust the final destination accordingly. - * - * @param teleporter Person who performed the teleport command. - * @param teleportee Entity to teleport - * @param destination Destination to teleport them to - * @return true for success, false for failure - */ - @Deprecated - TeleportResult safelyTeleport(BukkitCommandIssuer teleporter, Entity teleportee, ParsedDestination destination); - - /** - * Safely teleport the entity to the MVDestination. This will perform checks to see if the place is safe, and if - * it's not, will adjust the final destination accordingly. - * - * @param teleporter Person who performed the teleport command. - * @param teleportee Entity to teleport - * @param destination Destination to teleport them to - * @return true for success, false for failure - */ - CompletableFuture safelyTeleportAsync(BukkitCommandIssuer teleporter, Entity teleportee, ParsedDestination destination); - - /** - * Safely teleport the entity to the Location. This may perform checks to - * see if the place is safe, and if - * it's not, will adjust the final destination accordingly. - * - * @param teleporter Person who issued the teleport command. - * @param teleportee Entity to teleport. - * @param location Location to teleport them to. - * @param safely Should the destination be checked for safety before teleport? - * @return true for success, false for failure. - */ - TeleportResult safelyTeleport(CommandSender teleporter, Entity teleportee, Location location, - boolean safely); - - /** - * Returns a safe location for the entity to spawn at. - * - * @param entity The entity to spawn - * @param destination The MVDestination to take the entity to. - * @return A new location to spawn the entity at. - */ - Location getSafeLocation(Entity entity, DestinationInstance destination); - - /** - * Finds a portal-block next to the specified {@link Location}. - * @param l The {@link Location} - * @return The next portal-block's {@link Location}. - */ - Location findPortalBlockNextTo(Location l); -} diff --git a/src/main/java/org/mvplugins/multiverse/core/api/Teleporter.java b/src/main/java/org/mvplugins/multiverse/core/api/Teleporter.java deleted file mode 100644 index bbf8349e..00000000 --- a/src/main/java/org/mvplugins/multiverse/core/api/Teleporter.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.mvplugins.multiverse.core.api; - -import java.util.concurrent.CompletableFuture; - -import co.aikar.commands.BukkitCommandIssuer; -import org.bukkit.entity.Entity; -import org.jvnet.hk2.annotations.Contract; - -import org.mvplugins.multiverse.core.destination.ParsedDestination; -import org.mvplugins.multiverse.core.teleportation.TeleportResult; - -@Deprecated -@Contract -public interface Teleporter { - /** - * Teleport the entity to the Multiverse Destination. - * - * @param teleporter Person who performed the teleport command. - * @param teleportee Entity to teleport - * @param destination Destination to teleport them to - * @return true for success, false for failure - */ - @Deprecated - TeleportResult teleport(BukkitCommandIssuer teleporter, Entity teleportee, ParsedDestination destination); - - /** - * Teleport the entity to the Multiverse Destination. - * - * @param teleporter Person who performed the teleport command. - * @param teleportee Entity to teleport - * @param destination Destination to teleport them to - * @return true for success, false for failure - */ - CompletableFuture teleportAsync(BukkitCommandIssuer teleporter, Entity teleportee, ParsedDestination destination); -} diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/DeleteCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/DeleteCommand.java index 53d2ace4..3189e6fb 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/DeleteCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/DeleteCommand.java @@ -24,7 +24,9 @@ import org.mvplugins.multiverse.core.commandtools.flags.CommandFlag; import org.mvplugins.multiverse.core.commandtools.flags.ParsedCommandFlags; import org.mvplugins.multiverse.core.commandtools.queue.QueuedCommand; import org.mvplugins.multiverse.core.utils.MVCorei18n; +import org.mvplugins.multiverse.core.world.LoadedMultiverseWorld; import org.mvplugins.multiverse.core.world.WorldManager; +import org.mvplugins.multiverse.core.world.helpers.PlayerWorldTeleporter; @Service @CommandAlias("mv") diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/RegenCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/RegenCommand.java index 230074a4..f6e24389 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/RegenCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/RegenCommand.java @@ -29,6 +29,7 @@ import org.mvplugins.multiverse.core.commandtools.queue.QueuedCommand; import org.mvplugins.multiverse.core.utils.MVCorei18n; import org.mvplugins.multiverse.core.world.LoadedMultiverseWorld; import org.mvplugins.multiverse.core.world.WorldManager; +import org.mvplugins.multiverse.core.world.helpers.PlayerWorldTeleporter; import org.mvplugins.multiverse.core.world.options.RegenWorldOptions; @Service diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java index 7e9664d9..b8f77227 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/RemoveCommand.java @@ -23,6 +23,7 @@ import org.mvplugins.multiverse.core.commandtools.flags.CommandFlag; import org.mvplugins.multiverse.core.commandtools.flags.ParsedCommandFlags; import org.mvplugins.multiverse.core.utils.MVCorei18n; import org.mvplugins.multiverse.core.world.WorldManager; +import org.mvplugins.multiverse.core.world.helpers.PlayerWorldTeleporter; @Service @CommandAlias("mv") diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/UnloadCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/UnloadCommand.java index e336f92f..9e5ad972 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/UnloadCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/UnloadCommand.java @@ -22,6 +22,7 @@ import org.mvplugins.multiverse.core.commandtools.flags.ParsedCommandFlags; import org.mvplugins.multiverse.core.utils.MVCorei18n; import org.mvplugins.multiverse.core.world.LoadedMultiverseWorld; import org.mvplugins.multiverse.core.world.WorldManager; +import org.mvplugins.multiverse.core.world.helpers.PlayerWorldTeleporter; import org.mvplugins.multiverse.core.world.options.UnloadWorldOptions; @Service diff --git a/src/main/java/org/mvplugins/multiverse/core/event/MVTeleportEvent.java b/src/main/java/org/mvplugins/multiverse/core/event/MVTeleportEvent.java index ccf7f3f3..532213b3 100644 --- a/src/main/java/org/mvplugins/multiverse/core/event/MVTeleportEvent.java +++ b/src/main/java/org/mvplugins/multiverse/core/event/MVTeleportEvent.java @@ -14,8 +14,8 @@ import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; -import org.mvplugins.multiverse.core.api.SafeTTeleporter; import org.mvplugins.multiverse.core.destination.ParsedDestination; +import org.mvplugins.multiverse.core.teleportation.AsyncSafetyTeleporter; /** * Event that gets called when a player use the /mvtp command. @@ -89,8 +89,8 @@ public class MVTeleportEvent extends Event implements Cancellable { } /** - * Looks if this {@link MVTeleportEvent} is using the {@link SafeTTeleporter}. - * @return True if this {@link MVTeleportEvent} is using the {@link SafeTTeleporter}. + * Looks if this {@link MVTeleportEvent} is using the {@link AsyncSafetyTeleporter}. + * @return True if this {@link MVTeleportEvent} is using the {@link AsyncSafetyTeleporter}. */ public boolean isUsingSafeTTeleporter() { return useSafeTeleport; diff --git a/src/main/java/org/mvplugins/multiverse/core/teleportation/TeleportResultOld.java b/src/main/java/org/mvplugins/multiverse/core/teleportation/TeleportResultOld.java deleted file mode 100644 index a31051c6..00000000 --- a/src/main/java/org/mvplugins/multiverse/core/teleportation/TeleportResultOld.java +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** - * Multiverse 2 Copyright (c) the Multiverse Team 2011. * - * Multiverse 2 is licensed under the BSD License. * - * For more information please check the README.md file included * - * with this project. * - ******************************************************************************/ - -package org.mvplugins.multiverse.core.teleportation; - -/** - * An enum containing possible teleport-results. - */ -@Deprecated -public enum TeleportResultOld { - /** - * Insufficient permissions. - */ - FAIL_PERMISSION, - /** - * The teleport was unsafe. - */ - FAIL_UNSAFE, - /** - * The player was to poor. - */ - FAIL_TOO_POOR, - /** - * The teleport was invalid. - */ - FAIL_INVALID, - /** - * Unknown reason. - */ - FAIL_OTHER, - /** - * The player was successfully teleported. - */ - SUCCESS -}