From 7420e7e72111996432862dfd8318e16884b23dc5 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Tue, 5 Apr 2022 15:40:42 -0500 Subject: [PATCH] Optimize imports --- .../dev/plex/cache/player/PlayerCache.java | 1 - .../dev/plex/cache/sql/SQLPunishment.java | 1 - .../java/dev/plex/command/impl/FreezeCMD.java | 1 - .../java/dev/plex/command/impl/KickCMD.java | 1 - .../java/dev/plex/command/impl/LockupCMD.java | 1 - .../java/dev/plex/command/impl/UnbanCMD.java | 7 +-- .../dev/plex/command/impl/UnfreezeCMD.java | 1 - .../java/dev/plex/command/impl/UnmuteCMD.java | 1 - .../dev/plex/event/PunishedPlayerEvent.java | 3 +- .../dev/plex/listener/impl/BanListener.java | 1 - .../plex/listener/impl/FreezeListener.java | 1 - .../dev/plex/listener/impl/MuteListener.java | 1 - .../java/dev/plex/menu/PunishmentMenu.java | 1 - src/main/java/dev/plex/player/PlexPlayer.java | 8 ++-- .../java/dev/plex/punishment/Punishment.java | 2 - .../plex/punishment/PunishmentManager.java | 1 - .../dev/plex/services/impl/BanService.java | 4 +- src/main/java/dev/plex/util/PlexUtils.java | 43 +++++++++++++------ 18 files changed, 36 insertions(+), 43 deletions(-) diff --git a/src/main/java/dev/plex/cache/player/PlayerCache.java b/src/main/java/dev/plex/cache/player/PlayerCache.java index 05c6f07..55a08ef 100644 --- a/src/main/java/dev/plex/cache/player/PlayerCache.java +++ b/src/main/java/dev/plex/cache/player/PlayerCache.java @@ -2,7 +2,6 @@ package dev.plex.cache.player; import com.google.common.collect.Maps; import dev.plex.player.PlexPlayer; - import java.util.Map; import java.util.UUID; diff --git a/src/main/java/dev/plex/cache/sql/SQLPunishment.java b/src/main/java/dev/plex/cache/sql/SQLPunishment.java index 84fbce6..0627111 100644 --- a/src/main/java/dev/plex/cache/sql/SQLPunishment.java +++ b/src/main/java/dev/plex/cache/sql/SQLPunishment.java @@ -5,7 +5,6 @@ import dev.plex.Plex; import dev.plex.punishment.Punishment; import dev.plex.punishment.PunishmentType; import dev.plex.util.PlexLog; - import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; diff --git a/src/main/java/dev/plex/command/impl/FreezeCMD.java b/src/main/java/dev/plex/command/impl/FreezeCMD.java index a270f27..c29a239 100644 --- a/src/main/java/dev/plex/command/impl/FreezeCMD.java +++ b/src/main/java/dev/plex/command/impl/FreezeCMD.java @@ -1,7 +1,6 @@ package dev.plex.command.impl; import com.google.common.collect.ImmutableList; -import dev.plex.cache.player.PlayerCache; import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; diff --git a/src/main/java/dev/plex/command/impl/KickCMD.java b/src/main/java/dev/plex/command/impl/KickCMD.java index 2abe6f3..3957bb6 100644 --- a/src/main/java/dev/plex/command/impl/KickCMD.java +++ b/src/main/java/dev/plex/command/impl/KickCMD.java @@ -1,7 +1,6 @@ package dev.plex.command.impl; import dev.plex.cache.DataUtils; -import dev.plex.cache.player.PlayerCache; import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; diff --git a/src/main/java/dev/plex/command/impl/LockupCMD.java b/src/main/java/dev/plex/command/impl/LockupCMD.java index dd9d5d1..932f747 100644 --- a/src/main/java/dev/plex/command/impl/LockupCMD.java +++ b/src/main/java/dev/plex/command/impl/LockupCMD.java @@ -1,7 +1,6 @@ package dev.plex.command.impl; import com.google.common.collect.ImmutableList; -import dev.plex.cache.player.PlayerCache; import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; diff --git a/src/main/java/dev/plex/command/impl/UnbanCMD.java b/src/main/java/dev/plex/command/impl/UnbanCMD.java index 3afd2c9..dc1d0d1 100644 --- a/src/main/java/dev/plex/command/impl/UnbanCMD.java +++ b/src/main/java/dev/plex/command/impl/UnbanCMD.java @@ -1,7 +1,6 @@ package dev.plex.command.impl; import com.google.common.collect.ImmutableList; -import dev.plex.Plex; import dev.plex.cache.DataUtils; import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; @@ -12,17 +11,15 @@ import dev.plex.command.source.RequiredCommandSource; import dev.plex.player.PlexPlayer; import dev.plex.rank.enums.Rank; import dev.plex.util.PlexUtils; +import java.util.List; +import java.util.UUID; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.minimessage.MiniMessage; -import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; -import java.util.UUID; - @CommandParameters(name = "unban", usage = "/ ", description = "Unbans a player, offline or online") @CommandPermissions(level = Rank.ADMIN, permission = "plex.ban", source = RequiredCommandSource.ANY) diff --git a/src/main/java/dev/plex/command/impl/UnfreezeCMD.java b/src/main/java/dev/plex/command/impl/UnfreezeCMD.java index 1661592..cb68b9d 100644 --- a/src/main/java/dev/plex/command/impl/UnfreezeCMD.java +++ b/src/main/java/dev/plex/command/impl/UnfreezeCMD.java @@ -1,7 +1,6 @@ package dev.plex.command.impl; import com.google.common.collect.ImmutableList; -import dev.plex.cache.player.PlayerCache; import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; diff --git a/src/main/java/dev/plex/command/impl/UnmuteCMD.java b/src/main/java/dev/plex/command/impl/UnmuteCMD.java index 9bae987..4718d38 100644 --- a/src/main/java/dev/plex/command/impl/UnmuteCMD.java +++ b/src/main/java/dev/plex/command/impl/UnmuteCMD.java @@ -1,7 +1,6 @@ package dev.plex.command.impl; import com.google.common.collect.ImmutableList; -import dev.plex.cache.player.PlayerCache; import dev.plex.command.PlexCommand; import dev.plex.command.annotation.CommandParameters; import dev.plex.command.annotation.CommandPermissions; diff --git a/src/main/java/dev/plex/event/PunishedPlayerEvent.java b/src/main/java/dev/plex/event/PunishedPlayerEvent.java index fc1be27..198ce44 100644 --- a/src/main/java/dev/plex/event/PunishedPlayerEvent.java +++ b/src/main/java/dev/plex/event/PunishedPlayerEvent.java @@ -1,8 +1,7 @@ package dev.plex.event; -import java.util.UUID; - import dev.plex.player.PlexPlayer; +import java.util.UUID; import lombok.Getter; import lombok.Setter; import org.bukkit.Bukkit; diff --git a/src/main/java/dev/plex/listener/impl/BanListener.java b/src/main/java/dev/plex/listener/impl/BanListener.java index 3aea843..240fbc3 100644 --- a/src/main/java/dev/plex/listener/impl/BanListener.java +++ b/src/main/java/dev/plex/listener/impl/BanListener.java @@ -1,7 +1,6 @@ package dev.plex.listener.impl; import dev.plex.cache.DataUtils; -import dev.plex.cache.player.PlayerCache; import dev.plex.listener.PlexListener; import dev.plex.player.PlexPlayer; import dev.plex.punishment.Punishment; diff --git a/src/main/java/dev/plex/listener/impl/FreezeListener.java b/src/main/java/dev/plex/listener/impl/FreezeListener.java index e15dc15..deac3bb 100644 --- a/src/main/java/dev/plex/listener/impl/FreezeListener.java +++ b/src/main/java/dev/plex/listener/impl/FreezeListener.java @@ -1,7 +1,6 @@ package dev.plex.listener.impl; import dev.plex.cache.DataUtils; -import dev.plex.cache.player.PlayerCache; import dev.plex.listener.PlexListener; import dev.plex.player.PlexPlayer; import org.bukkit.event.EventHandler; diff --git a/src/main/java/dev/plex/listener/impl/MuteListener.java b/src/main/java/dev/plex/listener/impl/MuteListener.java index 603f4d0..8b2f523 100644 --- a/src/main/java/dev/plex/listener/impl/MuteListener.java +++ b/src/main/java/dev/plex/listener/impl/MuteListener.java @@ -1,7 +1,6 @@ package dev.plex.listener.impl; import dev.plex.cache.DataUtils; -import dev.plex.cache.player.PlayerCache; import dev.plex.listener.PlexListener; import dev.plex.util.PlexUtils; import io.papermc.paper.event.player.AsyncChatEvent; diff --git a/src/main/java/dev/plex/menu/PunishmentMenu.java b/src/main/java/dev/plex/menu/PunishmentMenu.java index 9f1dc80..40bde91 100644 --- a/src/main/java/dev/plex/menu/PunishmentMenu.java +++ b/src/main/java/dev/plex/menu/PunishmentMenu.java @@ -2,7 +2,6 @@ package dev.plex.menu; import com.google.common.collect.Lists; import dev.plex.cache.DataUtils; -import dev.plex.cache.player.PlayerCache; import dev.plex.player.PlexPlayer; import dev.plex.util.menu.AbstractMenu; import java.util.List; diff --git a/src/main/java/dev/plex/player/PlexPlayer.java b/src/main/java/dev/plex/player/PlexPlayer.java index 51c4c1d..5cc18ed 100644 --- a/src/main/java/dev/plex/player/PlexPlayer.java +++ b/src/main/java/dev/plex/player/PlexPlayer.java @@ -9,6 +9,9 @@ import dev.plex.Plex; import dev.plex.punishment.Punishment; import dev.plex.rank.enums.Rank; import dev.plex.storage.StorageType; +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; @@ -17,11 +20,6 @@ import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.entity.Player; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - @Getter @Setter @Entity(value = "players", useDiscriminator = false) diff --git a/src/main/java/dev/plex/punishment/Punishment.java b/src/main/java/dev/plex/punishment/Punishment.java index 32a35e1..06b1024 100644 --- a/src/main/java/dev/plex/punishment/Punishment.java +++ b/src/main/java/dev/plex/punishment/Punishment.java @@ -9,8 +9,6 @@ import dev.plex.util.adapter.LocalDateTimeSerializer; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.UUID; - -import lombok.Data; import lombok.Getter; import lombok.Setter; import net.kyori.adventure.text.Component; diff --git a/src/main/java/dev/plex/punishment/PunishmentManager.java b/src/main/java/dev/plex/punishment/PunishmentManager.java index 1553524..978a0d6 100644 --- a/src/main/java/dev/plex/punishment/PunishmentManager.java +++ b/src/main/java/dev/plex/punishment/PunishmentManager.java @@ -25,7 +25,6 @@ import lombok.Getter; import org.apache.commons.io.FileUtils; import org.bukkit.Bukkit; import org.bukkit.scheduler.BukkitRunnable; -import org.json.JSONObject; public class PunishmentManager extends PlexBase { diff --git a/src/main/java/dev/plex/services/impl/BanService.java b/src/main/java/dev/plex/services/impl/BanService.java index 7b3321c..f656a70 100644 --- a/src/main/java/dev/plex/services/impl/BanService.java +++ b/src/main/java/dev/plex/services/impl/BanService.java @@ -1,13 +1,11 @@ package dev.plex.services.impl; import dev.plex.Plex; -import dev.plex.punishment.Punishment; import dev.plex.services.AbstractService; +import java.time.LocalDateTime; import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; -import java.time.LocalDateTime; - public class BanService extends AbstractService { public BanService() diff --git a/src/main/java/dev/plex/util/PlexUtils.java b/src/main/java/dev/plex/util/PlexUtils.java index c9e566a..6416be4 100644 --- a/src/main/java/dev/plex/util/PlexUtils.java +++ b/src/main/java/dev/plex/util/PlexUtils.java @@ -6,19 +6,6 @@ import dev.plex.Plex; import dev.plex.PlexBase; import dev.plex.config.Config; import dev.plex.storage.StorageType; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.minimessage.MiniMessage; -import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -import org.apache.commons.lang.math.NumberUtils; -import org.bukkit.*; -import org.bukkit.command.Command; -import org.bukkit.command.PluginCommandYamlParser; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -29,9 +16,37 @@ import java.sql.SQLException; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; import java.util.stream.Collectors; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.minimessage.MiniMessage; +import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; +import org.apache.commons.lang.math.NumberUtils; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.GameRule; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.command.Command; +import org.bukkit.command.PluginCommandYamlParser; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; public class PlexUtils extends PlexBase {