From 441e9b5679cf7bb5a7be7a040a0abc4eb3d169cb Mon Sep 17 00:00:00 2001 From: Sczptor Date: Sat, 3 Feb 2024 14:05:10 +0000 Subject: [PATCH] Made relevant changes (Blame drunk me) --- .../java/dev/plex/extras/command/OrbitCommand.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/dev/plex/extras/command/OrbitCommand.java b/src/main/java/dev/plex/extras/command/OrbitCommand.java index 83e9405..643d5ce 100644 --- a/src/main/java/dev/plex/extras/command/OrbitCommand.java +++ b/src/main/java/dev/plex/extras/command/OrbitCommand.java @@ -13,9 +13,8 @@ import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.HashMap; import java.util.List; -import java.util.Map; +import java.util.ArrayList; import java.util.UUID; @CommandParameters(name = "orbit", description = "Accelerates the player at a super fast rate", usage = "/ [< | stop>]") @@ -23,7 +22,7 @@ import java.util.UUID; public class OrbitCommand extends PlexCommand { - private static final Map isOrbitedMap = new HashMap<>(); + private static final List isOrbited = new ArrayList<>(); @Override protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, String[] args) @@ -69,15 +68,15 @@ public class OrbitCommand extends PlexCommand private void startOrbiting(Player player, int strength) { player.setGameMode(org.bukkit.GameMode.SURVIVAL); player.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, Integer.MAX_VALUE, strength, false, false)); - isOrbitedMap.put(player.getUniqueId(), true); + isOrbited.add(player.getUniqueId()); } private void stopOrbiting(Player player) { player.removePotionEffect(PotionEffectType.LEVITATION); - isOrbitedMap.remove(player.getUniqueId()); + isOrbited.remove(player.getUniqueId()); } public static boolean isPlayerOrbited(UUID playerId) { - return isOrbitedMap.getOrDefault(playerId, false); + return isOrbited.contains(playerId); } }