From aadac1746eae75e2ad48c3ac03ceaccf44115c76 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Tue, 15 Oct 2024 18:57:17 -0500 Subject: [PATCH] Better permission validation --- proxy/src/main/java/dev/plex/Plex.java | 3 +- .../java/dev/plex/command/PlexCommand.java | 3 +- .../annotation/CommandPermissions.java | 1 - .../main/java/dev/plex/config/TomlConfig.java | 5 ++- .../dev/plex/handlers/ListenerHandler.java | 1 - .../plex/listener/impl/ServerListener.java | 5 ++- .../dev/plex/settings/ServerSettings.java | 3 +- .../java/dev/plex/toml/ArrayValueWriter.java | 1 - .../java/dev/plex/toml/ObjectValueWriter.java | 8 +++-- .../src/main/java/dev/plex/toml/Results.java | 7 ++++- .../dev/plex/toml/TableArrayValueWriter.java | 1 - proxy/src/main/java/dev/plex/toml/Toml.java | 19 +++++++++--- .../main/java/dev/plex/toml/TomlWriter.java | 12 ++++--- .../main/java/dev/plex/toml/ValueReaders.java | 1 - .../main/java/dev/plex/util/RandomUtil.java | 3 +- .../java/dev/plex/util/ReflectionsUtil.java | 1 - .../main/java/dev/plex/cache/DataUtils.java | 2 -- .../main/java/dev/plex/cache/PlayerCache.java | 1 - .../java/dev/plex/command/PlexCommand.java | 19 ++++++++---- .../annotation/CommandPermissions.java | 1 - .../plex/command/blocking/BlockedCommand.java | 3 +- .../dev/plex/command/impl/AdminChatCMD.java | 7 ++--- .../dev/plex/command/impl/AdminworldCMD.java | 5 ++- .../dev/plex/command/impl/AdventureCMD.java | 3 +- .../java/dev/plex/command/impl/BanCMD.java | 9 +++--- .../dev/plex/command/impl/BanListCommand.java | 6 ++-- .../command/impl/BcastLoginMessageCMD.java | 3 +- .../dev/plex/command/impl/BlockEditCMD.java | 9 +++--- .../dev/plex/command/impl/CommandSpyCMD.java | 5 ++- .../dev/plex/command/impl/ConsoleSayCMD.java | 5 ++- .../dev/plex/command/impl/CreativeCMD.java | 3 +- .../java/dev/plex/command/impl/DebugCMD.java | 8 ++--- .../dev/plex/command/impl/EntityWipeCMD.java | 8 +++-- .../dev/plex/command/impl/FlatlandsCMD.java | 5 ++- .../java/dev/plex/command/impl/FreezeCMD.java | 7 ++--- .../dev/plex/command/impl/GamemodeCMD.java | 7 ++--- .../java/dev/plex/command/impl/KickCMD.java | 7 ++--- .../java/dev/plex/command/impl/ListCMD.java | 7 ++--- .../dev/plex/command/impl/LocalSpawnCMD.java | 6 ++-- .../java/dev/plex/command/impl/LockupCMD.java | 3 +- .../command/impl/MasterbuilderworldCMD.java | 6 ++-- .../dev/plex/command/impl/MobLimitCMD.java | 7 ++--- .../dev/plex/command/impl/MobPurgeCMD.java | 9 +++--- .../java/dev/plex/command/impl/MuteCMD.java | 7 ++--- .../java/dev/plex/command/impl/NotesCMD.java | 16 +++++----- .../java/dev/plex/command/impl/PlexCMD.java | 9 +++--- .../dev/plex/command/impl/PunishmentsCMD.java | 3 +- .../java/dev/plex/command/impl/RawSayCMD.java | 6 ++-- .../command/impl/RemoveLoginMessageCMD.java | 3 +- .../java/dev/plex/command/impl/SayCMD.java | 5 ++- .../plex/command/impl/SetLoginMessageCMD.java | 3 +- .../java/dev/plex/command/impl/SmiteCMD.java | 10 +++--- .../dev/plex/command/impl/SpectatorCMD.java | 4 +-- .../dev/plex/command/impl/SurvivalCMD.java | 4 +-- .../java/dev/plex/command/impl/TagCMD.java | 8 ++--- .../dev/plex/command/impl/TempbanCMD.java | 5 ++- .../dev/plex/command/impl/TempmuteCMD.java | 9 +++--- .../java/dev/plex/command/impl/ToggleCMD.java | 3 +- .../java/dev/plex/command/impl/UnbanCMD.java | 3 +- .../dev/plex/command/impl/UnfreezeCMD.java | 3 +- .../java/dev/plex/command/impl/UnmuteCMD.java | 3 +- .../java/dev/plex/command/impl/WhoHasCMD.java | 7 ++--- .../java/dev/plex/command/impl/WorldCMD.java | 7 ++--- .../src/main/java/dev/plex/config/Config.java | 3 +- .../java/dev/plex/config/ModuleConfig.java | 5 ++- .../java/dev/plex/hook/CoreProtectHook.java | 11 ------- .../main/java/dev/plex/hook/VaultHook.java | 3 +- .../dev/plex/listener/impl/BlockListener.java | 7 ++--- .../main/java/dev/plex/menu/AbstractMenu.java | 8 +---- .../java/dev/plex/menu/impl/MaterialMenu.java | 9 ++---- .../plex/menu/impl/PunishedPlayerMenu.java | 3 +- .../dev/plex/menu/impl/PunishmentMenu.java | 7 +---- .../java/dev/plex/menu/impl/ToggleMenu.java | 7 +++-- .../plex/menu/pagination/PageableMenu.java | 10 ++---- .../main/java/dev/plex/meta/PlayerMeta.java | 1 - .../java/dev/plex/module/ModuleManager.java | 7 ++--- .../main/java/dev/plex/module/PlexModule.java | 15 +++++---- .../java/dev/plex/module/PlexModuleFile.java | 3 +- .../main/java/dev/plex/player/PlexPlayer.java | 8 ++--- .../plex/punishment/PunishmentManager.java | 6 ---- .../plex/storage/player/SQLPlayerData.java | 1 - .../dev/plex/storage/punishment/SQLNotes.java | 1 - .../storage/punishment/SQLPunishment.java | 1 - .../main/java/dev/plex/util/BuildInfo.java | 3 +- .../main/java/dev/plex/util/GameRuleUtil.java | 3 +- .../main/java/dev/plex/util/PlexUtils.java | 31 +++++++++---------- .../main/java/dev/plex/util/RandomUtil.java | 3 +- .../java/dev/plex/util/ReflectionsUtil.java | 1 - .../main/java/dev/plex/util/TimeUtils.java | 3 +- .../java/dev/plex/util/UpdateChecker.java | 21 ++++++------- .../util/adapter/ZonedDateTimeAdapter.java | 9 ++++-- .../function/ConditionalQuadConsumer.java | 4 --- .../dev/plex/util/function/QuadConsumer.java | 4 --- .../java/dev/plex/util/item/ItemBuilder.java | 3 +- .../util/minimessage/SafeMiniMessage.java | 3 +- .../java/dev/plex/util/redis/MessageUtil.java | 5 +-- .../main/java/dev/plex/util/sql/SQLUtil.java | 19 ++++++++---- .../main/java/dev/plex/util/sql/Table.java | 7 ++--- .../plex/world/BlockMapChunkGenerator.java | 5 ++- .../world/ConfigurationChunkGenerator.java | 3 +- .../dev/plex/world/CustomChunkGenerator.java | 7 ++--- .../main/java/dev/plex/world/CustomWorld.java | 5 ++- .../dev/plex/world/FlatChunkGenerator.java | 3 +- .../dev/plex/world/NoiseChunkGenerator.java | 3 +- .../dev/plex/world/OctaveChunkGenerator.java | 3 +- 105 files changed, 257 insertions(+), 360 deletions(-) diff --git a/proxy/src/main/java/dev/plex/Plex.java b/proxy/src/main/java/dev/plex/Plex.java index b0044e7..e11f520 100644 --- a/proxy/src/main/java/dev/plex/Plex.java +++ b/proxy/src/main/java/dev/plex/Plex.java @@ -10,11 +10,10 @@ import dev.plex.config.TomlConfig; import dev.plex.handlers.ListenerHandler; import dev.plex.settings.ServerSettings; import dev.plex.util.PlexLog; -import lombok.Getter; - import java.io.File; import java.nio.file.Path; import java.util.logging.Logger; +import lombok.Getter; /** * Credits for TOML library go to https://github.com/mwanji/toml4j diff --git a/proxy/src/main/java/dev/plex/command/PlexCommand.java b/proxy/src/main/java/dev/plex/command/PlexCommand.java index 7753aee..b048516 100644 --- a/proxy/src/main/java/dev/plex/command/PlexCommand.java +++ b/proxy/src/main/java/dev/plex/command/PlexCommand.java @@ -9,13 +9,12 @@ import dev.plex.Plex; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; +import java.util.Arrays; import net.kyori.adventure.audience.Audience; import net.kyori.adventure.text.Component; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Arrays; - public abstract class PlexCommand implements SimpleCommand { /** diff --git a/proxy/src/main/java/dev/plex/command/annotation/CommandPermissions.java b/proxy/src/main/java/dev/plex/command/annotation/CommandPermissions.java index 1738d6f..0c67abe 100644 --- a/proxy/src/main/java/dev/plex/command/annotation/CommandPermissions.java +++ b/proxy/src/main/java/dev/plex/command/annotation/CommandPermissions.java @@ -1,7 +1,6 @@ package dev.plex.command.annotation; import dev.plex.command.source.RequiredCommandSource; - import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/proxy/src/main/java/dev/plex/config/TomlConfig.java b/proxy/src/main/java/dev/plex/config/TomlConfig.java index a392c89..2c4ce04 100644 --- a/proxy/src/main/java/dev/plex/config/TomlConfig.java +++ b/proxy/src/main/java/dev/plex/config/TomlConfig.java @@ -3,13 +3,12 @@ package dev.plex.config; import dev.plex.Plex; import dev.plex.toml.Toml; import dev.plex.toml.TomlWriter; -import lombok.Getter; -import lombok.Setter; - import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.util.function.Consumer; +import lombok.Getter; +import lombok.Setter; @Getter public class TomlConfig diff --git a/proxy/src/main/java/dev/plex/handlers/ListenerHandler.java b/proxy/src/main/java/dev/plex/handlers/ListenerHandler.java index 88f5450..c800324 100644 --- a/proxy/src/main/java/dev/plex/handlers/ListenerHandler.java +++ b/proxy/src/main/java/dev/plex/handlers/ListenerHandler.java @@ -4,7 +4,6 @@ import com.google.common.collect.Lists; import dev.plex.listener.PlexListener; import dev.plex.util.PlexLog; import dev.plex.util.ReflectionsUtil; - import java.lang.reflect.InvocationTargetException; import java.util.List; import java.util.Set; diff --git a/proxy/src/main/java/dev/plex/listener/impl/ServerListener.java b/proxy/src/main/java/dev/plex/listener/impl/ServerListener.java index e8983c9..7e9de8f 100644 --- a/proxy/src/main/java/dev/plex/listener/impl/ServerListener.java +++ b/proxy/src/main/java/dev/plex/listener/impl/ServerListener.java @@ -7,14 +7,13 @@ import com.velocitypowered.api.proxy.server.ServerPing; import dev.plex.listener.PlexListener; import dev.plex.settings.ServerSettings; import dev.plex.util.RandomUtil; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.minimessage.MiniMessage; - import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Matcher; import java.util.regex.Pattern; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.minimessage.MiniMessage; public class ServerListener extends PlexListener { diff --git a/proxy/src/main/java/dev/plex/settings/ServerSettings.java b/proxy/src/main/java/dev/plex/settings/ServerSettings.java index 2e30f37..38a245b 100644 --- a/proxy/src/main/java/dev/plex/settings/ServerSettings.java +++ b/proxy/src/main/java/dev/plex/settings/ServerSettings.java @@ -2,11 +2,10 @@ package dev.plex.settings; import com.google.common.collect.Lists; import com.google.gson.annotations.SerializedName; +import java.util.List; import lombok.Data; import lombok.Getter; -import java.util.List; - @Getter public class ServerSettings { diff --git a/proxy/src/main/java/dev/plex/toml/ArrayValueWriter.java b/proxy/src/main/java/dev/plex/toml/ArrayValueWriter.java index 8421569..a7184e6 100644 --- a/proxy/src/main/java/dev/plex/toml/ArrayValueWriter.java +++ b/proxy/src/main/java/dev/plex/toml/ArrayValueWriter.java @@ -4,7 +4,6 @@ package dev.plex.toml; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; - import static dev.plex.toml.ValueWriters.WRITERS; public abstract class ArrayValueWriter implements dev.plex.toml.ValueWriter diff --git a/proxy/src/main/java/dev/plex/toml/ObjectValueWriter.java b/proxy/src/main/java/dev/plex/toml/ObjectValueWriter.java index 8f4ab67..ec164ac 100644 --- a/proxy/src/main/java/dev/plex/toml/ObjectValueWriter.java +++ b/proxy/src/main/java/dev/plex/toml/ObjectValueWriter.java @@ -1,10 +1,14 @@ package dev.plex.toml; import com.google.gson.annotations.SerializedName; - import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.util.*; +import java.util.Arrays; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; class ObjectValueWriter implements ValueWriter { diff --git a/proxy/src/main/java/dev/plex/toml/Results.java b/proxy/src/main/java/dev/plex/toml/Results.java index 7e99f10..64648ba 100644 --- a/proxy/src/main/java/dev/plex/toml/Results.java +++ b/proxy/src/main/java/dev/plex/toml/Results.java @@ -1,6 +1,11 @@ package dev.plex.toml; -import java.util.*; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; class Results diff --git a/proxy/src/main/java/dev/plex/toml/TableArrayValueWriter.java b/proxy/src/main/java/dev/plex/toml/TableArrayValueWriter.java index 844295e..0dce137 100644 --- a/proxy/src/main/java/dev/plex/toml/TableArrayValueWriter.java +++ b/proxy/src/main/java/dev/plex/toml/TableArrayValueWriter.java @@ -1,7 +1,6 @@ package dev.plex.toml; import java.util.Collection; - import static dev.plex.toml.ValueWriters.WRITERS; class TableArrayValueWriter extends ArrayValueWriter diff --git a/proxy/src/main/java/dev/plex/toml/Toml.java b/proxy/src/main/java/dev/plex/toml/Toml.java index 980ad1f..b4e319a 100644 --- a/proxy/src/main/java/dev/plex/toml/Toml.java +++ b/proxy/src/main/java/dev/plex/toml/Toml.java @@ -2,11 +2,22 @@ package dev.plex.toml; import com.google.gson.Gson; import com.google.gson.JsonElement; -import lombok.Getter; - -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import lombok.Getter; /** *

Provides access to the keys and tables in a TOML data source.

diff --git a/proxy/src/main/java/dev/plex/toml/TomlWriter.java b/proxy/src/main/java/dev/plex/toml/TomlWriter.java index 284ec23..d2e653e 100644 --- a/proxy/src/main/java/dev/plex/toml/TomlWriter.java +++ b/proxy/src/main/java/dev/plex/toml/TomlWriter.java @@ -1,13 +1,17 @@ package dev.plex.toml; -import org.jetbrains.annotations.Nullable; - -import java.io.*; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; import java.util.TimeZone; - +import org.jetbrains.annotations.Nullable; import static dev.plex.toml.ValueWriters.WRITERS; /** diff --git a/proxy/src/main/java/dev/plex/toml/ValueReaders.java b/proxy/src/main/java/dev/plex/toml/ValueReaders.java index 114ae7c..4c894d0 100644 --- a/proxy/src/main/java/dev/plex/toml/ValueReaders.java +++ b/proxy/src/main/java/dev/plex/toml/ValueReaders.java @@ -1,7 +1,6 @@ package dev.plex.toml; import java.util.concurrent.atomic.AtomicInteger; - import static dev.plex.toml.ArrayValueReader.ARRAY_VALUE_READER; import static dev.plex.toml.BooleanValueReaderWriter.BOOLEAN_VALUE_READER_WRITER; import static dev.plex.toml.DateValueReaderWriter.DATE_VALUE_READER_WRITER; diff --git a/proxy/src/main/java/dev/plex/util/RandomUtil.java b/proxy/src/main/java/dev/plex/util/RandomUtil.java index 6770bf1..0e639b6 100644 --- a/proxy/src/main/java/dev/plex/util/RandomUtil.java +++ b/proxy/src/main/java/dev/plex/util/RandomUtil.java @@ -1,8 +1,7 @@ package dev.plex.util; -import net.kyori.adventure.text.format.NamedTextColor; - import java.util.concurrent.ThreadLocalRandom; +import net.kyori.adventure.text.format.NamedTextColor; public class RandomUtil { diff --git a/proxy/src/main/java/dev/plex/util/ReflectionsUtil.java b/proxy/src/main/java/dev/plex/util/ReflectionsUtil.java index eaae5bb..2e6c948 100644 --- a/proxy/src/main/java/dev/plex/util/ReflectionsUtil.java +++ b/proxy/src/main/java/dev/plex/util/ReflectionsUtil.java @@ -3,7 +3,6 @@ package dev.plex.util; import com.google.common.collect.ImmutableSet; import com.google.common.reflect.ClassPath; import dev.plex.Plex; - import java.io.IOException; import java.util.Arrays; import java.util.Collections; diff --git a/server/src/main/java/dev/plex/cache/DataUtils.java b/server/src/main/java/dev/plex/cache/DataUtils.java index 6d0d195..4be8c80 100644 --- a/server/src/main/java/dev/plex/cache/DataUtils.java +++ b/server/src/main/java/dev/plex/cache/DataUtils.java @@ -2,8 +2,6 @@ package dev.plex.cache; import dev.plex.Plex; import dev.plex.player.PlexPlayer; -import dev.plex.storage.StorageType; - import java.util.Optional; import java.util.UUID; diff --git a/server/src/main/java/dev/plex/cache/PlayerCache.java b/server/src/main/java/dev/plex/cache/PlayerCache.java index a70734f..a6b91c6 100644 --- a/server/src/main/java/dev/plex/cache/PlayerCache.java +++ b/server/src/main/java/dev/plex/cache/PlayerCache.java @@ -2,7 +2,6 @@ package dev.plex.cache; import com.google.common.collect.Maps; import dev.plex.player.PlexPlayer; - import java.util.Map; import java.util.UUID; diff --git a/server/src/main/java/dev/plex/command/PlexCommand.java b/server/src/main/java/dev/plex/command/PlexCommand.java index 998046c..7ac4f0e 100644 --- a/server/src/main/java/dev/plex/command/PlexCommand.java +++ b/server/src/main/java/dev/plex/command/PlexCommand.java @@ -5,27 +5,34 @@ import dev.plex.Plex; import dev.plex.cache.DataUtils; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; -import dev.plex.command.exception.*; +import dev.plex.command.exception.CommandFailException; +import dev.plex.command.exception.ConsoleMustDefinePlayerException; +import dev.plex.command.exception.ConsoleOnlyException; +import dev.plex.command.exception.PlayerNotBannedException; +import dev.plex.command.exception.PlayerNotFoundException; import dev.plex.command.source.RequiredCommandSource; import dev.plex.player.PlexPlayer; import dev.plex.util.PlexLog; import dev.plex.util.PlexUtils; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; import net.kyori.adventure.audience.Audience; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import org.bukkit.Bukkit; import org.bukkit.World; -import org.bukkit.command.*; +import org.bukkit.command.Command; +import org.bukkit.command.CommandMap; +import org.bukkit.command.CommandSender; +import org.bukkit.command.ConsoleCommandSender; +import org.bukkit.command.PluginIdentifiableCommand; import org.bukkit.entity.Player; import org.bukkit.util.StringUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; - /** * Superclass for all commands */ diff --git a/server/src/main/java/dev/plex/command/annotation/CommandPermissions.java b/server/src/main/java/dev/plex/command/annotation/CommandPermissions.java index 1738d6f..0c67abe 100644 --- a/server/src/main/java/dev/plex/command/annotation/CommandPermissions.java +++ b/server/src/main/java/dev/plex/command/annotation/CommandPermissions.java @@ -1,7 +1,6 @@ package dev.plex.command.annotation; import dev.plex.command.source.RequiredCommandSource; - import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/server/src/main/java/dev/plex/command/blocking/BlockedCommand.java b/server/src/main/java/dev/plex/command/blocking/BlockedCommand.java index dda3f2f..667afa4 100644 --- a/server/src/main/java/dev/plex/command/blocking/BlockedCommand.java +++ b/server/src/main/java/dev/plex/command/blocking/BlockedCommand.java @@ -1,11 +1,10 @@ package dev.plex.command.blocking; import com.google.common.collect.Lists; +import java.util.List; import lombok.Data; import net.kyori.adventure.text.Component; -import java.util.List; - @Data public class BlockedCommand { diff --git a/server/src/main/java/dev/plex/command/impl/AdminChatCMD.java b/server/src/main/java/dev/plex/command/impl/AdminChatCMD.java index 59d3003..a5c5a8b 100644 --- a/server/src/main/java/dev/plex/command/impl/AdminChatCMD.java +++ b/server/src/main/java/dev/plex/command/impl/AdminChatCMD.java @@ -10,6 +10,9 @@ import dev.plex.util.PlexLog; import dev.plex.util.PlexUtils; import dev.plex.util.minimessage.SafeMiniMessage; import dev.plex.util.redis.MessageUtil; +import java.util.Collections; +import java.util.List; +import java.util.UUID; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; @@ -18,10 +21,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; -import java.util.UUID; - @CommandPermissions(permission = "plex.adminchat", source = RequiredCommandSource.ANY) @CommandParameters(name = "adminchat", description = "Talk privately with other admins", usage = "/ ", aliases = "o,ac,sc,staffchat") public class AdminChatCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/AdminworldCMD.java b/server/src/main/java/dev/plex/command/impl/AdminworldCMD.java index 4955746..cc692cc 100644 --- a/server/src/main/java/dev/plex/command/impl/AdminworldCMD.java +++ b/server/src/main/java/dev/plex/command/impl/AdminworldCMD.java @@ -4,6 +4,8 @@ import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -12,9 +14,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.adminworld", source = RequiredCommandSource.IN_GAME) @CommandParameters(name = "adminworld", aliases = "aw", description = "Teleport to the adminworld") public class AdminworldCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/AdventureCMD.java b/server/src/main/java/dev/plex/command/impl/AdventureCMD.java index 0793110..94d0070 100644 --- a/server/src/main/java/dev/plex/command/impl/AdventureCMD.java +++ b/server/src/main/java/dev/plex/command/impl/AdventureCMD.java @@ -8,6 +8,7 @@ import dev.plex.command.exception.CommandFailException; import dev.plex.command.source.RequiredCommandSource; import dev.plex.event.GameModeUpdateEvent; import dev.plex.util.PlexUtils; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -16,8 +17,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandPermissions(permission = "plex.gamemode.adventure", source = RequiredCommandSource.ANY) @CommandParameters(name = "adventure", aliases = "gma,egma,eadventure,adventuremode,eadventuremode", description = "Set your own or another player's gamemode to adventure mode") public class AdventureCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/BanCMD.java b/server/src/main/java/dev/plex/command/impl/BanCMD.java index 974328c..a941fac 100644 --- a/server/src/main/java/dev/plex/command/impl/BanCMD.java +++ b/server/src/main/java/dev/plex/command/impl/BanCMD.java @@ -13,6 +13,10 @@ import dev.plex.util.BungeeUtil; import dev.plex.util.PlexLog; import dev.plex.util.PlexUtils; import dev.plex.util.TimeUtils; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.Bukkit; @@ -21,11 +25,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.Collections; -import java.util.List; - @CommandParameters(name = "ban", usage = "/ [reason] [-rb]", aliases = "offlineban,gtfo", description = "Bans a player, offline or online") @CommandPermissions(permission = "plex.ban", source = RequiredCommandSource.ANY) diff --git a/server/src/main/java/dev/plex/command/impl/BanListCommand.java b/server/src/main/java/dev/plex/command/impl/BanListCommand.java index b937c97..f666ea8 100755 --- a/server/src/main/java/dev/plex/command/impl/BanListCommand.java +++ b/server/src/main/java/dev/plex/command/impl/BanListCommand.java @@ -5,6 +5,8 @@ import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.punishment.Punishment; +import java.util.List; +import java.util.stream.Collectors; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.command.CommandSender; @@ -12,10 +14,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - @CommandParameters(name = "banlist", description = "Manages the banlist", usage = "/ [purge]") @CommandPermissions(permission = "plex.banlist") public class BanListCommand extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/BcastLoginMessageCMD.java b/server/src/main/java/dev/plex/command/impl/BcastLoginMessageCMD.java index 2eac9e4..4513231 100644 --- a/server/src/main/java/dev/plex/command/impl/BcastLoginMessageCMD.java +++ b/server/src/main/java/dev/plex/command/impl/BcastLoginMessageCMD.java @@ -10,14 +10,13 @@ import dev.plex.command.source.RequiredCommandSource; import dev.plex.meta.PlayerMeta; import dev.plex.player.PlexPlayer; import dev.plex.util.PlexUtils; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandPermissions(permission = "plex.broadcastloginmessage", source = RequiredCommandSource.ANY) @CommandParameters(name = "bcastloginmessage", usage = "/ ", description = "Broadcast your login message (for vanish support)", aliases = "bcastlm") public class BcastLoginMessageCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/BlockEditCMD.java b/server/src/main/java/dev/plex/command/impl/BlockEditCMD.java index 654c542..0f028e6 100644 --- a/server/src/main/java/dev/plex/command/impl/BlockEditCMD.java +++ b/server/src/main/java/dev/plex/command/impl/BlockEditCMD.java @@ -5,6 +5,10 @@ import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.listener.impl.BlockListener; import dev.plex.util.PlexUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; @@ -12,11 +16,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.blockedit") @CommandParameters(name = "blockedit", usage = "/ [list | purge | all | ]", aliases = "bedit", description = "Prevent players from modifying blocks") public class BlockEditCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/CommandSpyCMD.java b/server/src/main/java/dev/plex/command/impl/CommandSpyCMD.java index f1e2078..f9daebc 100644 --- a/server/src/main/java/dev/plex/command/impl/CommandSpyCMD.java +++ b/server/src/main/java/dev/plex/command/impl/CommandSpyCMD.java @@ -6,15 +6,14 @@ import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.player.PlexPlayer; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.commandspy", source = RequiredCommandSource.IN_GAME) @CommandParameters(name = "commandspy", aliases = "cmdspy", description = "Spy on other player's commands") public class CommandSpyCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/ConsoleSayCMD.java b/server/src/main/java/dev/plex/command/impl/ConsoleSayCMD.java index 65d5d28..4fd146f 100644 --- a/server/src/main/java/dev/plex/command/impl/ConsoleSayCMD.java +++ b/server/src/main/java/dev/plex/command/impl/ConsoleSayCMD.java @@ -5,6 +5,8 @@ import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.util.PlexUtils; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.command.CommandSender; @@ -12,9 +14,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.consolesay", source = RequiredCommandSource.CONSOLE) @CommandParameters(name = "consolesay", usage = "/ ", description = "Displays a message to everyone", aliases = "csay") public class ConsoleSayCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/CreativeCMD.java b/server/src/main/java/dev/plex/command/impl/CreativeCMD.java index ed13276..ab8b780 100644 --- a/server/src/main/java/dev/plex/command/impl/CreativeCMD.java +++ b/server/src/main/java/dev/plex/command/impl/CreativeCMD.java @@ -8,6 +8,7 @@ import dev.plex.command.exception.CommandFailException; import dev.plex.command.source.RequiredCommandSource; import dev.plex.event.GameModeUpdateEvent; import dev.plex.util.PlexUtils; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -16,8 +17,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandPermissions(permission = "plex.gamemode.creative", source = RequiredCommandSource.ANY) @CommandParameters(name = "creative", aliases = "gmc,egmc,ecreative,eecreative,creativemode,ecreativemode", description = "Set your own or another player's gamemode to creative mode") public class CreativeCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/DebugCMD.java b/server/src/main/java/dev/plex/command/impl/DebugCMD.java index 02f6a2c..ae64d58 100644 --- a/server/src/main/java/dev/plex/command/impl/DebugCMD.java +++ b/server/src/main/java/dev/plex/command/impl/DebugCMD.java @@ -8,8 +8,10 @@ import dev.plex.menu.impl.MaterialMenu; import dev.plex.util.GameRuleUtil; import dev.plex.util.PlexLog; import dev.plex.util.PlexUtils; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.command.Command; @@ -18,10 +20,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; - @CommandParameters(name = "pdebug", description = "Plex's debug command", usage = "/ | redis-reset | gamerules>") @CommandPermissions(permission = "plex.debug") public class DebugCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/EntityWipeCMD.java b/server/src/main/java/dev/plex/command/impl/EntityWipeCMD.java index 936ee32..e4e49c4 100644 --- a/server/src/main/java/dev/plex/command/impl/EntityWipeCMD.java +++ b/server/src/main/java/dev/plex/command/impl/EntityWipeCMD.java @@ -6,6 +6,12 @@ import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.util.PlexLog; import dev.plex.util.PlexUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.World; @@ -16,8 +22,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.*; - @CommandPermissions(permission = "plex.entitywipe", source = RequiredCommandSource.ANY) @CommandParameters(name = "entitywipe", description = "Remove various server entities that may cause lag, such as dropped items, minecarts, and boats.", usage = "/ [entity] [radius]", aliases = "ew,rd") public class EntityWipeCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/FlatlandsCMD.java b/server/src/main/java/dev/plex/command/impl/FlatlandsCMD.java index 052a28a..2c74f02 100644 --- a/server/src/main/java/dev/plex/command/impl/FlatlandsCMD.java +++ b/server/src/main/java/dev/plex/command/impl/FlatlandsCMD.java @@ -4,6 +4,8 @@ import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -12,9 +14,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.flatlands", source = RequiredCommandSource.IN_GAME) @CommandParameters(name = "flatlands", description = "Teleport to the flatlands") public class FlatlandsCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/FreezeCMD.java b/server/src/main/java/dev/plex/command/impl/FreezeCMD.java index 3819a83..2284493 100644 --- a/server/src/main/java/dev/plex/command/impl/FreezeCMD.java +++ b/server/src/main/java/dev/plex/command/impl/FreezeCMD.java @@ -9,16 +9,15 @@ import dev.plex.punishment.Punishment; import dev.plex.punishment.PunishmentType; import dev.plex.util.PlexUtils; import dev.plex.util.TimeUtils; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.List; - @CommandParameters(name = "freeze", description = "Freeze a player on the server", usage = "/ ", aliases = "fr") @CommandPermissions(permission = "plex.freeze") public class FreezeCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/GamemodeCMD.java b/server/src/main/java/dev/plex/command/impl/GamemodeCMD.java index 406c38d..e53e365 100644 --- a/server/src/main/java/dev/plex/command/impl/GamemodeCMD.java +++ b/server/src/main/java/dev/plex/command/impl/GamemodeCMD.java @@ -7,6 +7,9 @@ import dev.plex.command.exception.CommandFailException; import dev.plex.command.source.RequiredCommandSource; import dev.plex.event.GameModeUpdateEvent; import dev.plex.util.PlexUtils; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -15,10 +18,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - @CommandParameters(name = "gamemode", usage = "/ [player]", description = "Change your gamemode", aliases = "gm,egamemode,gmt,egmt") @CommandPermissions(permission = "plex.gamemode", source = RequiredCommandSource.ANY) public class GamemodeCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/KickCMD.java b/server/src/main/java/dev/plex/command/impl/KickCMD.java index af15a5c..a523209 100644 --- a/server/src/main/java/dev/plex/command/impl/KickCMD.java +++ b/server/src/main/java/dev/plex/command/impl/KickCMD.java @@ -13,6 +13,9 @@ import dev.plex.punishment.PunishmentType; import dev.plex.util.BungeeUtil; import dev.plex.util.PlexUtils; import dev.plex.util.TimeUtils; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.List; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.Bukkit; @@ -21,10 +24,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.List; - @CommandParameters(name = "kick", description = "Kicks a player", usage = "/ ") @CommandPermissions(permission = "plex.kick", source = RequiredCommandSource.ANY) public class KickCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/ListCMD.java b/server/src/main/java/dev/plex/command/impl/ListCMD.java index d2963b3..b2dd333 100644 --- a/server/src/main/java/dev/plex/command/impl/ListCMD.java +++ b/server/src/main/java/dev/plex/command/impl/ListCMD.java @@ -2,11 +2,13 @@ package dev.plex.command.impl; import com.google.common.collect.Lists; import dev.plex.command.PlexCommand; -import dev.plex.util.PlexUtils; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.hook.VaultHook; import dev.plex.meta.PlayerMeta; +import dev.plex.util.PlexUtils; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.Bukkit; @@ -15,9 +17,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandParameters(name = "list", description = "Show a list of all online players", usage = "/ [-d | -v]", aliases = "lsit,who,playerlist,online") @CommandPermissions(permission = "plex.list") public class ListCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/LocalSpawnCMD.java b/server/src/main/java/dev/plex/command/impl/LocalSpawnCMD.java index 863261a..89fdb9e 100644 --- a/server/src/main/java/dev/plex/command/impl/LocalSpawnCMD.java +++ b/server/src/main/java/dev/plex/command/impl/LocalSpawnCMD.java @@ -4,16 +4,14 @@ import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; - +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandParameters(name = "localspawn", description = "Teleport to the spawnpoint of the world you are in") @CommandPermissions(permission = "plex.localspawn", source = RequiredCommandSource.IN_GAME) public class LocalSpawnCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/LockupCMD.java b/server/src/main/java/dev/plex/command/impl/LockupCMD.java index 46deb8b..4512cfb 100644 --- a/server/src/main/java/dev/plex/command/impl/LockupCMD.java +++ b/server/src/main/java/dev/plex/command/impl/LockupCMD.java @@ -6,14 +6,13 @@ import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.player.PlexPlayer; import dev.plex.util.PlexUtils; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandParameters(name = "lockup", description = "Lockup a player on the server", usage = "/ ") @CommandPermissions(permission = "plex.lockup") public class LockupCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/MasterbuilderworldCMD.java b/server/src/main/java/dev/plex/command/impl/MasterbuilderworldCMD.java index e4c7052..3231ae4 100644 --- a/server/src/main/java/dev/plex/command/impl/MasterbuilderworldCMD.java +++ b/server/src/main/java/dev/plex/command/impl/MasterbuilderworldCMD.java @@ -4,7 +4,8 @@ import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; - +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -13,9 +14,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.masterbuilderworld", source = RequiredCommandSource.IN_GAME) @CommandParameters(name = "masterbuilderworld", aliases = "mbw", description = "Teleport to the Master Builder world") public class MasterbuilderworldCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/MobLimitCMD.java b/server/src/main/java/dev/plex/command/impl/MobLimitCMD.java index 70dfcaa..d5f2150 100644 --- a/server/src/main/java/dev/plex/command/impl/MobLimitCMD.java +++ b/server/src/main/java/dev/plex/command/impl/MobLimitCMD.java @@ -5,6 +5,9 @@ import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.util.PlexUtils; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.Chunk; @@ -14,10 +17,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - @CommandParameters(name = "moblimit", usage = "/ [on | off | setmax ]", aliases = "entitylimit", description = "Manages the mob limit per chunk.") @CommandPermissions(permission = "plex.moblimit", source = RequiredCommandSource.ANY) public class MobLimitCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/MobPurgeCMD.java b/server/src/main/java/dev/plex/command/impl/MobPurgeCMD.java index d481dcc..1351f9e 100644 --- a/server/src/main/java/dev/plex/command/impl/MobPurgeCMD.java +++ b/server/src/main/java/dev/plex/command/impl/MobPurgeCMD.java @@ -6,6 +6,10 @@ import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.util.PlexLog; import dev.plex.util.PlexUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.text.WordUtils; import org.bukkit.Bukkit; @@ -18,11 +22,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.mobpurge", source = RequiredCommandSource.ANY) @CommandParameters(name = "mobpurge", description = "Purge all mobs.", usage = "/ [mob]", aliases = "mp") public class MobPurgeCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/MuteCMD.java b/server/src/main/java/dev/plex/command/impl/MuteCMD.java index 06313e1..96cd608 100644 --- a/server/src/main/java/dev/plex/command/impl/MuteCMD.java +++ b/server/src/main/java/dev/plex/command/impl/MuteCMD.java @@ -9,16 +9,15 @@ import dev.plex.punishment.Punishment; import dev.plex.punishment.PunishmentType; import dev.plex.util.PlexUtils; import dev.plex.util.TimeUtils; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.List; - @CommandParameters(name = "mute", description = "Mute a player on the server", usage = "/ ", aliases = "stfu") @CommandPermissions(permission = "plex.mute") public class MuteCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/NotesCMD.java b/server/src/main/java/dev/plex/command/impl/NotesCMD.java index ab36610..eb4cdb0 100644 --- a/server/src/main/java/dev/plex/command/impl/NotesCMD.java +++ b/server/src/main/java/dev/plex/command/impl/NotesCMD.java @@ -8,21 +8,19 @@ import dev.plex.player.PlexPlayer; import dev.plex.punishment.extra.Note; import dev.plex.util.PlexUtils; import dev.plex.util.TimeUtils; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.format.NamedTextColor; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicReference; +import net.kyori.adventure.text.Component; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; @CommandParameters(name = "notes", description = "Manage notes for a player", usage = "/ | remove | clear>") @CommandPermissions(permission = "plex.notes") diff --git a/server/src/main/java/dev/plex/command/impl/PlexCMD.java b/server/src/main/java/dev/plex/command/impl/PlexCMD.java index 4c11ef5..ce8495f 100644 --- a/server/src/main/java/dev/plex/command/impl/PlexCMD.java +++ b/server/src/main/java/dev/plex/command/impl/PlexCMD.java @@ -10,6 +10,10 @@ import dev.plex.module.PlexModuleFile; import dev.plex.util.BuildInfo; import dev.plex.util.PlexUtils; import dev.plex.util.TimeUtils; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.Bukkit; @@ -19,11 +23,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - @CommandPermissions(source = RequiredCommandSource.ANY) @CommandParameters(name = "plex", usage = "/ [reload | redis | modules [reload]]", description = "Show information about Plex or reload it") public class PlexCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/PunishmentsCMD.java b/server/src/main/java/dev/plex/command/impl/PunishmentsCMD.java index f2e3d30..22a7f7f 100644 --- a/server/src/main/java/dev/plex/command/impl/PunishmentsCMD.java +++ b/server/src/main/java/dev/plex/command/impl/PunishmentsCMD.java @@ -11,6 +11,7 @@ import dev.plex.menu.impl.PunishedPlayerMenu; import dev.plex.menu.impl.PunishmentMenu; import dev.plex.player.PlexPlayer; import dev.plex.util.PlexUtils; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; @@ -19,8 +20,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandParameters(name = "punishments", usage = "/ [player]", description = "Opens the Punishments GUI", aliases = "punishlist,punishes") @CommandPermissions(permission = "plex.punishments", source = RequiredCommandSource.IN_GAME) public class PunishmentsCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/RawSayCMD.java b/server/src/main/java/dev/plex/command/impl/RawSayCMD.java index 7915bbf..057305a 100644 --- a/server/src/main/java/dev/plex/command/impl/RawSayCMD.java +++ b/server/src/main/java/dev/plex/command/impl/RawSayCMD.java @@ -4,8 +4,9 @@ import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; - import dev.plex.util.PlexUtils; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.command.CommandSender; @@ -13,9 +14,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.rawsay", source = RequiredCommandSource.ANY) @CommandParameters(name = "rawsay", usage = "/ ", description = "Displays a raw message to everyone") public class RawSayCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/RemoveLoginMessageCMD.java b/server/src/main/java/dev/plex/command/impl/RemoveLoginMessageCMD.java index 8175fc8..0f6a6bc 100644 --- a/server/src/main/java/dev/plex/command/impl/RemoveLoginMessageCMD.java +++ b/server/src/main/java/dev/plex/command/impl/RemoveLoginMessageCMD.java @@ -8,14 +8,13 @@ import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.player.PlexPlayer; import dev.plex.util.PlexUtils; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandPermissions(permission = "plex.removeloginmessage", source = RequiredCommandSource.ANY) @CommandParameters(name = "removeloginmessage", usage = "/ [-o ]", description = "Remove your own (or someone else's) login message", aliases = "rlm,removeloginmsg") public class RemoveLoginMessageCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/SayCMD.java b/server/src/main/java/dev/plex/command/impl/SayCMD.java index 80e0b4f..6696665 100644 --- a/server/src/main/java/dev/plex/command/impl/SayCMD.java +++ b/server/src/main/java/dev/plex/command/impl/SayCMD.java @@ -5,6 +5,8 @@ import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.util.PlexUtils; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.command.CommandSender; @@ -12,9 +14,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.say", source = RequiredCommandSource.ANY) @CommandParameters(name = "say", usage = "/ ", description = "Displays a message to everyone") public class SayCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/SetLoginMessageCMD.java b/server/src/main/java/dev/plex/command/impl/SetLoginMessageCMD.java index 2aadd34..2bc9269 100644 --- a/server/src/main/java/dev/plex/command/impl/SetLoginMessageCMD.java +++ b/server/src/main/java/dev/plex/command/impl/SetLoginMessageCMD.java @@ -10,6 +10,7 @@ import dev.plex.command.source.RequiredCommandSource; import dev.plex.player.PlexPlayer; import dev.plex.util.PlexLog; import dev.plex.util.PlexUtils; +import java.util.List; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage; import org.apache.commons.lang3.StringUtils; @@ -18,8 +19,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandPermissions(permission = "plex.setloginmessage", source = RequiredCommandSource.ANY) @CommandParameters(name = "setloginmessage", usage = "/ [-o ] ", description = "Sets your (or someone else's) login message", aliases = "slm,setloginmsg") public class SetLoginMessageCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/SmiteCMD.java b/server/src/main/java/dev/plex/command/impl/SmiteCMD.java index 58fa334..c3948b3 100644 --- a/server/src/main/java/dev/plex/command/impl/SmiteCMD.java +++ b/server/src/main/java/dev/plex/command/impl/SmiteCMD.java @@ -9,8 +9,11 @@ import dev.plex.punishment.Punishment; import dev.plex.punishment.PunishmentType; import dev.plex.util.PlexUtils; import dev.plex.util.TimeUtils; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.title.Title; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; @@ -22,11 +25,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.smite", source = RequiredCommandSource.ANY) @CommandParameters(name = "smite", usage = "/ [reason] [-ci | -q]", description = "Someone being a little bitch? Smite them down...") public class SmiteCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/SpectatorCMD.java b/server/src/main/java/dev/plex/command/impl/SpectatorCMD.java index 7e1b28a..d166526 100644 --- a/server/src/main/java/dev/plex/command/impl/SpectatorCMD.java +++ b/server/src/main/java/dev/plex/command/impl/SpectatorCMD.java @@ -7,8 +7,8 @@ import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.exception.CommandFailException; import dev.plex.command.source.RequiredCommandSource; import dev.plex.event.GameModeUpdateEvent; - import dev.plex.util.PlexUtils; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -17,8 +17,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandPermissions(permission = "plex.gamemode.spectator", source = RequiredCommandSource.ANY) @CommandParameters(name = "spectator", aliases = "gmsp,egmsp,spec", description = "Set your own or another player's gamemode to spectator mode") public class SpectatorCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/SurvivalCMD.java b/server/src/main/java/dev/plex/command/impl/SurvivalCMD.java index f73560c..7a51e88 100644 --- a/server/src/main/java/dev/plex/command/impl/SurvivalCMD.java +++ b/server/src/main/java/dev/plex/command/impl/SurvivalCMD.java @@ -7,8 +7,8 @@ import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.exception.CommandFailException; import dev.plex.command.source.RequiredCommandSource; import dev.plex.event.GameModeUpdateEvent; - import dev.plex.util.PlexUtils; +import java.util.List; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -17,8 +17,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; - @CommandPermissions(permission = "plex.gamemode.survival", source = RequiredCommandSource.ANY) @CommandParameters(name = "survival", aliases = "gms,egms,esurvival,survivalmode,esurvivalmode", description = "Set your own or another player's gamemode to survival mode") public class SurvivalCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/TagCMD.java b/server/src/main/java/dev/plex/command/impl/TagCMD.java index 0860ea8..e847a2c 100644 --- a/server/src/main/java/dev/plex/command/impl/TagCMD.java +++ b/server/src/main/java/dev/plex/command/impl/TagCMD.java @@ -7,7 +7,9 @@ import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.player.PlexPlayer; import dev.plex.util.PlexUtils; -import dev.plex.util.minimessage.SafeMiniMessage; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage; import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; @@ -18,10 +20,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - @CommandPermissions(permission = "plex.tag", source = RequiredCommandSource.ANY) @CommandParameters(name = "tag", aliases = "prefix", description = "Set or clear your prefix", usage = "/ | clear >") public class TagCMD extends PlexCommand diff --git a/server/src/main/java/dev/plex/command/impl/TempbanCMD.java b/server/src/main/java/dev/plex/command/impl/TempbanCMD.java index 285781a..faa3107 100644 --- a/server/src/main/java/dev/plex/command/impl/TempbanCMD.java +++ b/server/src/main/java/dev/plex/command/impl/TempbanCMD.java @@ -14,6 +14,8 @@ import dev.plex.util.BungeeUtil; import dev.plex.util.PlexLog; import dev.plex.util.PlexUtils; import dev.plex.util.TimeUtils; +import java.util.Collections; +import java.util.List; import net.kyori.adventure.text.Component; import org.apache.commons.lang3.StringUtils; import org.bukkit.Bukkit; @@ -22,9 +24,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; - @CommandParameters(name = "tempban", usage = "/