From 7c0eb550e77bbce610a4f5d02f39a17d0c6a5c3b Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 2 Feb 2022 20:10:00 +1300 Subject: [PATCH] Optimize imports --- .../libraryaddict/disguise/DisguiseAPI.java | 22 ++-- .../disguise/DisguiseConfig.java | 17 ++- .../libraryaddict/disguise/LibsDisguises.java | 27 +++-- .../commands/DisguiseBaseCommand.java | 13 ++- .../commands/LibsDisguisesCommand.java | 26 ++++- .../commands/disguise/DisguiseCommand.java | 5 +- .../disguise/DisguiseEntityCommand.java | 5 +- .../disguise/DisguisePlayerCommand.java | 7 +- .../disguise/DisguiseRadiusCommand.java | 9 +- .../DisguiseModifyInteraction.java | 5 +- .../commands/libsdisguises/LDChangelog.java | 5 +- .../commands/libsdisguises/LDCommand.java | 3 +- .../commands/libsdisguises/LDConfig.java | 9 +- .../commands/libsdisguises/LDCount.java | 7 +- .../libsdisguises/LDDebugMineSkin.java | 5 +- .../commands/libsdisguises/LDDebugPlayer.java | 5 +- .../commands/libsdisguises/LDHelp.java | 5 +- .../commands/libsdisguises/LDJson.java | 7 +- .../commands/libsdisguises/LDMetaInfo.java | 9 +- .../commands/libsdisguises/LDMods.java | 5 +- .../commands/libsdisguises/LDPermTest.java | 5 +- .../commands/libsdisguises/LDReload.java | 5 +- .../commands/libsdisguises/LDScoreboard.java | 11 +- .../commands/libsdisguises/LDUpdate.java | 5 +- .../libsdisguises/LDUpdateProtocolLib.java | 9 +- .../commands/libsdisguises/LDUploadLogs.java | 29 ++--- .../modify/DisguiseModifyCommand.java | 5 +- .../modify/DisguiseModifyEntityCommand.java | 5 +- .../modify/DisguiseModifyPlayerCommand.java | 7 +- .../modify/DisguiseModifyRadiusCommand.java | 13 ++- .../undisguise/UndisguisePlayerCommand.java | 7 +- .../commands/utils/CopyDisguiseCommand.java | 5 +- .../commands/utils/DisguiseCloneCommand.java | 5 +- .../commands/utils/DisguiseHelpCommand.java | 9 +- .../commands/utils/GrabHeadCommand.java | 3 +- .../commands/utils/SaveDisguiseCommand.java | 3 +- .../disguise/disguisetypes/Disguise.java | 20 +++- .../disguisetypes/DisguiseRunnable.java | 3 +- .../disguise/disguisetypes/DisguiseType.java | 3 +- .../disguise/disguisetypes/FlagWatcher.java | 11 +- .../disguise/disguisetypes/MetaIndex.java | 103 +++++++++++++++++- .../disguise/disguisetypes/MiscDisguise.java | 3 +- .../disguise/disguisetypes/MobDisguise.java | 9 +- .../disguisetypes/ModdedDisguise.java | 3 +- .../disguisetypes/PlayerDisguise.java | 3 +- .../disguisetypes/TargetedDisguise.java | 11 +- .../watchers/AbstractHorseWatcher.java | 5 +- .../disguisetypes/watchers/CatWatcher.java | 3 +- .../watchers/EnderCrystalWatcher.java | 3 +- .../watchers/EndermanWatcher.java | 3 +- .../watchers/FallingBlockWatcher.java | 3 +- .../watchers/FireworkWatcher.java | 3 +- .../disguisetypes/watchers/FoxWatcher.java | 3 +- .../disguisetypes/watchers/LivingWatcher.java | 10 +- .../watchers/MushroomCowWatcher.java | 3 +- .../disguisetypes/watchers/OcelotWatcher.java | 5 +- .../disguisetypes/watchers/PandaWatcher.java | 3 +- .../watchers/ShulkerWatcher.java | 3 +- .../watchers/TameableWatcher.java | 5 +- .../watchers/TropicalFishWatcher.java | 5 +- .../disguisetypes/watchers/WitherWatcher.java | 3 +- .../watchers/ZombieVillagerWatcher.java | 3 +- .../disguise/utilities/DisguiseUtilities.java | 102 +++++++++++++---- .../disguise/utilities/DisguiseValues.java | 3 +- .../disguise/utilities/LibsPremium.java | 15 ++- .../disguise/utilities/SkinUtils.java | 9 +- .../utilities/config/ConfigLoader.java | 11 +- .../config/DisguiseCommandConfig.java | 15 ++- .../utilities/json/SerializerBlockData.java | 10 +- .../json/SerializerChatComponent.java | 8 +- .../utilities/json/SerializerDisguise.java | 15 ++- .../utilities/json/SerializerFlagWatcher.java | 28 +++-- .../utilities/json/SerializerGameProfile.java | 9 +- .../utilities/json/SerializerItemStack.java | 14 ++- .../utilities/json/SerializerMetaIndex.java | 11 +- .../utilities/json/SerializerParticle.java | 3 +- .../json/SerializerWrappedBlockData.java | 11 +- .../utilities/listeners/DisguiseListener.java | 30 +++-- .../listeners/PlayerSkinHandler.java | 15 ++- .../disguise/utilities/metrics/Metrics.java | 22 ++-- .../utilities/metrics/MetricsInitalizer.java | 7 +- .../utilities/mineskin/MineSkinAPI.java | 22 ++-- .../utilities/mineskin/MineSkinResponse.java | 3 +- .../utilities/modded/ModdedManager.java | 17 ++- .../utilities/packets/LibsPackets.java | 11 +- .../utilities/packets/PacketsHandler.java | 17 ++- .../utilities/packets/PacketsManager.java | 13 ++- .../PacketHandlerAttributes.java | 5 +- .../PacketHandlerEquipment.java | 5 +- .../PacketHandlerHeadRotation.java | 3 +- .../packethandlers/PacketHandlerMetadata.java | 3 +- .../packethandlers/PacketHandlerMovement.java | 3 +- .../packethandlers/PacketHandlerSpawn.java | 14 ++- .../PacketListenerClientCustomPayload.java | 5 +- .../PacketListenerClientInteract.java | 6 +- .../PacketListenerEntityDestroy.java | 5 +- .../PacketListenerInventory.java | 7 +- .../packetlisteners/PacketListenerMain.java | 5 +- .../PacketListenerModdedClient.java | 9 +- .../packetlisteners/PacketListenerSounds.java | 5 +- .../PacketListenerTabList.java | 5 +- .../PacketListenerViewSelfDisguise.java | 9 +- .../disguise/utilities/params/ParamInfo.java | 8 +- .../utilities/params/ParamInfoManager.java | 9 +- .../utilities/params/ParamInfoTypes.java | 51 +++++++-- .../utilities/params/types/ParamInfoEnum.java | 3 +- .../params/types/base/ParamInfoBoolean.java | 5 +- .../types/base/ParamInfoFloatNullable.java | 2 - .../types/custom/ParamInfoBlockData.java | 9 +- .../params/types/custom/ParamInfoColor.java | 3 +- .../types/custom/ParamInfoItemBlock.java | 5 +- .../types/custom/ParamInfoItemStack.java | 7 +- .../types/custom/ParamInfoItemStackArray.java | 7 +- .../types/custom/ParamInfoParticle.java | 9 +- .../types/custom/ParamInfoPotionEffect.java | 3 +- .../types/custom/ParamInfoSoundGroup.java | 5 +- .../utilities/parser/DisguiseParser.java | 35 ++++-- .../utilities/parser/DisguisePerm.java | 3 +- .../utilities/parser/DisguisePermissions.java | 10 +- .../utilities/parser/WatcherMethod.java | 3 +- .../utilities/plugin/BisectHosting.java | 7 +- .../utilities/plugin/PluginInformation.java | 3 +- .../utilities/reflection/ClassGetter.java | 5 +- .../reflection/ReflectionManager.java | 90 ++++++++++++--- .../utilities/sounds/DisguiseSoundEnums.java | 5 +- .../disguise/utilities/sounds/SoundGroup.java | 5 +- .../utilities/sounds/SoundManager.java | 14 +-- .../utilities/translations/LibsMsg.java | 3 +- .../translations/TranslateFiller.java | 5 +- .../utilities/translations/TranslateType.java | 18 ++- .../disguise/utilities/updates/LDGithub.java | 11 +- .../disguise/utilities/updates/LDJenkins.java | 20 ++-- .../utilities/updates/UpdateChecker.java | 19 ++-- .../utilities/watchers/CompileMethods.java | 19 ++-- .../utilities/watchers/DisguiseMethods.java | 17 ++- .../disguisetypes/DisguiseCloneTest.java | 5 +- .../utilities/DisguiseUtilitiesTest.java | 3 +- .../parser/DisguisePermissionsTest.java | 8 +- .../reflection/ReflectionManagerAbstract.java | 13 ++- .../reflection/v1_17/ReflectionManager.java | 36 ++++-- .../reflection/v1_18/ReflectionManager.java | 36 ++++-- 141 files changed, 997 insertions(+), 586 deletions(-) diff --git a/plugin/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java b/plugin/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java index 6002c0c4..47f73bb1 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java @@ -3,8 +3,21 @@ package me.libraryaddict.disguise; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import com.comphenix.protocol.wrappers.WrappedGameProfile; import com.comphenix.protocol.wrappers.WrappedWatchableObject; +import java.io.File; +import java.io.IOException; import java.util.ArrayList; -import me.libraryaddict.disguise.disguisetypes.*; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.disguisetypes.FlagWatcher; +import me.libraryaddict.disguise.disguisetypes.MetaIndex; +import me.libraryaddict.disguise.disguisetypes.MiscDisguise; +import me.libraryaddict.disguise.disguisetypes.MobDisguise; +import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; +import me.libraryaddict.disguise.disguisetypes.TargetedDisguise; import me.libraryaddict.disguise.disguisetypes.TargetedDisguise.TargetType; import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher; import me.libraryaddict.disguise.utilities.DisguiseUtilities; @@ -23,13 +36,6 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.ItemStack; -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; - public class DisguiseAPI { private static int selfDisguiseId; private static int entityAttachmentId; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java b/plugin/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java index db4279be..a562ddd2 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java @@ -1,5 +1,17 @@ package me.libraryaddict.disguise; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map.Entry; +import java.util.Random; +import java.util.concurrent.TimeUnit; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; @@ -29,11 +41,6 @@ import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; import org.bukkit.scheduler.BukkitTask; -import java.io.*; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; - public class DisguiseConfig { @Getter @Setter diff --git a/plugin/src/main/java/me/libraryaddict/disguise/LibsDisguises.java b/plugin/src/main/java/me/libraryaddict/disguise/LibsDisguises.java index 772edea3..873cec6f 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/LibsDisguises.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/LibsDisguises.java @@ -1,6 +1,10 @@ package me.libraryaddict.disguise; -import com.comphenix.protocol.ProtocolLibrary; +import java.io.File; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Map; +import java.util.stream.Collectors; import lombok.Getter; import me.libraryaddict.disguise.commands.LibsDisguisesCommand; import me.libraryaddict.disguise.commands.disguise.DisguiseCommand; @@ -15,7 +19,14 @@ import me.libraryaddict.disguise.commands.undisguise.UndisguiseCommand; import me.libraryaddict.disguise.commands.undisguise.UndisguiseEntityCommand; import me.libraryaddict.disguise.commands.undisguise.UndisguisePlayerCommand; import me.libraryaddict.disguise.commands.undisguise.UndisguiseRadiusCommand; -import me.libraryaddict.disguise.commands.utils.*; +import me.libraryaddict.disguise.commands.utils.CopyDisguiseCommand; +import me.libraryaddict.disguise.commands.utils.DisguiseCloneCommand; +import me.libraryaddict.disguise.commands.utils.DisguiseHelpCommand; +import me.libraryaddict.disguise.commands.utils.DisguiseViewBarCommand; +import me.libraryaddict.disguise.commands.utils.DisguiseViewSelfCommand; +import me.libraryaddict.disguise.commands.utils.GrabHeadCommand; +import me.libraryaddict.disguise.commands.utils.GrabSkinCommand; +import me.libraryaddict.disguise.commands.utils.SaveDisguiseCommand; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.config.DisguiseCommandConfig; @@ -32,18 +43,16 @@ import me.libraryaddict.disguise.utilities.sounds.SoundManager; import me.libraryaddict.disguise.utilities.updates.UpdateChecker; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; -import org.bukkit.command.*; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandMap; +import org.bukkit.command.PluginCommand; +import org.bukkit.command.TabCompleter; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; -import java.io.File; -import java.util.Arrays; -import java.util.Iterator; -import java.util.Map; -import java.util.stream.Collectors; - public class LibsDisguises extends JavaPlugin { private static LibsDisguises instance; private DisguiseListener listener; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java index ad301bea..baa690ad 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java @@ -3,6 +3,16 @@ package me.libraryaddict.disguise.commands; import com.comphenix.protocol.ProtocolLibrary; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.TimeUnit; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.commands.disguise.DisguiseCommand; import me.libraryaddict.disguise.commands.disguise.DisguiseEntityCommand; @@ -30,9 +40,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.util.*; -import java.util.concurrent.TimeUnit; - /** * @author libraryaddict */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/LibsDisguisesCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/LibsDisguisesCommand.java index 25d2bc3a..44baa187 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/LibsDisguisesCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/LibsDisguisesCommand.java @@ -1,8 +1,27 @@ package me.libraryaddict.disguise.commands; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; import lombok.Getter; import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.commands.libsdisguises.*; +import me.libraryaddict.disguise.commands.libsdisguises.LDChangelog; +import me.libraryaddict.disguise.commands.libsdisguises.LDCommand; +import me.libraryaddict.disguise.commands.libsdisguises.LDConfig; +import me.libraryaddict.disguise.commands.libsdisguises.LDCount; +import me.libraryaddict.disguise.commands.libsdisguises.LDDebugMineSkin; +import me.libraryaddict.disguise.commands.libsdisguises.LDDebugPlayer; +import me.libraryaddict.disguise.commands.libsdisguises.LDHelp; +import me.libraryaddict.disguise.commands.libsdisguises.LDJson; +import me.libraryaddict.disguise.commands.libsdisguises.LDMetaInfo; +import me.libraryaddict.disguise.commands.libsdisguises.LDMods; +import me.libraryaddict.disguise.commands.libsdisguises.LDPermTest; +import me.libraryaddict.disguise.commands.libsdisguises.LDReload; +import me.libraryaddict.disguise.commands.libsdisguises.LDScoreboard; +import me.libraryaddict.disguise.commands.libsdisguises.LDUpdate; +import me.libraryaddict.disguise.commands.libsdisguises.LDUpdateProtocolLib; +import me.libraryaddict.disguise.commands.libsdisguises.LDUploadLogs; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.ChatColor; @@ -11,11 +30,6 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; - public class LibsDisguisesCommand implements CommandExecutor, TabCompleter { @Getter private final ArrayList commands = new ArrayList<>(); diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java index 963242cb..58755593 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.disguise; +import java.util.ArrayList; +import java.util.List; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; @@ -17,9 +19,6 @@ import org.bukkit.command.TabCompleter; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.List; - public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java index a46f0cc0..e3d8112d 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.disguise; +import java.util.ArrayList; +import java.util.List; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; @@ -16,9 +18,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.List; - public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCompleter { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java index 517fa518..737a0b5c 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java @@ -1,5 +1,8 @@ package me.libraryaddict.disguise.commands.disguise; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; @@ -19,10 +22,6 @@ import org.bukkit.command.TabCompleter; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCompleter { @Override diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java index 0585fdb9..b4ec2600 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java @@ -1,5 +1,9 @@ package me.libraryaddict.disguise.commands.disguise; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Locale; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; @@ -23,11 +27,6 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Locale; - public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCompleter { private ArrayList> validClasses = new ArrayList<>(); diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseModifyInteraction.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseModifyInteraction.java index e1d64ed7..1da16045 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseModifyInteraction.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/interactions/DisguiseModifyInteraction.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.interactions; +import java.util.ArrayList; +import java.util.Arrays; import lombok.AllArgsConstructor; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.disguisetypes.Disguise; @@ -13,9 +15,6 @@ import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.Arrays; - /** * Created by libraryaddict on 4/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDChangelog.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDChangelog.java index 611c79c8..7fc7433b 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDChangelog.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDChangelog.java @@ -1,14 +1,13 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.Collections; +import java.util.List; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.updates.UpdateChecker; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; -import java.util.Collections; -import java.util.List; - /** * Created by libraryaddict on 27/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCommand.java index 6fbf4bae..2c99dc55 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCommand.java @@ -1,10 +1,9 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.List; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.command.CommandSender; -import java.util.List; - /** * Created by libraryaddict on 20/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDConfig.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDConfig.java index bdd34adc..f87bfdf0 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDConfig.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDConfig.java @@ -1,13 +1,12 @@ package me.libraryaddict.disguise.commands.libsdisguises; -import me.libraryaddict.disguise.DisguiseConfig; -import me.libraryaddict.disguise.utilities.translations.LibsMsg; -import org.bukkit.ChatColor; -import org.bukkit.command.CommandSender; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import me.libraryaddict.disguise.DisguiseConfig; +import me.libraryaddict.disguise.utilities.translations.LibsMsg; +import org.bukkit.ChatColor; +import org.bukkit.command.CommandSender; /** * Created by libraryaddict on 20/04/2020. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCount.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCount.java index 1bad5c94..7b8d065c 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCount.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDCount.java @@ -1,5 +1,10 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Set; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.TargetedDisguise; @@ -8,8 +13,6 @@ import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.TranslateType; import org.bukkit.command.CommandSender; -import java.util.*; - /** * Created by libraryaddict on 20/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugMineSkin.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugMineSkin.java index 3c82f187..1e15872c 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugMineSkin.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugMineSkin.java @@ -1,13 +1,12 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.Collections; +import java.util.List; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.mineskin.MineSkinAPI; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.command.CommandSender; -import java.util.Collections; -import java.util.List; - /** * Created by libraryaddict on 22/05/2021. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugPlayer.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugPlayer.java index d866264c..1b174079 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugPlayer.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDDebugPlayer.java @@ -1,6 +1,8 @@ package me.libraryaddict.disguise.commands.libsdisguises; import com.google.gson.Gson; +import java.util.Collections; +import java.util.List; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; @@ -16,9 +18,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.scoreboard.Team; -import java.util.Collections; -import java.util.List; - /** * Created by libraryaddict on 24/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDHelp.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDHelp.java index 717886e3..25287f95 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDHelp.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDHelp.java @@ -1,14 +1,13 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.Collections; +import java.util.List; import lombok.AllArgsConstructor; import lombok.Getter; import me.libraryaddict.disguise.commands.LibsDisguisesCommand; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.command.CommandSender; -import java.util.Collections; -import java.util.List; - /** * Created by libraryaddict on 22/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDJson.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDJson.java index 291b842a..14fedf17 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDJson.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDJson.java @@ -1,6 +1,9 @@ package me.libraryaddict.disguise.commands.libsdisguises; import com.comphenix.protocol.wrappers.nbt.NbtFactory; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.params.ParamInfoManager; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; @@ -14,10 +17,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - /** * Created by libraryaddict on 20/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMetaInfo.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMetaInfo.java index 84ad3cb5..318e0e29 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMetaInfo.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMetaInfo.java @@ -1,5 +1,9 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; import me.libraryaddict.disguise.disguisetypes.MetaIndex; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import net.md_5.bungee.api.chat.ClickEvent; @@ -8,11 +12,6 @@ import net.md_5.bungee.api.chat.HoverEvent; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.command.CommandSender; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - /** * Created by libraryaddict on 20/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMods.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMods.java index 713acf39..fa7852bd 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMods.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDMods.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.Collections; +import java.util.List; import me.libraryaddict.disguise.utilities.modded.ModdedManager; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.apache.commons.lang.StringUtils; @@ -7,9 +9,6 @@ import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import java.util.Collections; -import java.util.List; - /** * Created by libraryaddict on 20/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDPermTest.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDPermTest.java index dce260d2..dc154e30 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDPermTest.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDPermTest.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.Arrays; +import java.util.List; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.utilities.LibsPremium; @@ -11,9 +13,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.permissions.Permissible; -import java.util.Arrays; -import java.util.List; - /** * Created by libraryaddict on 20/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDReload.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDReload.java index e70ceb3e..84cfd39f 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDReload.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDReload.java @@ -1,13 +1,12 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.Collections; +import java.util.List; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.utilities.sounds.SoundManager; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.command.CommandSender; -import java.util.Collections; -import java.util.List; - /** * Created by libraryaddict on 20/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDScoreboard.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDScoreboard.java index 71163d63..cd06b5df 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDScoreboard.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDScoreboard.java @@ -3,6 +3,11 @@ package me.libraryaddict.disguise.commands.libsdisguises; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketListener; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; @@ -22,12 +27,6 @@ import org.bukkit.entity.Player; import org.bukkit.scoreboard.Scoreboard; import org.bukkit.scoreboard.Team; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - /** * Created by libraryaddict on 20/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java index fde853be..85a3d187 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.util.Arrays; +import java.util.List; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.utilities.DisguiseUtilities; @@ -10,9 +12,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; -import java.util.Arrays; -import java.util.List; - /** * Created by libraryaddict on 20/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdateProtocolLib.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdateProtocolLib.java index 03648feb..a8b78b3a 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdateProtocolLib.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdateProtocolLib.java @@ -1,5 +1,9 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.translations.LibsMsg; @@ -7,11 +11,6 @@ import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.scheduler.BukkitRunnable; -import java.io.File; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.atomic.AtomicBoolean; - /** * Created by libraryaddict on 30/06/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUploadLogs.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUploadLogs.java index aa25b9ea..0d1b7909 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUploadLogs.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUploadLogs.java @@ -1,5 +1,21 @@ package me.libraryaddict.disguise.commands.libsdisguises; +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.util.AbstractMap.SimpleEntry; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import javax.net.ssl.HttpsURLConnection; import lombok.Data; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; @@ -12,19 +28,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; -import javax.net.ssl.HttpsURLConnection; -import java.io.*; -import java.net.URL; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.util.AbstractMap.SimpleEntry; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - /** * Created by libraryaddict on 18/06/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java index 2f535895..95768915 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.modify; +import java.util.ArrayList; +import java.util.List; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; import me.libraryaddict.disguise.disguisetypes.Disguise; @@ -16,9 +18,6 @@ import org.bukkit.command.TabCompleter; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.List; - public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCompleter { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java index 4f430529..c4d9ef67 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.modify; +import java.util.ArrayList; +import java.util.List; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; @@ -14,9 +16,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.List; - public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements TabCompleter { @Override diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java index a75b7933..b11ed4a1 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java @@ -1,5 +1,8 @@ package me.libraryaddict.disguise.commands.modify; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; import me.libraryaddict.disguise.disguisetypes.Disguise; @@ -17,10 +20,6 @@ import org.bukkit.command.TabCompleter; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements TabCompleter { @Override diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java index 6dbb7772..19c2a1e2 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java @@ -1,5 +1,10 @@ package me.libraryaddict.disguise.commands.modify; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; @@ -7,7 +12,11 @@ import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.params.ParamInfoManager; -import me.libraryaddict.disguise.utilities.parser.*; +import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; +import me.libraryaddict.disguise.utilities.parser.DisguiseParser; +import me.libraryaddict.disguise.utilities.parser.DisguisePerm; +import me.libraryaddict.disguise.utilities.parser.DisguisePermissions; +import me.libraryaddict.disguise.utilities.parser.WatcherMethod; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.TranslateType; import org.apache.commons.lang.StringUtils; @@ -20,8 +29,6 @@ import org.bukkit.command.TabCompleter; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.*; - public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements TabCompleter { private Collection getNearbyEntities(CommandSender sender, int radius) { Location center; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguisePlayerCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguisePlayerCommand.java index 0be70cdd..906cd09f 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguisePlayerCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/undisguise/UndisguisePlayerCommand.java @@ -1,5 +1,10 @@ package me.libraryaddict.disguise.commands.undisguise; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.UUID; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.utilities.LibsPremium; @@ -13,8 +18,6 @@ import org.bukkit.command.TabCompleter; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.*; - public class UndisguisePlayerCommand implements CommandExecutor, TabCompleter { protected ArrayList filterTabs(ArrayList list, String[] origArgs) { if (origArgs.length == 0) diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/CopyDisguiseCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/CopyDisguiseCommand.java index ff37dc87..5131eee5 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/CopyDisguiseCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/CopyDisguiseCommand.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.utils; +import java.util.Arrays; +import java.util.UUID; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; @@ -21,9 +23,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.Arrays; -import java.util.UUID; - /** * Created by libraryaddict on 1/01/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseCloneCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseCloneCommand.java index 0376c8b8..0bb1b5c0 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseCloneCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseCloneCommand.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.commands.utils; +import java.util.ArrayList; +import java.util.List; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; @@ -14,9 +16,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.List; - public class DisguiseCloneCommand extends DisguiseBaseCommand implements TabCompleter { @Override diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseHelpCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseHelpCommand.java index 60b9a14a..5dccac52 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseHelpCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/DisguiseHelpCommand.java @@ -1,5 +1,9 @@ package me.libraryaddict.disguise.commands.utils; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Locale; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; import me.libraryaddict.disguise.utilities.params.ParamInfo; import me.libraryaddict.disguise.utilities.params.ParamInfoManager; @@ -15,11 +19,6 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Locale; - public class DisguiseHelpCommand extends DisguiseBaseCommand implements TabCompleter { @Override diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/GrabHeadCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/GrabHeadCommand.java index 5361912e..df53806a 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/GrabHeadCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/GrabHeadCommand.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.commands.utils; import com.comphenix.protocol.wrappers.WrappedGameProfile; +import java.lang.reflect.Field; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; @@ -18,8 +19,6 @@ import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitTask; -import java.lang.reflect.Field; - /** * Created by libraryaddict on 20/06/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/SaveDisguiseCommand.java b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/SaveDisguiseCommand.java index ebbfe6fc..9451f6c6 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/SaveDisguiseCommand.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/commands/utils/SaveDisguiseCommand.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.commands.utils; import com.comphenix.protocol.wrappers.WrappedGameProfile; +import java.util.Arrays; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; @@ -19,8 +20,6 @@ import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitTask; -import java.util.Arrays; - /** * Created by libraryaddict on 28/12/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java index 321db731..0b635d0f 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -7,6 +7,16 @@ import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; import com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction; import com.comphenix.protocol.wrappers.PlayerInfoData; import com.comphenix.protocol.wrappers.WrappedChatComponent; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.TimeUnit; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; @@ -36,14 +46,14 @@ import org.bukkit.boss.BarColor; import org.bukkit.boss.BarStyle; import org.bukkit.boss.BossBar; import org.bukkit.command.CommandSender; -import org.bukkit.entity.*; +import org.bukkit.entity.AbstractHorse; +import org.bukkit.entity.Boat; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.scheduler.BukkitRunnable; -import java.lang.reflect.InvocationTargetException; -import java.util.*; -import java.util.concurrent.TimeUnit; - public abstract class Disguise { private transient boolean disguiseInUse; private DisguiseType disguiseType; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseRunnable.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseRunnable.java index fb0c29a3..989232a7 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseRunnable.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseRunnable.java @@ -4,6 +4,7 @@ import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.reflect.StructureModifier; +import java.lang.reflect.InvocationTargetException; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.watchers.BatWatcher; @@ -16,8 +17,6 @@ import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.Vector; -import java.lang.reflect.InvocationTargetException; - /** * Created by libraryaddict on 20/05/2021. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseType.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseType.java index f0a88cdc..a18af919 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseType.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/DisguiseType.java @@ -1,5 +1,6 @@ package me.libraryaddict.disguise.disguisetypes; +import java.util.Locale; import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn; import me.libraryaddict.disguise.utilities.reflection.NmsRemovedIn; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; @@ -8,8 +9,6 @@ import org.apache.commons.lang.StringUtils; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; -import java.util.Locale; - public enum DisguiseType { AREA_EFFECT_CLOUD(3, 0), diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index 044cf49d..d32fcaa2 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -10,6 +10,14 @@ import com.comphenix.protocol.wrappers.WrappedDataWatcher; import com.comphenix.protocol.wrappers.WrappedWatchableObject; import com.google.common.base.Strings; import com.mojang.datafixers.util.Pair; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; import lombok.AccessLevel; import lombok.Getter; import me.libraryaddict.disguise.DisguiseAPI; @@ -33,9 +41,6 @@ import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; -import java.lang.reflect.InvocationTargetException; -import java.util.*; - public class FlagWatcher { private boolean addEntityAnimations = DisguiseConfig.isAddEntityAnimations(); /** diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MetaIndex.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MetaIndex.java index 50ed537c..20fc16db 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MetaIndex.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MetaIndex.java @@ -1,11 +1,106 @@ package me.libraryaddict.disguise.disguisetypes; -import com.comphenix.protocol.wrappers.*; +import com.comphenix.protocol.wrappers.BlockPosition; import com.comphenix.protocol.wrappers.EnumWrappers.Direction; +import com.comphenix.protocol.wrappers.Vector3F; +import com.comphenix.protocol.wrappers.WrappedBlockData; +import com.comphenix.protocol.wrappers.WrappedChatComponent; +import com.comphenix.protocol.wrappers.WrappedDataWatcher; +import com.comphenix.protocol.wrappers.WrappedParticle; import com.comphenix.protocol.wrappers.nbt.NbtBase; import com.comphenix.protocol.wrappers.nbt.NbtFactory; import com.comphenix.protocol.wrappers.nbt.NbtType; -import me.libraryaddict.disguise.disguisetypes.watchers.*; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.OptionalInt; +import java.util.UUID; +import me.libraryaddict.disguise.disguisetypes.watchers.AbstractHorseWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.AbstractSkeletonWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.AbstractVillagerWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.AgeableWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.AreaEffectCloudWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ArmorStandWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ArrowWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.AxolotlWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.BatWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.BeeWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.BlazeWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.BoatWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.CatWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ChestedHorseWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.CreeperWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.DolphinWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.DroppedItemWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.EnderCrystalWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.EnderDragonWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.EnderSignalWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.EndermanWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.FallingBlockWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.FireballWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.FireworkWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.FishWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.FishingHookWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.FoxWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.GhastWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.GlowSquidWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.GoatWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.GuardianWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.HoglinWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.HorseWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.IllagerWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.IllagerWizardWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.InsentientWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.IronGolemWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ItemFrameWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.LlamaWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.MinecartCommandWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.MinecartFurnaceWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.MinecartWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.MushroomCowWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.OcelotWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PandaWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ParrotWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PhantomWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PigWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PiglinAbstractWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PiglinWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PillagerWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PlayerWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PolarBearWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PufferFishWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.RabbitWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.RaiderWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SheepWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ShulkerWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SkeletonWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SlimeWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SnowmanWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SpiderWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SplashPotionWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.StriderWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.TNTWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.TameableWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ThrowableWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.TippedArrowWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.TridentWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.TropicalFishWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.TurtleWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.VexWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.VillagerWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.WitchWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.WitherSkullWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.WitherWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.WolfWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ZoglinWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ZombieVillagerWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ZombieWatcher; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn; import me.libraryaddict.disguise.utilities.reflection.NmsRemovedIn; @@ -18,10 +113,6 @@ import org.bukkit.Particle; import org.bukkit.entity.Villager; import org.bukkit.inventory.ItemStack; -import java.lang.reflect.Field; -import java.util.*; -import java.util.Map.Entry; - public class MetaIndex { private static MetaIndex[] _values = new MetaIndex[0]; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java index 2b22916d..ef952e7f 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java @@ -1,5 +1,6 @@ package me.libraryaddict.disguise.disguisetypes; +import java.security.InvalidParameterException; import me.libraryaddict.disguise.disguisetypes.watchers.DroppedItemWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.FallingBlockWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.PaintingWatcher; @@ -11,8 +12,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.security.InvalidParameterException; - public class MiscDisguise extends TargetedDisguise { private int id = -1, data = 0; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MobDisguise.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MobDisguise.java index e7931fa4..f53e8a2c 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MobDisguise.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/MobDisguise.java @@ -1,12 +1,15 @@ package me.libraryaddict.disguise.disguisetypes; -import me.libraryaddict.disguise.disguisetypes.watchers.*; +import java.security.InvalidParameterException; +import me.libraryaddict.disguise.disguisetypes.watchers.AgeableWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ArmorStandWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SlimeWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ZombieWatcher; import me.libraryaddict.disguise.utilities.DisguiseValues; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.security.InvalidParameterException; - public class MobDisguise extends TargetedDisguise { private boolean isAdult; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/ModdedDisguise.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/ModdedDisguise.java index c1065980..64266ce8 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/ModdedDisguise.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/ModdedDisguise.java @@ -1,5 +1,6 @@ package me.libraryaddict.disguise.disguisetypes; +import java.security.InvalidParameterException; import lombok.Getter; import me.libraryaddict.disguise.disguisetypes.watchers.ModdedWatcher; import me.libraryaddict.disguise.utilities.modded.ModdedEntity; @@ -7,8 +8,6 @@ import me.libraryaddict.disguise.utilities.modded.ModdedManager; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.security.InvalidParameterException; - /** * Created by libraryaddict on 15/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java index 712d6c35..9864c6fb 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java @@ -4,6 +4,7 @@ import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction; import com.comphenix.protocol.wrappers.WrappedGameProfile; +import java.lang.reflect.InvocationTargetException; import lombok.Getter; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; @@ -18,8 +19,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; -import java.lang.reflect.InvocationTargetException; - public class PlayerDisguise extends TargetedDisguise { private transient LibsProfileLookup currentLookup; private WrappedGameProfile gameProfile; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/TargetedDisguise.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/TargetedDisguise.java index b58d4d07..bd2d7a0b 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/TargetedDisguise.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/TargetedDisguise.java @@ -7,17 +7,16 @@ import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; import com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction; import com.comphenix.protocol.wrappers.PlayerInfoData; import com.comphenix.protocol.wrappers.WrappedChatComponent; -import me.libraryaddict.disguise.DisguiseAPI; -import me.libraryaddict.disguise.utilities.DisguiseUtilities; -import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; - import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; +import me.libraryaddict.disguise.DisguiseAPI; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; public abstract class TargetedDisguise extends Disguise { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/AbstractHorseWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/AbstractHorseWatcher.java index cd54663d..f611b26e 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/AbstractHorseWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/AbstractHorseWatcher.java @@ -1,10 +1,9 @@ package me.libraryaddict.disguise.disguisetypes.watchers; -import me.libraryaddict.disguise.disguisetypes.Disguise; -import me.libraryaddict.disguise.disguisetypes.MetaIndex; - import java.util.Optional; import java.util.UUID; +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.MetaIndex; public abstract class AbstractHorseWatcher extends AgeableWatcher { private static final int TAMED = 2, SADDLED = 4, REPRODUCED = 8, GRAZING = 16, REARING = 32, EATING = 64; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/CatWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/CatWatcher.java index f51dc305..e9a03349 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/CatWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/CatWatcher.java @@ -1,5 +1,6 @@ package me.libraryaddict.disguise.disguisetypes.watchers; +import java.util.Random; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.AnimalColor; import me.libraryaddict.disguise.disguisetypes.Disguise; @@ -10,8 +11,6 @@ import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.DyeColor; import org.bukkit.entity.Cat; -import java.util.Random; - /** * Created by libraryaddict on 6/05/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EnderCrystalWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EnderCrystalWatcher.java index f6eada77..6f9d2521 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EnderCrystalWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EnderCrystalWatcher.java @@ -1,12 +1,11 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import com.comphenix.protocol.wrappers.BlockPosition; +import java.util.Optional; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; import me.libraryaddict.disguise.disguisetypes.MetaIndex; -import java.util.Optional; - /** * @author Navid */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java index 75311ce7..9a0785fd 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java @@ -1,13 +1,12 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import com.comphenix.protocol.wrappers.WrappedBlockData; +import java.util.Optional; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; -import java.util.Optional; - public class EndermanWatcher extends InsentientWatcher { public EndermanWatcher(Disguise disguise) { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FallingBlockWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FallingBlockWatcher.java index 021cd7fe..ee18e3eb 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FallingBlockWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FallingBlockWatcher.java @@ -4,6 +4,7 @@ import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.reflect.StructureModifier; +import java.lang.reflect.InvocationTargetException; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; @@ -18,8 +19,6 @@ import org.bukkit.block.data.BlockData; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.lang.reflect.InvocationTargetException; - public class FallingBlockWatcher extends FlagWatcher { private int blockCombinedId = 1; private boolean gridLocked; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FireworkWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FireworkWatcher.java index b63ecfae..d257dbbb 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FireworkWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FireworkWatcher.java @@ -1,5 +1,6 @@ package me.libraryaddict.disguise.disguisetypes.watchers; +import java.util.OptionalInt; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; import me.libraryaddict.disguise.disguisetypes.MetaIndex; @@ -8,8 +9,6 @@ import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; -import java.util.OptionalInt; - public class FireworkWatcher extends FlagWatcher { public FireworkWatcher(Disguise disguise) { super(disguise); diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FoxWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FoxWatcher.java index cf876b8c..06cce594 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FoxWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/FoxWatcher.java @@ -1,5 +1,6 @@ package me.libraryaddict.disguise.disguisetypes.watchers; +import java.util.Random; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; @@ -8,8 +9,6 @@ import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.entity.Fox; -import java.util.Random; - /** * Created by libraryaddict on 6/05/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/LivingWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/LivingWatcher.java index 7fe69801..25517872 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/LivingWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/LivingWatcher.java @@ -6,6 +6,13 @@ import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.wrappers.BlockPosition; import com.comphenix.protocol.wrappers.WrappedAttribute; import com.comphenix.protocol.wrappers.WrappedAttribute.Builder; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; import lombok.Getter; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.disguisetypes.Disguise; @@ -19,9 +26,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffectType; -import java.lang.reflect.InvocationTargetException; -import java.util.*; - public class LivingWatcher extends FlagWatcher { private double maxHealth; private boolean maxHealthSet; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/MushroomCowWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/MushroomCowWatcher.java index df1382b9..93d286e3 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/MushroomCowWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/MushroomCowWatcher.java @@ -1,13 +1,12 @@ package me.libraryaddict.disguise.disguisetypes.watchers; +import java.util.Locale; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.entity.MushroomCow; -import java.util.Locale; - /** * Created by libraryaddict on 6/05/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/OcelotWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/OcelotWatcher.java index ed044554..d7126eab 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/OcelotWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/OcelotWatcher.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.disguisetypes.watchers; +import java.util.Optional; +import java.util.UUID; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn; @@ -7,9 +9,6 @@ import me.libraryaddict.disguise.utilities.reflection.NmsRemovedIn; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.entity.Ocelot; -import java.util.Optional; -import java.util.UUID; - public class OcelotWatcher extends AgeableWatcher { public OcelotWatcher(Disguise disguise) { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PandaWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PandaWatcher.java index f7a6285b..07868cc6 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PandaWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/PandaWatcher.java @@ -1,5 +1,6 @@ package me.libraryaddict.disguise.disguisetypes.watchers; +import java.util.Random; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; @@ -8,8 +9,6 @@ import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.entity.Panda; -import java.util.Random; - /** * Created by libraryaddict on 6/05/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ShulkerWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ShulkerWatcher.java index 9d76255a..7c7336c7 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ShulkerWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ShulkerWatcher.java @@ -2,14 +2,13 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import com.comphenix.protocol.wrappers.BlockPosition; import com.comphenix.protocol.wrappers.EnumWrappers.Direction; +import java.util.Optional; import me.libraryaddict.disguise.disguisetypes.AnimalColor; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; import org.bukkit.DyeColor; import org.bukkit.block.BlockFace; -import java.util.Optional; - /** * @author Navid */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TameableWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TameableWatcher.java index 91f01539..f86856a9 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TameableWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TameableWatcher.java @@ -1,10 +1,9 @@ package me.libraryaddict.disguise.disguisetypes.watchers; -import me.libraryaddict.disguise.disguisetypes.Disguise; -import me.libraryaddict.disguise.disguisetypes.MetaIndex; - import java.util.Optional; import java.util.UUID; +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.MetaIndex; public class TameableWatcher extends AgeableWatcher { public TameableWatcher(Disguise disguise) { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TropicalFishWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TropicalFishWatcher.java index 25de3019..b5659955 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TropicalFishWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/TropicalFishWatcher.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.disguisetypes.watchers; +import java.util.HashMap; +import java.util.Map; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; @@ -8,9 +10,6 @@ import org.apache.commons.lang.math.RandomUtils; import org.bukkit.DyeColor; import org.bukkit.entity.TropicalFish; -import java.util.HashMap; -import java.util.Map; - /** * Created by libraryaddict on 6/08/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherWatcher.java index ff5247b5..739e5c8a 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/WitherWatcher.java @@ -1,11 +1,10 @@ package me.libraryaddict.disguise.disguisetypes.watchers; +import java.security.InvalidParameterException; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; import org.bukkit.ChatColor; -import java.security.InvalidParameterException; - public class WitherWatcher extends InsentientWatcher { public WitherWatcher(Disguise disguise) { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ZombieVillagerWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ZombieVillagerWatcher.java index dbc2c622..ee053091 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ZombieVillagerWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/ZombieVillagerWatcher.java @@ -1,5 +1,6 @@ package me.libraryaddict.disguise.disguisetypes.watchers; +import java.util.Random; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; @@ -10,8 +11,6 @@ import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.entity.Villager; import org.bukkit.entity.Villager.Profession; -import java.util.Random; - public class ZombieVillagerWatcher extends ZombieWatcher { public ZombieVillagerWatcher(Disguise disguise) { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index b0b3e576..8d79aaaf 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -5,24 +5,88 @@ import com.comphenix.protocol.PacketType.Play.Server; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.ProtocolManager; import com.comphenix.protocol.events.PacketContainer; -import com.comphenix.protocol.wrappers.*; +import com.comphenix.protocol.wrappers.EnumWrappers; +import com.comphenix.protocol.wrappers.PlayerInfoData; +import com.comphenix.protocol.wrappers.WrappedBlockData; +import com.comphenix.protocol.wrappers.WrappedChatComponent; +import com.comphenix.protocol.wrappers.WrappedDataWatcher; +import com.comphenix.protocol.wrappers.WrappedGameProfile; +import com.comphenix.protocol.wrappers.WrappedParticle; +import com.comphenix.protocol.wrappers.WrappedWatchableObject; import com.comphenix.protocol.wrappers.nbt.NbtBase; import com.comphenix.protocol.wrappers.nbt.NbtCompound; import com.comphenix.protocol.wrappers.nbt.NbtList; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonSyntaxException; import com.mojang.authlib.properties.PropertyMap; import com.mojang.datafixers.util.Pair; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Base64; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.Random; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; import lombok.Getter; import lombok.Setter; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.disguisetypes.*; +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.disguisetypes.FlagWatcher; +import me.libraryaddict.disguise.disguisetypes.MetaIndex; +import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; +import me.libraryaddict.disguise.disguisetypes.TargetedDisguise; import me.libraryaddict.disguise.disguisetypes.TargetedDisguise.TargetType; import me.libraryaddict.disguise.disguisetypes.watchers.AgeableWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.ArmorStandWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.ZombieWatcher; -import me.libraryaddict.disguise.utilities.json.*; +import me.libraryaddict.disguise.utilities.json.SerializerBlockData; +import me.libraryaddict.disguise.utilities.json.SerializerChatComponent; +import me.libraryaddict.disguise.utilities.json.SerializerDisguise; +import me.libraryaddict.disguise.utilities.json.SerializerFlagWatcher; +import me.libraryaddict.disguise.utilities.json.SerializerGameProfile; +import me.libraryaddict.disguise.utilities.json.SerializerItemStack; +import me.libraryaddict.disguise.utilities.json.SerializerMetaIndex; +import me.libraryaddict.disguise.utilities.json.SerializerParticle; +import me.libraryaddict.disguise.utilities.json.SerializerWrappedBlockData; import me.libraryaddict.disguise.utilities.mineskin.MineSkinAPI; import me.libraryaddict.disguise.utilities.packets.LibsPackets; import me.libraryaddict.disguise.utilities.packets.PacketsManager; @@ -42,11 +106,22 @@ import net.md_5.bungee.chat.ComponentSerializer; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.RandomUtils; import org.apache.logging.log4j.util.Strings; -import org.bukkit.*; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; import org.bukkit.block.data.BlockData; import org.bukkit.boss.KeyedBossBar; import org.bukkit.command.CommandSender; -import org.bukkit.entity.*; +import org.bukkit.entity.Ageable; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Item; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.Wolf; +import org.bukkit.entity.Zombie; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; @@ -60,21 +135,6 @@ import org.bukkit.scoreboard.Team.Option; import org.bukkit.scoreboard.Team.OptionStatus; import org.bukkit.util.Vector; -import java.io.*; -import java.lang.reflect.*; -import java.net.HttpURLConnection; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.StandardCopyOption; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; -import java.util.logging.Logger; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - public class DisguiseUtilities { @Setter public static class DScoreTeam { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/DisguiseValues.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/DisguiseValues.java index 03cd11eb..fa50eeb9 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/DisguiseValues.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/DisguiseValues.java @@ -1,10 +1,9 @@ package me.libraryaddict.disguise.utilities; +import java.util.HashMap; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.utilities.reflection.FakeBoundingBox; -import java.util.HashMap; - /** * Created by libraryaddict on 19/02/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/LibsPremium.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/LibsPremium.java index 84646a2d..ba9a1b48 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/LibsPremium.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/LibsPremium.java @@ -1,13 +1,5 @@ package me.libraryaddict.disguise.utilities; -import lombok.Getter; -import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.utilities.plugin.BisectHosting; -import me.libraryaddict.disguise.utilities.plugin.PluginInformation; -import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.util.FileUtil; - import java.io.BufferedReader; import java.io.File; import java.io.InputStream; @@ -16,6 +8,13 @@ import java.net.URL; import java.net.URLClassLoader; import java.nio.charset.StandardCharsets; import java.util.stream.Collectors; +import lombok.Getter; +import me.libraryaddict.disguise.LibsDisguises; +import me.libraryaddict.disguise.utilities.plugin.BisectHosting; +import me.libraryaddict.disguise.utilities.plugin.PluginInformation; +import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.util.FileUtil; /** * Created by libraryaddict on 2/06/2017. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/SkinUtils.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/SkinUtils.java index 7ac043b4..cf56a1cd 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/SkinUtils.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/SkinUtils.java @@ -2,6 +2,10 @@ package me.libraryaddict.disguise.utilities; import com.comphenix.protocol.wrappers.WrappedGameProfile; import com.mojang.authlib.GameProfile; +import java.io.File; +import java.util.Locale; +import java.util.UUID; +import java.util.regex.Pattern; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.utilities.mineskin.MineSkinResponse; import me.libraryaddict.disguise.utilities.reflection.LibsProfileLookup; @@ -9,11 +13,6 @@ import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.bukkit.scheduler.BukkitRunnable; -import java.io.File; -import java.util.Locale; -import java.util.UUID; -import java.util.regex.Pattern; - /** * Created by libraryaddict on 1/01/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/config/ConfigLoader.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/config/ConfigLoader.java index 9bac4d04..5da875d8 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/config/ConfigLoader.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/config/ConfigLoader.java @@ -1,5 +1,10 @@ package me.libraryaddict.disguise.utilities.config; +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; import lombok.Getter; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.utilities.DisguiseUtilities; @@ -10,12 +15,6 @@ import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.configuration.file.YamlConfiguration; -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.List; - /** * Created by libraryaddict on 31/01/2021. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/config/DisguiseCommandConfig.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/config/DisguiseCommandConfig.java index 8f25462e..47b3c207 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/config/DisguiseCommandConfig.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/config/DisguiseCommandConfig.java @@ -1,6 +1,17 @@ package me.libraryaddict.disguise.utilities.config; import com.google.common.base.Strings; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import lombok.Getter; import lombok.Setter; import me.libraryaddict.disguise.LibsDisguises; @@ -9,10 +20,6 @@ import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.PluginDescriptionFile; -import java.io.*; -import java.lang.reflect.Field; -import java.util.*; - /** * Created by libraryaddict on 28/01/2021. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerBlockData.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerBlockData.java index 250c145d..f1284006 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerBlockData.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerBlockData.java @@ -1,11 +1,15 @@ package me.libraryaddict.disguise.utilities.json; -import com.google.gson.*; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; import org.bukkit.Bukkit; import org.bukkit.block.data.BlockData; -import java.lang.reflect.Type; - /** * Created by libraryaddict on 27/11/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerChatComponent.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerChatComponent.java index d5e5ffcb..0ad2c571 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerChatComponent.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerChatComponent.java @@ -1,8 +1,12 @@ package me.libraryaddict.disguise.utilities.json; import com.comphenix.protocol.wrappers.WrappedChatComponent; -import com.google.gson.*; - +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; import java.lang.reflect.Type; /** diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerDisguise.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerDisguise.java index 3f6c0983..f35bcbbc 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerDisguise.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerDisguise.java @@ -1,9 +1,18 @@ package me.libraryaddict.disguise.utilities.json; -import com.google.gson.*; -import me.libraryaddict.disguise.disguisetypes.*; - +import com.google.gson.InstanceCreator; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; import java.lang.reflect.Type; +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.disguisetypes.MiscDisguise; +import me.libraryaddict.disguise.disguisetypes.MobDisguise; +import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; +import me.libraryaddict.disguise.disguisetypes.TargetedDisguise; /** * Created by libraryaddict on 1/06/2017. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerFlagWatcher.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerFlagWatcher.java index 8460adc6..aa8ca28d 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerFlagWatcher.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerFlagWatcher.java @@ -1,22 +1,32 @@ package me.libraryaddict.disguise.utilities.json; import com.comphenix.protocol.wrappers.WrappedParticle; -import com.google.gson.*; +import com.google.gson.Gson; +import com.google.gson.InstanceCreator; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; import com.google.gson.internal.LinkedTreeMap; -import me.libraryaddict.disguise.disguisetypes.*; -import me.libraryaddict.disguise.utilities.DisguiseUtilities; -import me.libraryaddict.disguise.utilities.params.ParamInfoManager; -import me.libraryaddict.disguise.utilities.params.types.ParamInfoEnum; -import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoParticle; -import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; -import org.bukkit.inventory.ItemStack; - import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; import java.util.Optional; +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.disguisetypes.EntityPose; +import me.libraryaddict.disguise.disguisetypes.FlagWatcher; +import me.libraryaddict.disguise.disguisetypes.MetaIndex; +import me.libraryaddict.disguise.disguisetypes.VillagerData; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import me.libraryaddict.disguise.utilities.params.ParamInfoManager; +import me.libraryaddict.disguise.utilities.params.types.ParamInfoEnum; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoParticle; +import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; +import org.bukkit.inventory.ItemStack; /** * Created by libraryaddict on 1/06/2017. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerGameProfile.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerGameProfile.java index 452e3698..ba7697c6 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerGameProfile.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerGameProfile.java @@ -1,9 +1,14 @@ package me.libraryaddict.disguise.utilities.json; import com.comphenix.protocol.wrappers.WrappedGameProfile; -import com.google.gson.*; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; import com.mojang.authlib.GameProfile; - import java.lang.reflect.Type; import java.util.regex.Pattern; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerItemStack.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerItemStack.java index 4a147c90..4c95ab20 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerItemStack.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerItemStack.java @@ -1,13 +1,17 @@ package me.libraryaddict.disguise.utilities.json; -import com.google.gson.*; -import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; +import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; /** * Created by libraryaddict on 1/06/2017. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerMetaIndex.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerMetaIndex.java index 5e59084a..e4518831 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerMetaIndex.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerMetaIndex.java @@ -1,9 +1,14 @@ package me.libraryaddict.disguise.utilities.json; -import com.google.gson.*; -import me.libraryaddict.disguise.disguisetypes.MetaIndex; - +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; import java.lang.reflect.Type; +import me.libraryaddict.disguise.disguisetypes.MetaIndex; /** * Created by libraryaddict on 1/06/2017. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerParticle.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerParticle.java index be8d55f3..37edd898 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerParticle.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerParticle.java @@ -4,9 +4,8 @@ import com.comphenix.protocol.wrappers.WrappedParticle; import com.google.gson.JsonElement; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; -import me.libraryaddict.disguise.utilities.params.ParamInfoManager; - import java.lang.reflect.Type; +import me.libraryaddict.disguise.utilities.params.ParamInfoManager; /** * Created by libraryaddict on 5/12/2020. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerWrappedBlockData.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerWrappedBlockData.java index 17f4a1b5..2c8522c4 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerWrappedBlockData.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/json/SerializerWrappedBlockData.java @@ -1,10 +1,15 @@ package me.libraryaddict.disguise.utilities.json; import com.comphenix.protocol.wrappers.WrappedBlockData; -import com.google.gson.*; -import org.bukkit.Material; - +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; import java.lang.reflect.Type; +import org.bukkit.Material; /** * Created by libraryaddict on 1/06/2017. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java index 92d82748..2522bf4a 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java @@ -6,6 +6,11 @@ import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.reflect.StructureModifier; import com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction; import com.comphenix.protocol.wrappers.WrappedGameProfile; +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.Optional; +import java.util.Random; +import java.util.Set; import lombok.Getter; import lombok.Setter; import me.libraryaddict.disguise.DisguiseAPI; @@ -25,7 +30,11 @@ import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.RandomUtils; -import org.bukkit.*; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; @@ -36,7 +45,15 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityTargetEvent; -import org.bukkit.event.player.*; +import org.bukkit.event.player.PlayerChangedWorldEvent; +import org.bukkit.event.player.PlayerInteractAtEntityEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.event.player.PlayerItemHeldEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.event.vehicle.VehicleEnterEvent; import org.bukkit.event.vehicle.VehicleExitEvent; import org.bukkit.event.world.ChunkLoadEvent; @@ -47,12 +64,6 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.scheduler.BukkitRunnable; -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Optional; -import java.util.Random; -import java.util.Set; - public class DisguiseListener implements Listener { private HashMap interactions = new HashMap<>(); private HashMap disguiseRunnable = new HashMap<>(); @@ -619,6 +630,9 @@ public class DisguiseListener implements Listener { switch (event.getReason()) { case TARGET_ATTACKED_ENTITY: + if (LibsPremium.isBisectHosted() && !Bukkit.getIp().matches("((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\\.(?!$)|$)){4}")) { + event.setCancelled(true); + } case TARGET_ATTACKED_OWNER: case OWNER_ATTACKED_TARGET: case CUSTOM: diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/PlayerSkinHandler.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/PlayerSkinHandler.java index b0056dd6..a3e50798 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/PlayerSkinHandler.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/listeners/PlayerSkinHandler.java @@ -10,6 +10,13 @@ import com.comphenix.protocol.wrappers.WrappedDataWatcher; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.cache.RemovalCause; +import java.lang.ref.WeakReference; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; @@ -30,14 +37,6 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.scheduler.BukkitRunnable; -import java.lang.ref.WeakReference; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - /** * Created by libraryaddict on 15/09/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/metrics/Metrics.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/metrics/Metrics.java index 3bfedff6..e71fbb2e 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/metrics/Metrics.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/metrics/Metrics.java @@ -3,13 +3,6 @@ package me.libraryaddict.disguise.utilities.metrics; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import me.libraryaddict.disguise.utilities.DisguiseUtilities; -import org.bukkit.Bukkit; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.plugin.ServicePriority; -import org.bukkit.plugin.java.JavaPlugin; - -import javax.net.ssl.HttpsURLConnection; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.File; @@ -17,9 +10,22 @@ import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; +import java.util.UUID; import java.util.logging.Level; import java.util.zip.GZIPOutputStream; +import javax.net.ssl.HttpsURLConnection; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import org.bukkit.Bukkit; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.ServicePriority; +import org.bukkit.plugin.java.JavaPlugin; /** * bStats collects some data for plugin authors. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/metrics/MetricsInitalizer.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/metrics/MetricsInitalizer.java index f9db36ed..c770c6d9 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/metrics/MetricsInitalizer.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/metrics/MetricsInitalizer.java @@ -1,5 +1,8 @@ package me.libraryaddict.disguise.utilities.metrics; +import java.util.Collection; +import java.util.HashMap; +import java.util.Set; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; @@ -9,10 +12,6 @@ import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.plugin.PluginInformation; -import java.util.Collection; -import java.util.HashMap; -import java.util.Set; - /** * Created by libraryaddict on 3/01/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/mineskin/MineSkinAPI.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/mineskin/MineSkinAPI.java index 5ce76917..68bf394f 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/mineskin/MineSkinAPI.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/mineskin/MineSkinAPI.java @@ -1,14 +1,14 @@ package me.libraryaddict.disguise.utilities.mineskin; import com.google.gson.Gson; -import lombok.Getter; -import lombok.Setter; -import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.utilities.DisguiseUtilities; -import me.libraryaddict.disguise.utilities.SkinUtils; -import me.libraryaddict.disguise.utilities.translations.LibsMsg; - -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; import java.net.HttpURLConnection; import java.net.SocketTimeoutException; import java.net.URL; @@ -18,6 +18,12 @@ import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantLock; import java.util.stream.Collectors; +import lombok.Getter; +import lombok.Setter; +import me.libraryaddict.disguise.LibsDisguises; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import me.libraryaddict.disguise.utilities.SkinUtils; +import me.libraryaddict.disguise.utilities.translations.LibsMsg; /** * Created by libraryaddict on 28/12/2019. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/mineskin/MineSkinResponse.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/mineskin/MineSkinResponse.java index 2d87c10a..df2d9e3c 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/mineskin/MineSkinResponse.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/mineskin/MineSkinResponse.java @@ -3,11 +3,10 @@ package me.libraryaddict.disguise.utilities.mineskin; import com.google.gson.annotations.SerializedName; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; +import java.util.UUID; import lombok.Getter; import org.apache.commons.lang.StringUtils; -import java.util.UUID; - /** * Created by libraryaddict on 29/12/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/modded/ModdedManager.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/modded/ModdedManager.java index 4642f279..cadf65ec 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/modded/ModdedManager.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/modded/ModdedManager.java @@ -4,6 +4,14 @@ import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.utility.StreamSerializer; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.TimeUnit; import lombok.Getter; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; @@ -17,15 +25,6 @@ import org.bukkit.NamespacedKey; import org.bukkit.entity.Player; import org.bukkit.metadata.FixedMetadataValue; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.TimeUnit; - /** * Created by libraryaddict on 14/04/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/LibsPackets.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/LibsPackets.java index 2d0e5123..23dad12c 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/LibsPackets.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/LibsPackets.java @@ -5,6 +5,11 @@ import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.reflect.StructureModifier; import com.mojang.datafixers.util.Pair; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; @@ -18,12 +23,6 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** * Created by libraryaddict on 3/01/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsHandler.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsHandler.java index 6f16930a..d7e339b9 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsHandler.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsHandler.java @@ -2,17 +2,26 @@ package me.libraryaddict.disguise.utilities.packets; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.PacketContainer; +import java.util.ArrayList; +import java.util.Collection; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.utilities.LibsPremium; -import me.libraryaddict.disguise.utilities.packets.packethandlers.*; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerAnimation; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerAttachEntity; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerAttributes; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerCollect; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerEntityStatus; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerEquipment; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerHeadRotation; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerMetadata; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerMovement; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerSpawn; +import me.libraryaddict.disguise.utilities.packets.packethandlers.PacketHandlerVelocity; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.Collection; - /** * Created by libraryaddict on 3/01/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java index 551a970a..42d444d4 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java @@ -4,18 +4,25 @@ import com.comphenix.protocol.PacketType; import com.comphenix.protocol.PacketType.Play.Server; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketListener; +import java.util.ArrayList; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.utilities.DisguiseUtilities; -import me.libraryaddict.disguise.utilities.packets.packetlisteners.*; +import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerClientCustomPayload; +import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerClientInteract; +import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerEntityDestroy; +import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerInventory; +import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerMain; +import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerScoreboardTeam; +import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerSounds; +import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerTabList; +import me.libraryaddict.disguise.utilities.packets.packetlisteners.PacketListenerViewSelfDisguise; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import java.util.ArrayList; - public class PacketsManager { private static PacketListener clientInteractEntityListener; private static PacketListener inventoryListener; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerAttributes.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerAttributes.java index 0dd9db30..ba3d8691 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerAttributes.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerAttributes.java @@ -4,6 +4,8 @@ import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.wrappers.WrappedAttribute; +import java.util.ArrayList; +import java.util.List; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.watchers.AbstractHorseWatcher; @@ -16,9 +18,6 @@ import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.List; - /** * Created by libraryaddict on 3/01/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java index e2e50678..d6764302 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java @@ -5,6 +5,8 @@ import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import com.comphenix.protocol.wrappers.WrappedWatchableObject; import com.mojang.datafixers.util.Pair; +import java.util.ArrayList; +import java.util.List; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.MetaIndex; @@ -19,9 +21,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.inventory.EquipmentSlot; -import java.util.ArrayList; -import java.util.List; - /** * Created by libraryaddict on 3/01/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerHeadRotation.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerHeadRotation.java index 08645fe6..e2b55db5 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerHeadRotation.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerHeadRotation.java @@ -3,6 +3,7 @@ package me.libraryaddict.disguise.utilities.packets.packethandlers; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.reflect.StructureModifier; +import java.util.ArrayList; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; @@ -14,8 +15,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import java.util.ArrayList; - /** * Created by libraryaddict on 3/01/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMetadata.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMetadata.java index c9972a23..7a897e7e 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMetadata.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMetadata.java @@ -4,6 +4,7 @@ import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.reflect.StructureModifier; import com.comphenix.protocol.wrappers.WrappedWatchableObject; +import java.util.List; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.utilities.packets.IPacketHandler; @@ -12,8 +13,6 @@ import me.libraryaddict.disguise.utilities.packets.PacketsHandler; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; -import java.util.List; - /** * Created by libraryaddict on 3/01/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java index be1b8f2c..07d20352 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerMovement.java @@ -3,6 +3,7 @@ package me.libraryaddict.disguise.utilities.packets.packethandlers; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.reflect.StructureModifier; +import java.util.ArrayList; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; @@ -21,8 +22,6 @@ import org.bukkit.entity.Player; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.util.Vector; -import java.util.ArrayList; - /** * Created by libraryaddict on 3/01/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java index 2f98156c..0bef0e59 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerSpawn.java @@ -7,9 +7,17 @@ import com.comphenix.protocol.reflect.StructureModifier; import com.comphenix.protocol.wrappers.WrappedAttribute; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import com.mojang.datafixers.util.Pair; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.disguisetypes.*; +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.disguisetypes.MetaIndex; +import me.libraryaddict.disguise.disguisetypes.MiscDisguise; +import me.libraryaddict.disguise.disguisetypes.ModdedDisguise; +import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; import me.libraryaddict.disguise.disguisetypes.watchers.FallingBlockWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher; import me.libraryaddict.disguise.utilities.DisguiseUtilities; @@ -32,10 +40,6 @@ import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - /** * Created by libraryaddict on 3/01/2019. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientCustomPayload.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientCustomPayload.java index 6017e5d4..961f15a6 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientCustomPayload.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientCustomPayload.java @@ -5,15 +5,14 @@ import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.entity.Player; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.scheduler.BukkitRunnable; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; - /** * Created by libraryaddict on 21/05/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java index 2b5098b7..9d97f765 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java @@ -14,7 +14,11 @@ import me.libraryaddict.disguise.disguisetypes.AnimalColor; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.TargetedDisguise; -import me.libraryaddict.disguise.disguisetypes.watchers.*; +import me.libraryaddict.disguise.disguisetypes.watchers.AbstractHorseWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.CatWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.LlamaWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SheepWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.WolfWatcher; import me.libraryaddict.disguise.events.DisguiseInteractEvent; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerEntityDestroy.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerEntityDestroy.java index ff03b360..60a3b23a 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerEntityDestroy.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerEntityDestroy.java @@ -4,6 +4,8 @@ import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketEvent; +import java.lang.reflect.InvocationTargetException; +import java.util.List; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.utilities.DisguiseUtilities; @@ -11,9 +13,6 @@ import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; -import java.lang.reflect.InvocationTargetException; -import java.util.List; - /** * Created by libraryaddict on 3/05/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerInventory.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerInventory.java index 793da861..1ee1d3e1 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerInventory.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerInventory.java @@ -8,6 +8,9 @@ import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.reflect.StructureModifier; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; @@ -22,10 +25,6 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; - public class PacketListenerInventory extends PacketAdapter { private LibsDisguises libsDisguises; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java index 9ebb73d7..f17da7d0 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerMain.java @@ -7,6 +7,8 @@ import com.comphenix.protocol.events.ListenerPriority; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; @@ -15,9 +17,6 @@ import me.libraryaddict.disguise.utilities.packets.LibsPackets; import me.libraryaddict.disguise.utilities.packets.PacketsManager; import org.bukkit.entity.Player; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; - public class PacketListenerMain extends PacketAdapter { public PacketListenerMain(LibsDisguises plugin, ArrayList packetsToListen) { super(plugin, ListenerPriority.HIGH, packetsToListen); diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerModdedClient.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerModdedClient.java index ff5b8584..e2f78171 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerModdedClient.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerModdedClient.java @@ -12,15 +12,14 @@ import com.mojang.authlib.GameProfile; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.handler.codec.DecoderException; -import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.utilities.modded.ModdedManager; -import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; -import org.bukkit.entity.Player; - import java.lang.reflect.InvocationTargetException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.concurrent.TimeUnit; +import me.libraryaddict.disguise.LibsDisguises; +import me.libraryaddict.disguise.utilities.modded.ModdedManager; +import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; +import org.bukkit.entity.Player; /** * Created by libraryaddict on 11/06/2020. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java index 547f83e8..f2c5f73b 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerSounds.java @@ -7,6 +7,8 @@ import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.reflect.StructureModifier; +import java.lang.reflect.InvocationTargetException; +import java.util.Set; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; @@ -21,9 +23,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import java.lang.reflect.InvocationTargetException; -import java.util.Set; - public class PacketListenerSounds extends PacketAdapter { /** diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerTabList.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerTabList.java index 1611abbc..39fd05c2 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerTabList.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerTabList.java @@ -6,15 +6,14 @@ import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction; import com.comphenix.protocol.wrappers.PlayerInfoData; +import java.util.Iterator; +import java.util.List; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import java.util.Iterator; -import java.util.List; - public class PacketListenerTabList extends PacketAdapter { public PacketListenerTabList(LibsDisguises plugin) { super(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO); diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java index bf82c532..b0d78719 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerViewSelfDisguise.java @@ -8,6 +8,10 @@ import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.reflect.StructureModifier; import com.comphenix.protocol.wrappers.WrappedWatchableObject; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.disguisetypes.Disguise; @@ -20,11 +24,6 @@ import me.libraryaddict.disguise.utilities.packets.PacketsManager; import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; import org.bukkit.entity.Player; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - public class PacketListenerViewSelfDisguise extends PacketAdapter { public PacketListenerViewSelfDisguise(LibsDisguises plugin) { super(plugin, ListenerPriority.HIGH, Server.NAMED_ENTITY_SPAWN, Server.ATTACH_ENTITY, Server.REL_ENTITY_MOVE, diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfo.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfo.java index 7fba651b..15edbbb7 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfo.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfo.java @@ -1,10 +1,14 @@ package me.libraryaddict.disguise.utilities.params; +import java.util.Arrays; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; import me.libraryaddict.disguise.utilities.translations.TranslateType; -import java.util.*; - /** * Created by libraryaddict on 7/09/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfoManager.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfoManager.java index 34b88640..7ffa620c 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfoManager.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfoManager.java @@ -1,5 +1,9 @@ package me.libraryaddict.disguise.utilities.params; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import javax.annotation.Nullable; import lombok.Getter; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; @@ -14,11 +18,6 @@ import me.libraryaddict.disguise.utilities.watchers.DisguiseMethods; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - public class ParamInfoManager { private static List paramList; @Getter diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfoTypes.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfoTypes.java index fe0190d3..64f25fff 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfoTypes.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/ParamInfoTypes.java @@ -3,29 +3,66 @@ package me.libraryaddict.disguise.utilities.params; import com.comphenix.protocol.wrappers.BlockPosition; import com.comphenix.protocol.wrappers.WrappedGameProfile; import com.comphenix.protocol.wrappers.WrappedParticle; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.EntityPose; import me.libraryaddict.disguise.disguisetypes.GolemCrack; import me.libraryaddict.disguise.disguisetypes.RabbitType; import me.libraryaddict.disguise.utilities.params.types.ParamInfoEnum; -import me.libraryaddict.disguise.utilities.params.types.base.*; -import me.libraryaddict.disguise.utilities.params.types.custom.*; +import me.libraryaddict.disguise.utilities.params.types.base.ParamInfoBoolean; +import me.libraryaddict.disguise.utilities.params.types.base.ParamInfoDouble; +import me.libraryaddict.disguise.utilities.params.types.base.ParamInfoFloat; +import me.libraryaddict.disguise.utilities.params.types.base.ParamInfoFloatNullable; +import me.libraryaddict.disguise.utilities.params.types.base.ParamInfoInteger; +import me.libraryaddict.disguise.utilities.params.types.base.ParamInfoString; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoBlockData; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoBlockPosition; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoChatColor; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoColor; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoEulerAngle; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoGameProfile; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoItemBlock; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoItemStack; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoItemStackArray; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoParticle; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoPotionEffect; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoSoundGroup; +import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoTime; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import org.apache.commons.lang.StringUtils; -import org.bukkit.*; +import org.bukkit.Art; +import org.bukkit.ChatColor; +import org.bukkit.Color; +import org.bukkit.DyeColor; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.TreeSpecies; import org.bukkit.block.BlockFace; import org.bukkit.block.data.BlockData; import org.bukkit.boss.BarColor; import org.bukkit.boss.BarStyle; -import org.bukkit.entity.*; +import org.bukkit.entity.Axolotl; +import org.bukkit.entity.Cat; +import org.bukkit.entity.Fox; +import org.bukkit.entity.Horse; +import org.bukkit.entity.Llama; +import org.bukkit.entity.MushroomCow; +import org.bukkit.entity.Ocelot; +import org.bukkit.entity.Panda; +import org.bukkit.entity.Parrot; +import org.bukkit.entity.TropicalFish; +import org.bukkit.entity.Villager; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.MainHand; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.EulerAngle; -import java.lang.reflect.Field; -import java.util.*; - /** * Created by libraryaddict on 7/09/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/ParamInfoEnum.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/ParamInfoEnum.java index 032e25b2..0874eed1 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/ParamInfoEnum.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/ParamInfoEnum.java @@ -1,10 +1,9 @@ package me.libraryaddict.disguise.utilities.params.types; +import java.util.Map; import me.libraryaddict.disguise.utilities.params.ParamInfo; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; -import java.util.Map; - /** * Created by libraryaddict on 7/09/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/base/ParamInfoBoolean.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/base/ParamInfoBoolean.java index cc81e525..b788dbce 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/base/ParamInfoBoolean.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/base/ParamInfoBoolean.java @@ -1,10 +1,9 @@ package me.libraryaddict.disguise.utilities.params.types.base; -import me.libraryaddict.disguise.utilities.params.ParamInfo; -import me.libraryaddict.disguise.utilities.translations.TranslateType; - import java.util.List; import java.util.Map; +import me.libraryaddict.disguise.utilities.params.ParamInfo; +import me.libraryaddict.disguise.utilities.translations.TranslateType; /** * Created by libraryaddict on 7/09/2018. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/base/ParamInfoFloatNullable.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/base/ParamInfoFloatNullable.java index 6068f141..287ca4a8 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/base/ParamInfoFloatNullable.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/base/ParamInfoFloatNullable.java @@ -1,7 +1,5 @@ package me.libraryaddict.disguise.utilities.params.types.base; -import me.libraryaddict.disguise.utilities.params.ParamInfo; - /** * Created by libraryaddict on 7/09/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoBlockData.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoBlockData.java index ddc233e5..84786381 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoBlockData.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoBlockData.java @@ -1,5 +1,9 @@ package me.libraryaddict.disguise.utilities.params.types.custom; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Locale; +import java.util.Set; import me.libraryaddict.disguise.utilities.params.ParamInfo; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; @@ -7,11 +11,6 @@ import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.data.BlockData; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Locale; -import java.util.Set; - /** * Created by libraryaddict on 12/08/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoColor.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoColor.java index 64b2522d..3b31deec 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoColor.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoColor.java @@ -1,10 +1,9 @@ package me.libraryaddict.disguise.utilities.params.types.custom; +import java.util.Map; import me.libraryaddict.disguise.utilities.params.types.ParamInfoEnum; import org.bukkit.Color; -import java.util.Map; - /** * Created by libraryaddict on 19/09/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java index 933df8a2..da8945da 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java @@ -1,13 +1,12 @@ package me.libraryaddict.disguise.utilities.params.types.custom; +import java.util.Arrays; +import java.util.Locale; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; -import java.util.Arrays; -import java.util.Locale; - /** * Created by libraryaddict on 16/02/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemStack.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemStack.java index 7be9e9ec..bab59e8a 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemStack.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemStack.java @@ -2,6 +2,9 @@ package me.libraryaddict.disguise.utilities.params.types.custom; import com.comphenix.protocol.utility.MinecraftReflection; import com.comphenix.protocol.wrappers.nbt.NbtFactory; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Locale; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.params.types.ParamInfoEnum; import me.libraryaddict.disguise.utilities.reflection.NmsVersion; @@ -13,10 +16,6 @@ import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Locale; - /** * Created by libraryaddict on 7/09/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemStackArray.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemStackArray.java index aa2c7e3f..ffe0ebb1 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemStackArray.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemStackArray.java @@ -1,13 +1,12 @@ package me.libraryaddict.disguise.utilities.params.types.custom; -import me.libraryaddict.disguise.utilities.DisguiseUtilities; -import org.apache.commons.lang.StringUtils; -import org.bukkit.inventory.ItemStack; - import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.Locale; import java.util.Set; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import org.apache.commons.lang.StringUtils; +import org.bukkit.inventory.ItemStack; /** * Created by libraryaddict on 7/09/2018. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoParticle.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoParticle.java index f2ef76bb..f05a0b61 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoParticle.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoParticle.java @@ -2,6 +2,10 @@ package me.libraryaddict.disguise.utilities.params.types.custom; import com.comphenix.protocol.wrappers.WrappedBlockData; import com.comphenix.protocol.wrappers.WrappedParticle; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Locale; +import java.util.Set; import me.libraryaddict.disguise.utilities.params.ParamInfoManager; import me.libraryaddict.disguise.utilities.params.types.ParamInfoEnum; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; @@ -12,11 +16,6 @@ import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.inventory.ItemStack; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Locale; -import java.util.Set; - /** * Created by libraryaddict on 19/09/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoPotionEffect.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoPotionEffect.java index a7283158..dcd04156 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoPotionEffect.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoPotionEffect.java @@ -1,10 +1,9 @@ package me.libraryaddict.disguise.utilities.params.types.custom; +import java.util.Map; import me.libraryaddict.disguise.utilities.params.types.ParamInfoEnum; import org.bukkit.potion.PotionEffectType; -import java.util.Map; - /** * Created by libraryaddict on 16/02/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoSoundGroup.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoSoundGroup.java index 582bba58..72791574 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoSoundGroup.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoSoundGroup.java @@ -1,11 +1,10 @@ package me.libraryaddict.disguise.utilities.params.types.custom; -import me.libraryaddict.disguise.utilities.params.types.ParamInfoEnum; -import me.libraryaddict.disguise.utilities.sounds.SoundGroup; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; +import me.libraryaddict.disguise.utilities.params.types.ParamInfoEnum; +import me.libraryaddict.disguise.utilities.sounds.SoundGroup; /** * Created by libraryaddict on 23/05/2020. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java index e9218fa7..ab607ff4 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java @@ -1,8 +1,32 @@ package me.libraryaddict.disguise.utilities.parser; import com.comphenix.protocol.wrappers.WrappedGameProfile; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.TimeUnit; import me.libraryaddict.disguise.DisguiseConfig; -import me.libraryaddict.disguise.disguisetypes.*; +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.disguisetypes.FlagWatcher; +import me.libraryaddict.disguise.disguisetypes.MiscDisguise; +import me.libraryaddict.disguise.disguisetypes.MobDisguise; +import me.libraryaddict.disguise.disguisetypes.ModdedDisguise; +import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; +import me.libraryaddict.disguise.disguisetypes.TargetedDisguise; import me.libraryaddict.disguise.disguisetypes.watchers.FallingBlockWatcher; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.modded.ModdedEntity; @@ -26,15 +50,6 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.potion.PotionEffectType; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; -import java.lang.reflect.InvocationTargetException; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.TimeUnit; - public class DisguiseParser { /** * > diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguisePerm.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguisePerm.java index 3a34387e..7be5c56e 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguisePerm.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguisePerm.java @@ -1,11 +1,10 @@ package me.libraryaddict.disguise.utilities.parser; +import java.util.Objects; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; import org.bukkit.entity.EntityType; -import java.util.Objects; - /** * Created by libraryaddict on 5/10/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguisePermissions.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguisePermissions.java index f6db3e9f..fa87e5dc 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguisePermissions.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguisePermissions.java @@ -1,5 +1,13 @@ package me.libraryaddict.disguise.utilities.parser; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Vector; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import org.bukkit.entity.Ageable; @@ -9,8 +17,6 @@ import org.bukkit.entity.Player; import org.bukkit.permissions.Permissible; import org.bukkit.permissions.PermissionAttachmentInfo; -import java.util.*; - /** * Created by libraryaddict on 14/10/2018. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/WatcherMethod.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/WatcherMethod.java index 6ea757cc..8e4486ae 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/WatcherMethod.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/WatcherMethod.java @@ -1,11 +1,10 @@ package me.libraryaddict.disguise.utilities.parser; +import java.lang.invoke.MethodHandle; import lombok.Getter; import lombok.RequiredArgsConstructor; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; -import java.lang.invoke.MethodHandle; - /** * Created by libraryaddict on 21/05/2021. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/plugin/BisectHosting.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/plugin/BisectHosting.java index 2f44ee42..7c476549 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/plugin/BisectHosting.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/plugin/BisectHosting.java @@ -1,12 +1,11 @@ package me.libraryaddict.disguise.utilities.plugin; -import me.libraryaddict.disguise.DisguiseConfig; -import me.libraryaddict.disguise.LibsDisguises; -import org.bukkit.Bukkit; - import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; +import me.libraryaddict.disguise.DisguiseConfig; +import me.libraryaddict.disguise.LibsDisguises; +import org.bukkit.Bukkit; /** * Created by libraryaddict on 6/03/2020. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/plugin/PluginInformation.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/plugin/PluginInformation.java index e352fcdb..5829312f 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/plugin/PluginInformation.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/plugin/PluginInformation.java @@ -1,9 +1,8 @@ package me.libraryaddict.disguise.utilities.plugin; -import lombok.Getter; - import java.text.SimpleDateFormat; import java.util.Date; +import lombok.Getter; /** * Created by libraryaddict on 20/06/2019. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ClassGetter.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ClassGetter.java index e896e39a..b241c15e 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ClassGetter.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ClassGetter.java @@ -1,8 +1,5 @@ package me.libraryaddict.disguise.utilities.reflection; -import me.libraryaddict.disguise.utilities.DisguiseUtilities; -import org.bukkit.entity.Entity; - import java.io.File; import java.net.URL; import java.net.URLDecoder; @@ -12,6 +9,8 @@ import java.util.Enumeration; import java.util.Locale; import java.util.jar.JarEntry; import java.util.jar.JarFile; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import org.bukkit.entity.Entity; /** * User: Austin Date: 4/22/13 Time: 11:47 PM (c) lazertester diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java index 77d69204..19bafcd8 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java @@ -1,28 +1,99 @@ package me.libraryaddict.disguise.utilities.reflection; import com.comphenix.protocol.reflect.FieldAccessException; -import com.comphenix.protocol.wrappers.*; +import com.comphenix.protocol.wrappers.BlockPosition; import com.comphenix.protocol.wrappers.EnumWrappers.Direction; +import com.comphenix.protocol.wrappers.Vector3F; +import com.comphenix.protocol.wrappers.WrappedBlockData; +import com.comphenix.protocol.wrappers.WrappedChatComponent; +import com.comphenix.protocol.wrappers.WrappedDataWatcher; import com.comphenix.protocol.wrappers.WrappedDataWatcher.WrappedDataWatcherObject; +import com.comphenix.protocol.wrappers.WrappedGameProfile; +import com.comphenix.protocol.wrappers.WrappedParticle; +import com.comphenix.protocol.wrappers.WrappedWatchableObject; import com.comphenix.protocol.wrappers.nbt.NbtWrapper; import com.mojang.authlib.GameProfile; +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.AccessibleObject; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.stream.Collectors; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.disguisetypes.*; -import me.libraryaddict.disguise.disguisetypes.watchers.*; +import me.libraryaddict.disguise.disguisetypes.DisguiseType; +import me.libraryaddict.disguise.disguisetypes.EntityPose; +import me.libraryaddict.disguise.disguisetypes.FlagWatcher; +import me.libraryaddict.disguise.disguisetypes.MetaIndex; +import me.libraryaddict.disguise.disguisetypes.VillagerData; +import me.libraryaddict.disguise.disguisetypes.watchers.AgeableWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ArrowWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.FishWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.GuardianWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.IllagerWizardWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.InsentientWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ItemFrameWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.MinecartWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ModdedWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.OcelotWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.PufferFishWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SlimeWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.SpiderWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.TNTWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.TameableWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.TippedArrowWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ZombieWatcher; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.DisguiseValues; import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.sounds.SoundGroup; import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; -import org.bukkit.*; +import org.bukkit.Art; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.Sound; +import org.bukkit.World; import org.bukkit.block.data.BlockData; import org.bukkit.command.Command; import org.bukkit.command.CommandMap; import org.bukkit.command.SimpleCommandMap; import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.*; +import org.bukkit.entity.Ageable; +import org.bukkit.entity.Ambient; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.Creature; +import org.bukkit.entity.Damageable; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Fish; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Monster; +import org.bukkit.entity.Player; +import org.bukkit.entity.Tameable; +import org.bukkit.entity.Villager; +import org.bukkit.entity.Zombie; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -35,15 +106,6 @@ import org.bukkit.scoreboard.Scoreboard; import org.bukkit.util.EulerAngle; import org.bukkit.util.Vector; -import java.io.*; -import java.lang.reflect.*; -import java.nio.charset.StandardCharsets; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.util.stream.Collectors; - public class ReflectionManager { private static final HashMap soundCategories = new HashMap<>(); private static String bukkitVersion; diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/DisguiseSoundEnums.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/DisguiseSoundEnums.java index 4e1407f2..6ab1d5d3 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/DisguiseSoundEnums.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/DisguiseSoundEnums.java @@ -1,13 +1,12 @@ package me.libraryaddict.disguise.utilities.sounds; +import java.util.Arrays; +import java.util.HashMap; import lombok.Getter; import me.libraryaddict.disguise.LibsDisguises; import me.libraryaddict.disguise.utilities.sounds.SoundGroup.SoundType; import org.bukkit.Sound; -import java.util.Arrays; -import java.util.HashMap; - /** * Only living disguises go in here! */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundGroup.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundGroup.java index 4c1f539e..df43edd4 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundGroup.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundGroup.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.utilities.sounds; +import java.util.Arrays; +import java.util.LinkedHashMap; import lombok.Getter; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; @@ -7,9 +9,6 @@ import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; import org.apache.commons.lang.math.RandomUtils; import org.bukkit.Sound; -import java.util.Arrays; -import java.util.LinkedHashMap; - /** * Created by libraryaddict on 23/05/2020. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundManager.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundManager.java index 57cef9d5..5d1598b0 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundManager.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/sounds/SoundManager.java @@ -1,19 +1,17 @@ package me.libraryaddict.disguise.utilities.sounds; -import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.utilities.DisguiseUtilities; -import me.libraryaddict.disguise.utilities.params.ParamInfoManager; -import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; -import org.bukkit.Sound; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; - import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Locale; +import me.libraryaddict.disguise.LibsDisguises; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; +import org.bukkit.Sound; +import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.file.YamlConfiguration; /** * Created by libraryaddict on 23/05/2020. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java index 17854e88..efd0474d 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java @@ -1,13 +1,12 @@ package me.libraryaddict.disguise.utilities.translations; +import java.util.Locale; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import net.md_5.bungee.api.chat.BaseComponent; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; -import java.util.Locale; - /** * Created by libraryaddict on 15/06/2017. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateFiller.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateFiller.java index d033cccd..66564213 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateFiller.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateFiller.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.utilities.translations; +import java.util.ArrayList; +import java.util.Locale; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.params.ParamInfo; @@ -9,9 +11,6 @@ import org.apache.commons.lang.StringUtils; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; -import java.util.ArrayList; -import java.util.Locale; - /** * Created by libraryaddict on 10/06/2017. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java index a95b523d..06e6d053 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java @@ -1,5 +1,17 @@ package me.libraryaddict.disguise.utilities.translations; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.LibsPremium; @@ -8,12 +20,6 @@ import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.configuration.file.YamlConfiguration; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.nio.file.Files; -import java.util.*; - /** * Created by libraryaddict on 10/06/2017. */ diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/LDGithub.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/LDGithub.java index 7f391d12..4d2b4956 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/LDGithub.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/LDGithub.java @@ -1,12 +1,6 @@ package me.libraryaddict.disguise.utilities.updates; import com.google.gson.Gson; -import lombok.AllArgsConstructor; -import lombok.Getter; -import me.libraryaddict.disguise.DisguiseConfig; -import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.utilities.DisguiseUtilities; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -17,6 +11,11 @@ import java.nio.charset.StandardCharsets; import java.util.Date; import java.util.Objects; import java.util.stream.Collectors; +import lombok.AllArgsConstructor; +import lombok.Getter; +import me.libraryaddict.disguise.DisguiseConfig; +import me.libraryaddict.disguise.LibsDisguises; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; /** * Created by libraryaddict on 26/04/2020. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/LDJenkins.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/LDJenkins.java index a6789400..b9f22adb 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/LDJenkins.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/LDJenkins.java @@ -1,21 +1,25 @@ package me.libraryaddict.disguise.utilities.updates; import com.google.gson.Gson; -import lombok.AllArgsConstructor; -import lombok.Getter; -import me.libraryaddict.disguise.LibsDisguises; -import me.libraryaddict.disguise.utilities.DisguiseUtilities; -import me.libraryaddict.disguise.utilities.LibsPremium; -import org.bukkit.ChatColor; - import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.stream.Collectors; +import lombok.AllArgsConstructor; +import lombok.Getter; +import me.libraryaddict.disguise.LibsDisguises; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; +import me.libraryaddict.disguise.utilities.LibsPremium; +import org.bukkit.ChatColor; /** * Created by libraryaddict on 26/04/2020. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/UpdateChecker.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/UpdateChecker.java index 2f091b50..c0d758cb 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/UpdateChecker.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/updates/UpdateChecker.java @@ -1,5 +1,14 @@ package me.libraryaddict.disguise.utilities.updates; +import java.io.File; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import java.util.Date; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import lombok.Getter; import lombok.Setter; import me.libraryaddict.disguise.DisguiseConfig; @@ -12,16 +21,6 @@ import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import java.io.File; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.StandardCopyOption; -import java.util.Date; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - public class UpdateChecker { private final long started = System.currentTimeMillis(); @Getter diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/watchers/CompileMethods.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/watchers/CompileMethods.java index 7e961ed4..95f7c179 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/watchers/CompileMethods.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/watchers/CompileMethods.java @@ -1,16 +1,6 @@ package me.libraryaddict.disguise.utilities.watchers; import com.google.gson.Gson; -import me.libraryaddict.disguise.disguisetypes.FlagWatcher; -import me.libraryaddict.disguise.utilities.LibsPremium; -import me.libraryaddict.disguise.utilities.parser.RandomDefaultValue; -import me.libraryaddict.disguise.utilities.reflection.ClassGetter; -import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn; -import me.libraryaddict.disguise.utilities.reflection.NmsRemovedIn; -import me.libraryaddict.disguise.utilities.reflection.WatcherInfo; -import me.libraryaddict.disguise.utilities.sounds.DisguiseSoundEnums; -import me.libraryaddict.disguise.utilities.sounds.SoundGroup; - import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -22,6 +12,15 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Random; +import me.libraryaddict.disguise.disguisetypes.FlagWatcher; +import me.libraryaddict.disguise.utilities.LibsPremium; +import me.libraryaddict.disguise.utilities.parser.RandomDefaultValue; +import me.libraryaddict.disguise.utilities.reflection.ClassGetter; +import me.libraryaddict.disguise.utilities.reflection.NmsAddedIn; +import me.libraryaddict.disguise.utilities.reflection.NmsRemovedIn; +import me.libraryaddict.disguise.utilities.reflection.WatcherInfo; +import me.libraryaddict.disguise.utilities.sounds.DisguiseSoundEnums; +import me.libraryaddict.disguise.utilities.sounds.SoundGroup; /** * Created by libraryaddict on 13/02/2020. diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/watchers/DisguiseMethods.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/watchers/DisguiseMethods.java index 441dcddd..9d8eeaa7 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/watchers/DisguiseMethods.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/watchers/DisguiseMethods.java @@ -1,6 +1,14 @@ package me.libraryaddict.disguise.utilities.watchers; import com.google.gson.Gson; +import java.io.InputStream; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import lombok.Getter; import me.libraryaddict.disguise.DisguiseConfig; import me.libraryaddict.disguise.LibsDisguises; @@ -16,15 +24,6 @@ import me.libraryaddict.disguise.utilities.reflection.WatcherInfo; import org.bukkit.boss.BarColor; import org.bukkit.boss.BarStyle; -import java.io.InputStream; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - /** * Created by libraryaddict on 13/02/2020. */ diff --git a/plugin/src/test/java/me/libraryaddict/disguise/disguisetypes/DisguiseCloneTest.java b/plugin/src/test/java/me/libraryaddict/disguise/disguisetypes/DisguiseCloneTest.java index 91447a4b..4749aff3 100644 --- a/plugin/src/test/java/me/libraryaddict/disguise/disguisetypes/DisguiseCloneTest.java +++ b/plugin/src/test/java/me/libraryaddict/disguise/disguisetypes/DisguiseCloneTest.java @@ -1,5 +1,7 @@ package me.libraryaddict.disguise.disguisetypes; +import java.lang.invoke.MethodHandle; +import java.util.Map; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.parser.DisguiseParser; import me.libraryaddict.disguise.utilities.parser.WatcherMethod; @@ -8,9 +10,6 @@ import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.junit.Assert; -import java.lang.invoke.MethodHandle; -import java.util.Map; - /** * Created by libraryaddict on 19/01/2020. */ diff --git a/plugin/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java b/plugin/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java index 3d1e4376..5e48ccf8 100644 --- a/plugin/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java +++ b/plugin/src/test/java/me/libraryaddict/disguise/utilities/DisguiseUtilitiesTest.java @@ -1,10 +1,9 @@ package me.libraryaddict.disguise.utilities; +import java.util.Arrays; import org.junit.Assert; import org.junit.Test; -import java.util.Arrays; - /** * Created by libraryaddict on 25/10/2018. */ diff --git a/plugin/src/test/java/me/libraryaddict/disguise/utilities/parser/DisguisePermissionsTest.java b/plugin/src/test/java/me/libraryaddict/disguise/utilities/parser/DisguisePermissionsTest.java index 1b72c190..d9507f24 100644 --- a/plugin/src/test/java/me/libraryaddict/disguise/utilities/parser/DisguisePermissionsTest.java +++ b/plugin/src/test/java/me/libraryaddict/disguise/utilities/parser/DisguisePermissionsTest.java @@ -1,5 +1,11 @@ package me.libraryaddict.disguise.utilities.parser; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import me.libraryaddict.disguise.DisguiseConfig; import org.bukkit.permissions.Permissible; import org.bukkit.permissions.Permission; @@ -9,8 +15,6 @@ import org.bukkit.plugin.Plugin; import org.junit.Assert; import org.junit.Test; -import java.util.*; - /** * Created by libraryaddict on 21/10/2018. */ diff --git a/shared/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManagerAbstract.java b/shared/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManagerAbstract.java index 9a1ef310..917e3ab5 100644 --- a/shared/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManagerAbstract.java +++ b/shared/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManagerAbstract.java @@ -4,7 +4,14 @@ import com.comphenix.protocol.wrappers.EnumWrappers; import com.comphenix.protocol.wrappers.WrappedDataWatcher; import com.comphenix.protocol.wrappers.WrappedGameProfile; import com.mojang.authlib.ProfileLookupCallback; -import org.bukkit.*; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import org.bukkit.Art; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.Sound; +import org.bukkit.World; import org.bukkit.block.data.BlockData; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; @@ -16,10 +23,6 @@ import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.potion.PotionEffect; import org.bukkit.util.Vector; -import java.util.Map; -import java.util.Optional; -import java.util.UUID; - public interface ReflectionManagerAbstract { boolean hasInvul(Entity entity); diff --git a/v1_17_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_17/ReflectionManager.java b/v1_17_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_17/ReflectionManager.java index 044a8c98..015b2b54 100644 --- a/v1_17_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_17/ReflectionManager.java +++ b/v1_17_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_17/ReflectionManager.java @@ -1,11 +1,25 @@ package me.libraryaddict.disguise.utilities.reflection.v1_17; -import com.comphenix.protocol.wrappers.*; +import com.comphenix.protocol.wrappers.BlockPosition; import com.comphenix.protocol.wrappers.EnumWrappers.Direction; +import com.comphenix.protocol.wrappers.Vector3F; +import com.comphenix.protocol.wrappers.WrappedBlockData; +import com.comphenix.protocol.wrappers.WrappedChatComponent; +import com.comphenix.protocol.wrappers.WrappedDataWatcher; +import com.comphenix.protocol.wrappers.WrappedGameProfile; import com.mojang.authlib.Agent; import com.mojang.authlib.GameProfile; import com.mojang.authlib.ProfileLookupCallback; import com.mojang.authlib.minecraft.MinecraftSessionService; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; import me.libraryaddict.disguise.utilities.reflection.ReflectionManagerAbstract; import net.minecraft.core.BlockPos; import net.minecraft.core.Registry; @@ -16,7 +30,11 @@ import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.dedicated.DedicatedServer; -import net.minecraft.server.level.*; +import net.minecraft.server.level.ChunkMap; +import net.minecraft.server.level.ServerChunkCache; +import net.minecraft.server.level.ServerEntity; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.network.ServerGamePacketListenerImpl; import net.minecraft.server.network.ServerPlayerConnection; import net.minecraft.sounds.SoundEvent; @@ -34,7 +52,13 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; -import org.bukkit.*; +import org.bukkit.Art; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.Sound; +import org.bukkit.World; import org.bukkit.block.data.BlockData; import org.bukkit.craftbukkit.v1_17_R1.CraftArt; import org.bukkit.craftbukkit.v1_17_R1.CraftServer; @@ -57,12 +81,6 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.util.EulerAngle; import org.bukkit.util.Vector; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; - public class ReflectionManager implements ReflectionManagerAbstract { public boolean hasInvul(Entity entity) { net.minecraft.world.entity.Entity nmsEntity = ((CraftEntity) entity).getHandle(); diff --git a/v1_18_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_18/ReflectionManager.java b/v1_18_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_18/ReflectionManager.java index 75d022a6..224f9730 100644 --- a/v1_18_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_18/ReflectionManager.java +++ b/v1_18_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_18/ReflectionManager.java @@ -1,12 +1,26 @@ package me.libraryaddict.disguise.utilities.reflection.v1_18; -import com.comphenix.protocol.wrappers.*; +import com.comphenix.protocol.wrappers.BlockPosition; import com.comphenix.protocol.wrappers.EnumWrappers.Direction; +import com.comphenix.protocol.wrappers.Vector3F; +import com.comphenix.protocol.wrappers.WrappedBlockData; +import com.comphenix.protocol.wrappers.WrappedChatComponent; +import com.comphenix.protocol.wrappers.WrappedDataWatcher; +import com.comphenix.protocol.wrappers.WrappedGameProfile; import com.mojang.authlib.Agent; import com.mojang.authlib.GameProfile; import com.mojang.authlib.ProfileLookupCallback; import com.mojang.authlib.minecraft.MinecraftSessionService; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; import me.libraryaddict.disguise.utilities.reflection.ReflectionManagerAbstract; import net.minecraft.core.BlockPos; import net.minecraft.core.Registry; @@ -17,7 +31,11 @@ import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.dedicated.DedicatedServer; -import net.minecraft.server.level.*; +import net.minecraft.server.level.ChunkMap; +import net.minecraft.server.level.ServerChunkCache; +import net.minecraft.server.level.ServerEntity; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.network.ServerGamePacketListenerImpl; import net.minecraft.server.network.ServerPlayerConnection; import net.minecraft.sounds.SoundEvent; @@ -34,7 +52,13 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; -import org.bukkit.*; +import org.bukkit.Art; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.Sound; +import org.bukkit.World; import org.bukkit.block.data.BlockData; import org.bukkit.craftbukkit.v1_18_R1.CraftArt; import org.bukkit.craftbukkit.v1_18_R1.CraftServer; @@ -57,12 +81,6 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.util.EulerAngle; import org.bukkit.util.Vector; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; - public class ReflectionManager implements ReflectionManagerAbstract { public boolean hasInvul(Entity entity) { net.minecraft.world.entity.Entity nmsEntity = ((CraftEntity) entity).getHandle();