From 76b9458eb8f60588f9f7e72e549bcb0b6a32f165 Mon Sep 17 00:00:00 2001 From: MATRIX-feather Date: Sun, 22 Oct 2023 14:29:20 +0800 Subject: [PATCH] =?UTF-8?q?misc:=20=E4=BC=98=E5=8C=96import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/xiamomc/morph/MorphManager.java | 10 ++++++++-- src/main/java/xiamomc/morph/MorphPlugin.java | 10 ---------- .../java/xiamomc/morph/abilities/impl/FlyAbility.java | 8 -------- .../xiamomc/morph/abilities/impl/SpiderAbility.java | 2 -- .../impl/onAttack/ExtraKnockbackAbility.java | 1 - .../java/xiamomc/morph/backends/DisguiseWrapper.java | 3 --- .../morph/backends/libsdisg/LibsDisguiseWrapper.java | 1 - .../subcommands/plugin/CheckUpdateSubCommand.java | 2 -- .../plugin/management/ForceMorphSubCommand.java | 1 - .../plugin/management/GrantDisguiseSubCommand.java | 1 - .../xiamomc/morph/events/ForcedDisguiseProcessor.java | 2 -- .../morph/events/InteractionMirrorProcessor.java | 5 ++++- .../java/xiamomc/morph/messages/UpdateStrings.java | 2 -- src/main/java/xiamomc/morph/misc/DisguiseTypes.java | 1 - .../java/xiamomc/morph/misc/NilCommandSource.java | 11 ----------- src/main/java/xiamomc/morph/misc/UpdateHandler.java | 3 --- .../morph/network/server/MorphClientHandler.java | 2 -- .../morph/providers/DefaultDisguiseProvider.java | 2 -- .../xiamomc/morph/skills/impl/SplashPotionSkill.java | 2 -- src/main/java/xiamomc/morph/transforms/Recorder.java | 1 - .../morph/utilities/EntityTargetingHelper.java | 1 - .../java/xiamomc/morph/utilities/EntityTypeUtils.java | 1 - .../java/xiamomc/morph/utilities/ReflectionUtils.java | 1 - 23 files changed, 12 insertions(+), 61 deletions(-) diff --git a/src/main/java/xiamomc/morph/MorphManager.java b/src/main/java/xiamomc/morph/MorphManager.java index de4676b4..902d2657 100644 --- a/src/main/java/xiamomc/morph/MorphManager.java +++ b/src/main/java/xiamomc/morph/MorphManager.java @@ -28,7 +28,10 @@ import xiamomc.morph.events.api.gameplay.PlayerUnMorphEvent; import xiamomc.morph.events.api.lifecycle.ManagerFinishedInitializeEvent; import xiamomc.morph.interfaces.IManagePlayerData; -import xiamomc.morph.messages.*; +import xiamomc.morph.messages.CommandStrings; +import xiamomc.morph.messages.HintStrings; +import xiamomc.morph.messages.MessageUtils; +import xiamomc.morph.messages.MorphStrings; import xiamomc.morph.messages.vanilla.VanillaMessageStore; import xiamomc.morph.misc.*; import xiamomc.morph.misc.permissions.CommonPermissions; @@ -38,7 +41,10 @@ import xiamomc.morph.network.commands.S2C.map.S2CPartialMapCommand; import xiamomc.morph.network.commands.S2C.set.*; import xiamomc.morph.network.server.MorphClientHandler; -import xiamomc.morph.providers.*; +import xiamomc.morph.providers.DisguiseProvider; +import xiamomc.morph.providers.FallbackProvider; +import xiamomc.morph.providers.PlayerDisguiseProvider; +import xiamomc.morph.providers.VanillaDisguiseProvider; import xiamomc.morph.skills.MorphSkillHandler; import xiamomc.morph.skills.SkillCooldownInfo; import xiamomc.morph.skills.SkillType; diff --git a/src/main/java/xiamomc/morph/MorphPlugin.java b/src/main/java/xiamomc/morph/MorphPlugin.java index c509f7a4..931f1700 100644 --- a/src/main/java/xiamomc/morph/MorphPlugin.java +++ b/src/main/java/xiamomc/morph/MorphPlugin.java @@ -3,7 +3,6 @@ import net.kyori.adventure.text.minimessage.MiniMessage; import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; -import org.bukkit.command.CommandSender; import org.bukkit.event.Listener; import org.bukkit.plugin.PluginManager; import org.bukkit.scoreboard.Scoreboard; @@ -16,13 +15,11 @@ import xiamomc.morph.interfaces.IManageRequests; import xiamomc.morph.messages.MessageUtils; import xiamomc.morph.messages.MorphMessageStore; -import xiamomc.morph.messages.UpdateStrings; import xiamomc.morph.messages.vanilla.VanillaMessageStore; import xiamomc.morph.misc.PlayerOperationSimulator; import xiamomc.morph.misc.UpdateHandler; import xiamomc.morph.misc.integrations.gsit.GSitCompactProcessor; import xiamomc.morph.misc.integrations.placeholderapi.PlaceholderIntegration; -import xiamomc.morph.network.modrinthapi.ModrinthVersionResponse; import xiamomc.morph.network.server.MorphClientHandler; import xiamomc.morph.skills.MorphSkillHandler; import xiamomc.morph.storage.skill.SkillAbilityConfigurationStore; @@ -31,13 +28,6 @@ import xiamomc.pluginbase.Messages.MessageStore; import xiamomc.pluginbase.XiaMoJavaPlugin; -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.TimeUnit; - public final class MorphPlugin extends XiaMoJavaPlugin { private static MorphPlugin instance; diff --git a/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java b/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java index 94171946..f856c05e 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java +++ b/src/main/java/xiamomc/morph/abilities/impl/FlyAbility.java @@ -1,19 +1,13 @@ package xiamomc.morph.abilities.impl; -import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; -import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.world.phys.Vec3; import org.bukkit.GameEvent; import org.bukkit.GameMode; -import org.bukkit.Location; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerGameModeChangeEvent; -import org.bukkit.event.player.PlayerMoveEvent; -import org.bukkit.event.player.PlayerTeleportEvent; -import org.bukkit.event.player.PlayerToggleFlightEvent; import org.jetbrains.annotations.NotNull; import xiamomc.morph.MorphManager; import xiamomc.morph.abilities.AbilityType; @@ -22,13 +16,11 @@ import xiamomc.morph.config.ConfigOption; import xiamomc.morph.config.MorphConfigManager; import xiamomc.morph.misc.DisguiseState; -import xiamomc.morph.utilities.MathUtils; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Bindables.Bindable; import java.util.List; -import java.util.Map; public class FlyAbility extends MorphAbility { diff --git a/src/main/java/xiamomc/morph/abilities/impl/SpiderAbility.java b/src/main/java/xiamomc/morph/abilities/impl/SpiderAbility.java index 71f29a47..8b58003d 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/SpiderAbility.java +++ b/src/main/java/xiamomc/morph/abilities/impl/SpiderAbility.java @@ -14,8 +14,6 @@ import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Bindables.Bindable; -import java.util.List; - public class SpiderAbility extends NoOpOptionAbility { private final Bindable modifyBox = new Bindable<>(false); diff --git a/src/main/java/xiamomc/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java b/src/main/java/xiamomc/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java index 9bfaf9a1..744ebbb2 100644 --- a/src/main/java/xiamomc/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java +++ b/src/main/java/xiamomc/morph/abilities/impl/onAttack/ExtraKnockbackAbility.java @@ -10,7 +10,6 @@ import xiamomc.morph.abilities.AbilityType; import xiamomc.morph.abilities.impl.OnAttackAbility; import xiamomc.morph.abilities.options.ExtraKnockbackOption; -import xiamomc.morph.misc.DisguiseState; import xiamomc.pluginbase.Annotations.Resolved; public class ExtraKnockbackAbility extends OnAttackAbility diff --git a/src/main/java/xiamomc/morph/backends/DisguiseWrapper.java b/src/main/java/xiamomc/morph/backends/DisguiseWrapper.java index f40295d9..520f2206 100644 --- a/src/main/java/xiamomc/morph/backends/DisguiseWrapper.java +++ b/src/main/java/xiamomc/morph/backends/DisguiseWrapper.java @@ -6,7 +6,6 @@ import net.minecraft.nbt.TagType; import net.minecraft.world.entity.EntityDimensions; import net.minecraft.world.phys.AABB; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; @@ -19,8 +18,6 @@ import xiamomc.morph.misc.DisguiseState; import xiamomc.morph.utilities.EntityTypeUtils; -import java.util.UUID; - /** * A wrapper that holds the underlying disguise instance * @param Type of the disguise instance diff --git a/src/main/java/xiamomc/morph/backends/libsdisg/LibsDisguiseWrapper.java b/src/main/java/xiamomc/morph/backends/libsdisg/LibsDisguiseWrapper.java index f2087b3c..0ed0d7ff 100644 --- a/src/main/java/xiamomc/morph/backends/libsdisg/LibsDisguiseWrapper.java +++ b/src/main/java/xiamomc/morph/backends/libsdisg/LibsDisguiseWrapper.java @@ -36,7 +36,6 @@ import xiamomc.pluginbase.Utilities.ColorUtils; import java.util.Random; -import java.util.UUID; import java.util.function.BiConsumer; public class LibsDisguiseWrapper extends DisguiseWrapper diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java b/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java index df5b7c88..c5e0291c 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java +++ b/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java @@ -3,9 +3,7 @@ import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphPlugin; import xiamomc.morph.MorphPluginObject; -import xiamomc.morph.commands.MorphPluginCommand; import xiamomc.morph.messages.MessageUtils; import xiamomc.morph.messages.UpdateStrings; import xiamomc.morph.misc.UpdateHandler; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java b/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java index ddfc8e4d..2e74876e 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java +++ b/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/ForceMorphSubCommand.java @@ -10,7 +10,6 @@ import xiamomc.morph.messages.CommonStrings; import xiamomc.morph.messages.HelpStrings; import xiamomc.morph.messages.MessageUtils; -import xiamomc.morph.messages.MorphStrings; import xiamomc.morph.misc.MorphParameters; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Command.ISubCommand; diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java b/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java index 9b28391a..2212ef3f 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java +++ b/src/main/java/xiamomc/morph/commands/subcommands/plugin/management/GrantDisguiseSubCommand.java @@ -2,7 +2,6 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.text.Component; -import net.minecraft.server.commands.PlaceCommand; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/xiamomc/morph/events/ForcedDisguiseProcessor.java b/src/main/java/xiamomc/morph/events/ForcedDisguiseProcessor.java index a5b5780a..29b2e476 100644 --- a/src/main/java/xiamomc/morph/events/ForcedDisguiseProcessor.java +++ b/src/main/java/xiamomc/morph/events/ForcedDisguiseProcessor.java @@ -10,9 +10,7 @@ import xiamomc.morph.config.ConfigOption; import xiamomc.morph.config.MorphConfigManager; import xiamomc.morph.events.api.gameplay.PlayerMorphEarlyEvent; -import xiamomc.morph.events.api.gameplay.PlayerMorphEvent; import xiamomc.morph.events.api.gameplay.PlayerUnMorphEarlyEvent; -import xiamomc.morph.events.api.gameplay.PlayerUnMorphEvent; import xiamomc.morph.misc.MorphParameters; import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; diff --git a/src/main/java/xiamomc/morph/events/InteractionMirrorProcessor.java b/src/main/java/xiamomc/morph/events/InteractionMirrorProcessor.java index 348d80cc..6da66b8e 100644 --- a/src/main/java/xiamomc/morph/events/InteractionMirrorProcessor.java +++ b/src/main/java/xiamomc/morph/events/InteractionMirrorProcessor.java @@ -43,7 +43,10 @@ import java.io.FileOutputStream; import java.io.IOException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.Calendar; +import java.util.Date; +import java.util.Map; +import java.util.Stack; import java.util.concurrent.ConcurrentHashMap; public class InteractionMirrorProcessor extends MorphPluginObject implements Listener diff --git a/src/main/java/xiamomc/morph/messages/UpdateStrings.java b/src/main/java/xiamomc/morph/messages/UpdateStrings.java index a6d9c5a5..bcd2e31a 100644 --- a/src/main/java/xiamomc/morph/messages/UpdateStrings.java +++ b/src/main/java/xiamomc/morph/messages/UpdateStrings.java @@ -2,8 +2,6 @@ import xiamomc.pluginbase.Messages.FormattableMessage; -import java.text.Format; - public class UpdateStrings extends AbstractMorphStrings { public static FormattableMessage messageHeaderFooter() diff --git a/src/main/java/xiamomc/morph/misc/DisguiseTypes.java b/src/main/java/xiamomc/morph/misc/DisguiseTypes.java index af16513f..1c09a11d 100644 --- a/src/main/java/xiamomc/morph/misc/DisguiseTypes.java +++ b/src/main/java/xiamomc/morph/misc/DisguiseTypes.java @@ -1,7 +1,6 @@ package xiamomc.morph.misc; import org.bukkit.NamespacedKey; -import xiamomc.morph.MorphManager; import java.util.Arrays; diff --git a/src/main/java/xiamomc/morph/misc/NilCommandSource.java b/src/main/java/xiamomc/morph/misc/NilCommandSource.java index 996d1486..7532f72d 100644 --- a/src/main/java/xiamomc/morph/misc/NilCommandSource.java +++ b/src/main/java/xiamomc/morph/misc/NilCommandSource.java @@ -1,19 +1,8 @@ package xiamomc.morph.misc; -import net.kyori.adventure.identity.Identified; import net.kyori.adventure.text.Component; -import org.bukkit.Server; -import org.bukkit.command.CommandSender; import org.bukkit.craftbukkit.v1_20_R2.command.ServerCommandSender; -import org.bukkit.permissions.Permission; -import org.bukkit.permissions.PermissionAttachment; -import org.bukkit.permissions.PermissionAttachmentInfo; -import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Set; -import java.util.UUID; public final class NilCommandSource extends ServerCommandSender { diff --git a/src/main/java/xiamomc/morph/misc/UpdateHandler.java b/src/main/java/xiamomc/morph/misc/UpdateHandler.java index 0e122c43..f18b950a 100644 --- a/src/main/java/xiamomc/morph/misc/UpdateHandler.java +++ b/src/main/java/xiamomc/morph/misc/UpdateHandler.java @@ -6,8 +6,6 @@ import org.apache.hc.client5.http.config.RequestConfig; import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; import org.apache.hc.client5.http.impl.classic.HttpClients; -import org.apache.hc.core5.http.HttpEntity; -import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.io.entity.EntityUtils; import org.apache.hc.core5.net.URIBuilder; import org.bukkit.Bukkit; @@ -31,7 +29,6 @@ import java.util.ArrayList; import java.util.Map; -import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; diff --git a/src/main/java/xiamomc/morph/network/server/MorphClientHandler.java b/src/main/java/xiamomc/morph/network/server/MorphClientHandler.java index 52f58014..151c6b75 100644 --- a/src/main/java/xiamomc/morph/network/server/MorphClientHandler.java +++ b/src/main/java/xiamomc/morph/network/server/MorphClientHandler.java @@ -1,6 +1,5 @@ package xiamomc.morph.network.server; -import io.netty.buffer.Unpooled; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.kyori.adventure.text.Component; @@ -9,7 +8,6 @@ import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.resources.ResourceLocation; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.plugin.messaging.MessageTooLargeException; import org.bukkit.plugin.messaging.Messenger; diff --git a/src/main/java/xiamomc/morph/providers/DefaultDisguiseProvider.java b/src/main/java/xiamomc/morph/providers/DefaultDisguiseProvider.java index cafd9821..1df4cd3a 100644 --- a/src/main/java/xiamomc/morph/providers/DefaultDisguiseProvider.java +++ b/src/main/java/xiamomc/morph/providers/DefaultDisguiseProvider.java @@ -12,7 +12,6 @@ import org.bukkit.scoreboard.Scoreboard; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import xiamomc.morph.MorphManager; import xiamomc.morph.RevealingHandler; import xiamomc.morph.abilities.AbilityHandler; import xiamomc.morph.backends.DisguiseBackend; @@ -25,7 +24,6 @@ import xiamomc.morph.network.server.ServerSetEquipCommand; import xiamomc.morph.skills.MorphSkillHandler; import xiamomc.morph.skills.SkillType; -import xiamomc.pluginbase.Annotations.Initializer; import xiamomc.pluginbase.Annotations.Resolved; import xiamomc.pluginbase.Messages.MessageStore; import xiamomc.pluginbase.Utilities.ColorUtils; diff --git a/src/main/java/xiamomc/morph/skills/impl/SplashPotionSkill.java b/src/main/java/xiamomc/morph/skills/impl/SplashPotionSkill.java index 022ff5cd..ef6e1d88 100644 --- a/src/main/java/xiamomc/morph/skills/impl/SplashPotionSkill.java +++ b/src/main/java/xiamomc/morph/skills/impl/SplashPotionSkill.java @@ -1,7 +1,5 @@ package xiamomc.morph.skills.impl; -import net.minecraft.sounds.SoundEvents; -import net.minecraft.world.effect.MobEffects; import net.minecraft.world.item.alchemy.Potion; import net.minecraft.world.item.alchemy.PotionUtils; import net.minecraft.world.item.alchemy.Potions; diff --git a/src/main/java/xiamomc/morph/transforms/Recorder.java b/src/main/java/xiamomc/morph/transforms/Recorder.java index a7c3f8bd..163aa0b9 100644 --- a/src/main/java/xiamomc/morph/transforms/Recorder.java +++ b/src/main/java/xiamomc/morph/transforms/Recorder.java @@ -1,6 +1,5 @@ package xiamomc.morph.transforms; -import java.lang.module.Configuration; import java.util.function.Consumer; public class Recorder diff --git a/src/main/java/xiamomc/morph/utilities/EntityTargetingHelper.java b/src/main/java/xiamomc/morph/utilities/EntityTargetingHelper.java index caccfec4..b2c0b372 100644 --- a/src/main/java/xiamomc/morph/utilities/EntityTargetingHelper.java +++ b/src/main/java/xiamomc/morph/utilities/EntityTargetingHelper.java @@ -9,7 +9,6 @@ import net.minecraft.world.entity.ai.goal.WrappedGoal; import net.minecraft.world.entity.ai.targeting.TargetingConditions; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.phys.AABB; import org.bukkit.craftbukkit.v1_20_R2.entity.CraftMob; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; diff --git a/src/main/java/xiamomc/morph/utilities/EntityTypeUtils.java b/src/main/java/xiamomc/morph/utilities/EntityTypeUtils.java index 2ad1856a..219ac175 100644 --- a/src/main/java/xiamomc/morph/utilities/EntityTypeUtils.java +++ b/src/main/java/xiamomc/morph/utilities/EntityTypeUtils.java @@ -22,7 +22,6 @@ import xiamomc.morph.misc.DisguiseTypes; import java.util.Arrays; -import java.util.Locale; import java.util.Map; import java.util.Set; diff --git a/src/main/java/xiamomc/morph/utilities/ReflectionUtils.java b/src/main/java/xiamomc/morph/utilities/ReflectionUtils.java index 2650cb67..a4eb0c4f 100644 --- a/src/main/java/xiamomc/morph/utilities/ReflectionUtils.java +++ b/src/main/java/xiamomc/morph/utilities/ReflectionUtils.java @@ -4,7 +4,6 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityDimensions; -import org.jetbrains.annotations.Nullable; import xiamomc.pluginbase.Exceptions.NullDependencyException; import java.lang.reflect.Field;