From 256ac67cf1e10802f17be7d411f1ad61decde88d Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Tue, 12 Sep 2023 00:41:17 +0800 Subject: [PATCH] Optimise all imports --- config/mv_checks.xml | 4 +-- .../MultiverseCore/MultiverseCore.java | 12 +++---- .../MultiverseCore/anchor/AnchorManager.java | 16 ++++----- .../MultiverseCore/api/Destination.java | 4 +-- .../MultiverseCore/api/MVWorld.java | 4 +-- .../MultiverseCore/api/MVWorldManager.java | 6 ++-- .../MultiverseCore/api/SafeTTeleporter.java | 4 +-- .../MultiverseCore/api/Teleporter.java | 4 +-- .../MultiverseCore/api/WorldPurger.java | 4 +-- .../commands/CreateCommand.java | 6 ++-- .../MultiverseCore/commands/DumpsCommand.java | 20 +++++------ .../commands/GamerulesCommand.java | 6 ++-- .../MultiverseCore/commands/ListCommand.java | 6 ++-- .../MultiverseCore/commands/RegenCommand.java | 6 ++-- .../commands/ReloadCommand.java | 6 ++-- .../commands/TeleportCommand.java | 6 ++-- .../commandtools/MVCommandCompletions.java | 16 ++++----- .../commandtools/MVCommandContexts.java | 6 ++-- .../commandtools/MVCommandManager.java | 4 +-- .../commandtools/flags/CommandFlag.java | 4 +-- .../commandtools/flags/CommandFlagGroup.java | 6 ++-- .../flags/CommandFlagsManager.java | 10 +++--- .../commandtools/flags/CommandValueFlag.java | 8 ++--- .../flags/ParsedCommandFlags.java | 6 ++-- .../queue/CommandQueueManager.java | 6 ++-- .../queue/DummyCommandBlockSender.java | 6 ++-- .../MultiverseCore/config/MVCoreConfig.java | 8 ++--- .../handle/CommentedYamlConfigHandle.java | 8 ++--- .../handle/ConfigurationSectionHandle.java | 4 +-- .../handle/FileConfigHandle.java | 10 +++--- .../handle/GenericConfigHandle.java | 4 +-- .../handle/YamlConfigHandle.java | 8 ++--- .../migration/ConfigMigrator.java | 6 ++-- .../migration/MoveMigratorAction.java | 4 +-- .../migration/VersionMigrator.java | 4 +-- .../configuration/node/ConfigHeaderNode.java | 6 ++-- .../configuration/node/ConfigNode.java | 6 ++-- .../node/ConfigNodeNotFoundException.java | 6 ++-- .../configuration/node/NodeGroup.java | 8 ++--- .../destination/DestinationsProvider.java | 12 +++---- .../destination/core/AnchorDestination.java | 4 +-- .../destination/core/BedDestination.java | 8 ++--- .../destination/core/CannonDestination.java | 6 ++-- .../destination/core/ExactDestination.java | 6 ++-- .../destination/core/PlayerDestination.java | 6 ++-- .../destination/core/WorldDestination.java | 6 ++-- .../display/ContentDisplay.java | 8 ++--- .../display/filters/RegexContentFilter.java | 6 ++-- .../display/handlers/BaseSendHandler.java | 6 ++-- .../display/handlers/DefaultSendHandler.java | 4 +-- .../display/handlers/InlineSendHandler.java | 4 +-- .../display/handlers/PagedSendHandler.java | 4 +-- .../display/handlers/SendHandler.java | 4 +-- .../display/parsers/ContentProvider.java | 4 +-- .../display/parsers/ListContentProvider.java | 6 ++-- .../display/parsers/MapContentProvider.java | 8 ++--- .../MultiverseCore/economy/ItemEconomy.java | 4 +-- .../event/MVConfigReloadEvent.java | 4 +-- .../MultiverseCore/event/MVVersionEvent.java | 8 ++--- .../inject/binder/PluginBinder.java | 4 +-- .../listeners/MVPlayerListener.java | 8 ++--- .../teleportation/SimpleBlockSafety.java | 8 ++--- .../SimpleLocationManipulation.java | 12 +++---- .../teleportation/SimpleSafeTTeleporter.java | 4 +-- .../teleportation/TeleportQueue.java | 6 ++-- .../MultiverseCore/utils/PlayerFinder.java | 12 +++---- .../MultiverseCore/utils/ReflectHelper.java | 4 +-- .../utils/UnsafeCallWrapper.java | 4 +-- .../utils/file/FileResClassLoader.java | 4 +-- .../MultiverseCore/utils/file/FileUtils.java | 8 ++--- .../utils/message/LocalizedMessage.java | 4 +-- .../MultiverseCore/utils/message/Message.java | 4 +-- .../utils/metrics/MetricsConfigurator.java | 6 ++-- .../utils/metrics/MetricsHelper.java | 6 ++-- .../MultiverseCore/utils/result/Attempt.java | 6 ++-- .../MultiverseCore/utils/result/Result.java | 6 ++-- .../utils/result/ResultChain.java | 8 ++--- .../utils/webpaste/BitlyURLShortener.java | 6 ++-- .../utils/webpaste/GitHubPasteService.java | 8 ++--- .../utils/webpaste/McloGsPasteService.java | 6 ++-- .../utils/webpaste/PasteGGPasteService.java | 8 ++--- .../utils/webpaste/PastesDevPasteService.java | 6 ++-- .../MultiverseCore/world/SimpleMVWorld.java | 10 +++--- .../world/SimpleMVWorldManager.java | 36 +++++++++---------- .../world/SimpleWorldPurger.java | 8 ++--- .../world/WorldNameChecker.java | 8 ++--- .../MultiverseCore/world/WorldProperties.java | 16 ++++----- .../world/configuration/EntryFee.java | 4 +-- .../world/configuration/SpawnSettings.java | 4 +-- .../world/configuration/SubSpawnSettings.java | 8 ++--- .../worldnew/LoadedMultiverseWorld.java | 6 ++-- .../worldnew/MultiverseWorld.java | 6 ++-- .../MultiverseCore/worldnew/WorldManager.java | 28 +++++++-------- .../worldnew/WorldNameChecker.java | 8 ++--- .../MultiverseCore/worldnew/WorldPurger.java | 10 +++--- .../worldnew/config/LegacyAliasMigrator.java | 4 +-- .../worldnew/config/NullLocation.java | 6 ++-- .../worldnew/config/SpawnLocation.java | 10 +++--- .../worldnew/config/WorldConfig.java | 6 ++-- .../worldnew/config/WorldConfigNodes.java | 6 ++-- .../worldnew/config/WorldsConfigManager.java | 18 +++++----- .../entrycheck/WorldEntryChecker.java | 8 ++--- .../worldnew/generators/GeneratorPlugin.java | 4 +-- .../generators/GeneratorProvider.java | 22 ++++++------ .../generators/SimpleGeneratorPlugin.java | 6 ++-- .../worldnew/helpers/DataStore.java | 8 ++--- .../worldnew/helpers/FilesManipulator.java | 10 +++--- .../worldnew/options/CreateWorldOptions.java | 4 +-- .../worldnew/options/RegenWorldOptions.java | 4 +-- .../MultiverseCore/TestDebugMode.java | 15 ++++---- .../MultiverseCore/TestEntitySpawnRules.java | 28 +++++++-------- .../TestEntryFeeConversion.java | 8 ++--- .../MultiverseCore/TestModifyCommand.java | 12 +++---- .../MultiverseCore/TestWorldProperties.java | 19 ++++------ .../MultiverseCore/TestWorldPurger.java | 16 ++++----- .../MultiverseCore/TestWorldStuff.java | 27 +++++--------- .../MultiverseCore/utils/FileUtilsTest.java | 12 +++---- .../utils/MockWorldFactory.java | 28 +++++++-------- .../utils/TestInstanceCreator.java | 29 +++++++-------- .../MultiverseCore/utils/Util.java | 2 +- .../core/commandtools/LocalizationTest.kt | 6 +--- .../multiverse/core/config/ConfigTest.kt | 8 +---- .../multiverse/core/inject/InjectionTest.kt | 13 ++----- .../multiverse/core/world/WorldConfigTest.kt | 8 +---- .../multiverse/core/world/WorldManagerTest.kt | 6 +--- 125 files changed, 493 insertions(+), 546 deletions(-) diff --git a/config/mv_checks.xml b/config/mv_checks.xml index 076b2eb3..ca3916ba 100644 --- a/config/mv_checks.xml +++ b/config/mv_checks.xml @@ -226,8 +226,8 @@ - + value="STANDARD_JAVA###THIRD_PARTY_PACKAGE###STATIC"/> + diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java index b832f7c9..f099c7d9 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -7,6 +7,12 @@ package com.onarandombox.MultiverseCore; +import java.io.File; +import java.lang.annotation.Annotation; +import java.util.List; +import java.util.logging.Logger; +import java.util.stream.Collectors; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.anchor.AnchorManager; import com.onarandombox.MultiverseCore.api.Destination; @@ -41,12 +47,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.io.File; -import java.lang.annotation.Annotation; -import java.util.List; -import java.util.logging.Logger; -import java.util.stream.Collectors; - /** * The implementation of the Multiverse-{@link MVCore}. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/anchor/AnchorManager.java b/src/main/java/com/onarandombox/MultiverseCore/anchor/AnchorManager.java index 3d256f18..fba7e136 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/anchor/AnchorManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/anchor/AnchorManager.java @@ -7,6 +7,14 @@ package com.onarandombox.MultiverseCore.anchor; +import java.io.File; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.api.LocationManipulation; @@ -20,14 +28,6 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.jvnet.hk2.annotations.Service; -import java.io.File; -import java.io.IOException; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - /** * Manages anchors. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/Destination.java b/src/main/java/com/onarandombox/MultiverseCore/api/Destination.java index 41111e7c..8fd8d17f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/Destination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/Destination.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.api; +import java.util.Collection; + import co.aikar.commands.BukkitCommandIssuer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Contract; -import java.util.Collection; - @Contract public interface Destination { /** diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/api/MVWorld.java index b839e0c3..0ddcd7ba 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/MVWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/MVWorld.java @@ -7,6 +7,8 @@ package com.onarandombox.MultiverseCore.api; +import java.util.List; + import com.onarandombox.MultiverseCore.exceptions.PropertyDoesNotExistException; import com.onarandombox.MultiverseCore.world.configuration.AddProperties; import com.onarandombox.MultiverseCore.world.configuration.AllowedPortalType; @@ -21,8 +23,6 @@ import org.bukkit.WorldType; import org.bukkit.permissions.Permission; import org.jetbrains.annotations.Nullable; -import java.util.List; - /** * The API for a Multiverse Handled World. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java b/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java index 2ed6ea09..c5b21f79 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java @@ -7,6 +7,9 @@ package com.onarandombox.MultiverseCore.api; +import java.util.Collection; +import java.util.List; + import org.bukkit.World; import org.bukkit.World.Environment; import org.bukkit.WorldType; @@ -14,9 +17,6 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.generator.ChunkGenerator; import org.jvnet.hk2.annotations.Contract; -import java.util.Collection; -import java.util.List; - /** * Multiverse 2 World Manager API *

diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/SafeTTeleporter.java b/src/main/java/com/onarandombox/MultiverseCore/api/SafeTTeleporter.java index 95fafa9a..51350238 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/SafeTTeleporter.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/SafeTTeleporter.java @@ -1,5 +1,7 @@ package com.onarandombox.MultiverseCore.api; +import java.util.concurrent.CompletableFuture; + import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.destination.ParsedDestination; import com.onarandombox.MultiverseCore.teleportation.TeleportResult; @@ -8,8 +10,6 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.jvnet.hk2.annotations.Contract; -import java.util.concurrent.CompletableFuture; - /** * Used to safely teleport people. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/Teleporter.java b/src/main/java/com/onarandombox/MultiverseCore/api/Teleporter.java index 838aea9d..39795957 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/Teleporter.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/Teleporter.java @@ -1,13 +1,13 @@ package com.onarandombox.MultiverseCore.api; +import java.util.concurrent.CompletableFuture; + import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.destination.ParsedDestination; import com.onarandombox.MultiverseCore.teleportation.TeleportResult; import org.bukkit.entity.Entity; import org.jvnet.hk2.annotations.Contract; -import java.util.concurrent.CompletableFuture; - @Contract public interface Teleporter { /** diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/WorldPurger.java b/src/main/java/com/onarandombox/MultiverseCore/api/WorldPurger.java index 4c95067a..17b150cf 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/WorldPurger.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/WorldPurger.java @@ -1,11 +1,11 @@ package com.onarandombox.MultiverseCore.api; +import java.util.List; + import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.jvnet.hk2.annotations.Contract; -import java.util.List; - /** * Used to remove animals from worlds that don't belong there. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java index cbc3b502..d9ffe695 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.commands; +import java.util.Collections; +import java.util.Random; + import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandCompletion; import co.aikar.commands.annotation.CommandPermission; @@ -25,9 +28,6 @@ import org.bukkit.WorldType; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.util.Collections; -import java.util.Random; - @Service @CommandAlias("mv") public class CreateCommand extends MultiverseCommand { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/DumpsCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/DumpsCommand.java index 8a1c9ab0..70cfc2d9 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/DumpsCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/DumpsCommand.java @@ -1,5 +1,15 @@ package com.onarandombox.MultiverseCore.commands; +import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getBukkitConfig; +import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getServerProperties; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Map; + import co.aikar.commands.CommandIssuer; import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandCompletion; @@ -30,16 +40,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Map; - -import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getBukkitConfig; -import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getServerProperties; - @Service @CommandAlias("mv") public class DumpsCommand extends MultiverseCommand { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/GamerulesCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/GamerulesCommand.java index 4ce44ae4..2052e7bc 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/GamerulesCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/GamerulesCommand.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.commands; +import java.util.HashMap; +import java.util.Map; + import co.aikar.commands.CommandIssuer; import co.aikar.commands.InvalidCommandArgument; import co.aikar.commands.MessageType; @@ -31,9 +34,6 @@ import org.bukkit.World; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.util.HashMap; -import java.util.Map; - /** * List all gamerules in your current or specified world. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java index 75badc5d..b9bfdfc2 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.commands; +import java.util.ArrayList; +import java.util.List; + import co.aikar.commands.InvalidCommandArgument; import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandCompletion; @@ -29,9 +32,6 @@ import org.bukkit.World; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.util.ArrayList; -import java.util.List; - @Service @CommandAlias("mv") public class ListCommand extends MultiverseCommand { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java index 2386931b..62c1b241 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/RegenCommand.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.commands; +import java.util.Collections; +import java.util.Random; + import co.aikar.commands.MessageType; import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandCompletion; @@ -25,9 +28,6 @@ import jakarta.inject.Inject; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.util.Collections; -import java.util.Random; - @Service @CommandAlias("mv") public class RegenCommand extends MultiverseCommand { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java index 8d13e0df..d30deb18 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.commands; +import java.util.ArrayList; +import java.util.List; + import co.aikar.commands.BukkitCommandIssuer; import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.CommandPermission; @@ -17,9 +20,6 @@ import org.bukkit.plugin.PluginManager; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.util.ArrayList; -import java.util.List; - @Service @CommandAlias("mv") public class ReloadCommand extends MultiverseCommand { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java index a26f7635..30b39141 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/TeleportCommand.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.commands; +import java.util.Arrays; +import java.util.concurrent.CompletableFuture; + import co.aikar.commands.BukkitCommandIssuer; import co.aikar.commands.CommandIssuer; import co.aikar.commands.annotation.CommandAlias; @@ -18,9 +21,6 @@ import jakarta.inject.Inject; import org.bukkit.entity.Player; import org.jvnet.hk2.annotations.Service; -import java.util.Arrays; -import java.util.concurrent.CompletableFuture; - @Service @CommandAlias("mv") public class TeleportCommand extends MultiverseCommand { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandCompletions.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandCompletions.java index 77f66d6a..687a5ba9 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandCompletions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandCompletions.java @@ -1,5 +1,13 @@ package com.onarandombox.MultiverseCore.commandtools; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + import co.aikar.commands.BukkitCommandCompletionContext; import co.aikar.commands.BukkitCommandIssuer; import co.aikar.commands.CommandIssuer; @@ -20,14 +28,6 @@ import org.bukkit.GameRule; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - @Service public class MVCommandCompletions extends PaperCommandCompletions { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandContexts.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandContexts.java index c0084e6e..531b29f3 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandContexts.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandContexts.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.commandtools; +import java.util.HashSet; +import java.util.Set; + import co.aikar.commands.BukkitCommandExecutionContext; import co.aikar.commands.BukkitCommandIssuer; import co.aikar.commands.InvalidCommandArgument; @@ -25,9 +28,6 @@ import org.bukkit.GameRule; import org.bukkit.entity.Player; import org.jvnet.hk2.annotations.Service; -import java.util.HashSet; -import java.util.Set; - @Service public class MVCommandContexts extends PaperCommandContexts { diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandManager.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandManager.java index 1da09d86..58de1ae1 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/MVCommandManager.java @@ -1,5 +1,7 @@ package com.onarandombox.MultiverseCore.commandtools; +import java.util.List; + import co.aikar.commands.BukkitCommandCompletionContext; import co.aikar.commands.BukkitCommandExecutionContext; import co.aikar.commands.CommandCompletions; @@ -18,8 +20,6 @@ import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.util.List; - /** * Main class to manage permissions. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlag.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlag.java index 2c83c882..a11582e0 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlag.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlag.java @@ -1,11 +1,11 @@ package com.onarandombox.MultiverseCore.commandtools.flags; -import org.jetbrains.annotations.NotNull; - import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.jetbrains.annotations.NotNull; + /** * Represents a flag. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlagGroup.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlagGroup.java index 932f1f2e..a36d23d7 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlagGroup.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlagGroup.java @@ -1,8 +1,5 @@ package com.onarandombox.MultiverseCore.commandtools.flags; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -10,6 +7,9 @@ import java.util.List; import java.util.Map; import java.util.Set; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + /** * A group of flags. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlagsManager.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlagsManager.java index 57dcb298..bf9eadda 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlagsManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandFlagsManager.java @@ -1,16 +1,16 @@ package com.onarandombox.MultiverseCore.commandtools.flags; -import co.aikar.commands.InvalidCommandArgument; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jvnet.hk2.annotations.Service; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; +import co.aikar.commands.InvalidCommandArgument; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jvnet.hk2.annotations.Service; + /** * Manages all the flag groups and parsing. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandValueFlag.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandValueFlag.java index 4e2acb13..5c28ce46 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandValueFlag.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/CommandValueFlag.java @@ -1,15 +1,15 @@ package com.onarandombox.MultiverseCore.commandtools.flags; -import co.aikar.commands.InvalidCommandArgument; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; +import co.aikar.commands.InvalidCommandArgument; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + /** * Represents a flag with a value. * diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/ParsedCommandFlags.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/ParsedCommandFlags.java index 0d97efe4..605237bd 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/ParsedCommandFlags.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/flags/ParsedCommandFlags.java @@ -1,11 +1,11 @@ package com.onarandombox.MultiverseCore.commandtools.flags; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - import java.util.HashMap; import java.util.Map; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + /** * Object to contain the results of the flags present and its values. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java index 72d97c86..3b9ea879 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java @@ -7,6 +7,9 @@ package com.onarandombox.MultiverseCore.commandtools.queue; +import java.util.Map; +import java.util.WeakHashMap; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; import jakarta.inject.Inject; @@ -20,9 +23,6 @@ import org.bukkit.scheduler.BukkitTask; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.util.Map; -import java.util.WeakHashMap; - /** *

Manages the queuing of dangerous commands that require {@code /mv confirm} before executing.

* diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/DummyCommandBlockSender.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/DummyCommandBlockSender.java index 181e8e50..0c31c134 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/DummyCommandBlockSender.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/DummyCommandBlockSender.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.commandtools.queue; +import java.util.Set; +import java.util.UUID; + import org.bukkit.Bukkit; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -10,9 +13,6 @@ import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Set; -import java.util.UUID; - /** * Used by {@link CommandQueueManager}, so different commands block can be recognised as one. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/config/MVCoreConfig.java b/src/main/java/com/onarandombox/MultiverseCore/config/MVCoreConfig.java index 5a4f1026..1e713b84 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/config/MVCoreConfig.java +++ b/src/main/java/com/onarandombox/MultiverseCore/config/MVCoreConfig.java @@ -1,5 +1,9 @@ package com.onarandombox.MultiverseCore.config; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.api.MVConfig; @@ -17,10 +21,6 @@ import org.bukkit.plugin.PluginManager; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; - @Service public class MVCoreConfig implements MVConfig { public static final String CONFIG_FILENAME = "config.yml"; diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/CommentedYamlConfigHandle.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/CommentedYamlConfigHandle.java index 23208c8d..a35daa88 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/CommentedYamlConfigHandle.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/CommentedYamlConfigHandle.java @@ -1,5 +1,9 @@ package com.onarandombox.MultiverseCore.configuration.handle; +import java.io.IOException; +import java.nio.file.Path; +import java.util.logging.Logger; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.configuration.migration.ConfigMigrator; import com.onarandombox.MultiverseCore.configuration.node.CommentedNode; @@ -10,10 +14,6 @@ import io.vavr.control.Try; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.IOException; -import java.nio.file.Path; -import java.util.logging.Logger; - /** * Configuration handle for commented YAML files. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/ConfigurationSectionHandle.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/ConfigurationSectionHandle.java index 7e7aeeef..eeb79fb6 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/ConfigurationSectionHandle.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/ConfigurationSectionHandle.java @@ -1,5 +1,7 @@ package com.onarandombox.MultiverseCore.configuration.handle; +import java.util.logging.Logger; + import com.onarandombox.MultiverseCore.configuration.migration.ConfigMigrator; import com.onarandombox.MultiverseCore.configuration.node.NodeGroup; import io.vavr.control.Try; @@ -7,8 +9,6 @@ import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.logging.Logger; - /** * Configuration handle for a single configuration section. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/FileConfigHandle.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/FileConfigHandle.java index c1f61c1b..82d30dd8 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/FileConfigHandle.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/FileConfigHandle.java @@ -1,5 +1,10 @@ package com.onarandombox.MultiverseCore.configuration.handle; +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.util.logging.Logger; + import com.onarandombox.MultiverseCore.configuration.migration.ConfigMigrator; import com.onarandombox.MultiverseCore.configuration.node.NodeGroup; import io.vavr.control.Try; @@ -8,11 +13,6 @@ import org.bukkit.configuration.file.FileConfiguration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; -import java.util.logging.Logger; - /** * Generic configuration handle for file based configurations. * @param The configuration type. diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/GenericConfigHandle.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/GenericConfigHandle.java index 4c8f6c27..5d35b73f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/GenericConfigHandle.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/GenericConfigHandle.java @@ -1,5 +1,7 @@ package com.onarandombox.MultiverseCore.configuration.handle; +import java.util.logging.Logger; + import com.onarandombox.MultiverseCore.configuration.migration.ConfigMigrator; import com.onarandombox.MultiverseCore.configuration.node.ConfigNodeNotFoundException; import com.onarandombox.MultiverseCore.configuration.node.NodeGroup; @@ -10,8 +12,6 @@ import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.logging.Logger; - /** * Generic configuration handle for all ConfigurationSection types. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/YamlConfigHandle.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/YamlConfigHandle.java index aded8a77..edbfc82f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/YamlConfigHandle.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/handle/YamlConfigHandle.java @@ -1,5 +1,9 @@ package com.onarandombox.MultiverseCore.configuration.handle; +import java.io.IOException; +import java.nio.file.Path; +import java.util.logging.Logger; + import com.onarandombox.MultiverseCore.configuration.migration.ConfigMigrator; import com.onarandombox.MultiverseCore.configuration.node.NodeGroup; import io.vavr.control.Try; @@ -8,10 +12,6 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.IOException; -import java.nio.file.Path; -import java.util.logging.Logger; - /** * Configuration handle for YAML files. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/ConfigMigrator.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/ConfigMigrator.java index eb80b87d..b5391449 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/ConfigMigrator.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/ConfigMigrator.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.configuration.migration; +import java.util.ArrayList; +import java.util.List; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.configuration.node.ValueNode; import org.bukkit.configuration.ConfigurationSection; -import java.util.ArrayList; -import java.util.List; - /** * Helper class for migrating configs to the latest config version. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/MoveMigratorAction.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/MoveMigratorAction.java index d0b7a361..40c9da52 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/MoveMigratorAction.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/MoveMigratorAction.java @@ -1,10 +1,10 @@ package com.onarandombox.MultiverseCore.configuration.migration; +import java.util.Optional; + import com.dumptruckman.minecraft.util.Logging; import org.bukkit.configuration.ConfigurationSection; -import java.util.Optional; - /** * Single migrator action that moves a value from one path to another. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/VersionMigrator.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/VersionMigrator.java index ac9ee7bc..453f63b0 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/VersionMigrator.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/migration/VersionMigrator.java @@ -1,10 +1,10 @@ package com.onarandombox.MultiverseCore.configuration.migration; -import org.bukkit.configuration.ConfigurationSection; - import java.util.ArrayList; import java.util.List; +import org.bukkit.configuration.ConfigurationSection; + /** * A version migrator is a collection of migrator actions that are performed when migrating a config to a specific version. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigHeaderNode.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigHeaderNode.java index abc7fe03..00b330ab 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigHeaderNode.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigHeaderNode.java @@ -1,11 +1,11 @@ package com.onarandombox.MultiverseCore.configuration.node; -import com.google.common.base.Strings; -import org.jetbrains.annotations.NotNull; - import java.util.ArrayList; import java.util.List; +import com.google.common.base.Strings; +import org.jetbrains.annotations.NotNull; + /** * A node that represents a header without any value. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigNode.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigNode.java index 99af71f7..f9efbd22 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigNode.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigNode.java @@ -1,13 +1,13 @@ package com.onarandombox.MultiverseCore.configuration.node; +import java.util.function.BiConsumer; +import java.util.function.Function; + import io.vavr.control.Option; import io.vavr.control.Try; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.function.BiConsumer; -import java.util.function.Function; - /** * A node that contains a value. * @param The type of the value. diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigNodeNotFoundException.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigNodeNotFoundException.java index 3917a17e..1bfb59bd 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigNodeNotFoundException.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/node/ConfigNodeNotFoundException.java @@ -1,11 +1,11 @@ package com.onarandombox.MultiverseCore.configuration.node; -import com.onarandombox.MultiverseCore.exceptions.MultiverseException; -import org.jetbrains.annotations.Nullable; - import static com.onarandombox.MultiverseCore.utils.MVCorei18n.CONFIG_NODE_NOTFOUND; import static com.onarandombox.MultiverseCore.utils.message.MessageReplacement.replace; +import com.onarandombox.MultiverseCore.exceptions.MultiverseException; +import org.jetbrains.annotations.Nullable; + public class ConfigNodeNotFoundException extends MultiverseException { public ConfigNodeNotFoundException(@Nullable String nodeName) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/node/NodeGroup.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/node/NodeGroup.java index e9c1129a..597127f1 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/node/NodeGroup.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/node/NodeGroup.java @@ -1,15 +1,15 @@ package com.onarandombox.MultiverseCore.configuration.node; -import io.github.townyadvanced.commentedconfiguration.setting.CommentedNode; -import io.vavr.control.Option; -import org.jetbrains.annotations.NotNull; - import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import io.github.townyadvanced.commentedconfiguration.setting.CommentedNode; +import io.vavr.control.Option; +import org.jetbrains.annotations.NotNull; + /** * A collection of {@link CommentedNode}s, with mappings to nodes by name. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/DestinationsProvider.java b/src/main/java/com/onarandombox/MultiverseCore/destination/DestinationsProvider.java index 0b043019..cd09205a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/DestinationsProvider.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/DestinationsProvider.java @@ -1,5 +1,11 @@ package com.onarandombox.MultiverseCore.destination; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; + import co.aikar.commands.BukkitCommandIssuer; import co.aikar.commands.CommandIssuer; import com.onarandombox.MultiverseCore.api.Destination; @@ -16,12 +22,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - /** * Provides destinations for teleportation. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/AnchorDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/AnchorDestination.java index 82a5645c..c6db2fd7 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/AnchorDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/AnchorDestination.java @@ -1,5 +1,7 @@ package com.onarandombox.MultiverseCore.destination.core; +import java.util.Collection; + import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.anchor.AnchorManager; import com.onarandombox.MultiverseCore.api.Destination; @@ -10,8 +12,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.util.Collection; - /** * {@link Destination} implementation for anchors. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/BedDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/BedDestination.java index 26a5a714..11586c64 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/BedDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/BedDestination.java @@ -1,5 +1,9 @@ package com.onarandombox.MultiverseCore.destination.core; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.api.Destination; import com.onarandombox.MultiverseCore.api.Teleporter; @@ -10,10 +14,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - /** * {@link Destination} implementation for beds. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/CannonDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/CannonDestination.java index dc365cbb..4657f184 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/CannonDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/CannonDestination.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.destination.core; +import java.util.Collection; +import java.util.Collections; + import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.api.Destination; import com.onarandombox.MultiverseCore.api.Teleporter; @@ -12,9 +15,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.util.Collection; -import java.util.Collections; - /** * {@link Destination} implementation for cannons. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/ExactDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/ExactDestination.java index 6430e9e1..31a21efb 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/ExactDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/ExactDestination.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.destination.core; +import java.util.Collection; +import java.util.Collections; + import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.api.Destination; import com.onarandombox.MultiverseCore.api.Teleporter; @@ -12,9 +15,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.util.Collection; -import java.util.Collections; - /** * {@link Destination} implementation for exact locations. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/PlayerDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/PlayerDestination.java index 5b2d7fa2..15803e57 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/PlayerDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/PlayerDestination.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.destination.core; +import java.util.Collection; +import java.util.stream.Collectors; + import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.api.Destination; import com.onarandombox.MultiverseCore.api.Teleporter; @@ -10,9 +13,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.util.Collection; -import java.util.stream.Collectors; - /** * {@link Destination} implementation for players.s */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestination.java b/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestination.java index 0239668d..060357fd 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestination.java +++ b/src/main/java/com/onarandombox/MultiverseCore/destination/core/WorldDestination.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.destination.core; +import java.util.Collection; +import java.util.Collections; + import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.api.Destination; import com.onarandombox.MultiverseCore.api.LocationManipulation; @@ -11,9 +14,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.util.Collection; -import java.util.Collections; - /** * {@link Destination} implementation for exact locations. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/ContentDisplay.java b/src/main/java/com/onarandombox/MultiverseCore/display/ContentDisplay.java index 4679ad5b..373becc1 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/ContentDisplay.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/ContentDisplay.java @@ -1,15 +1,15 @@ package com.onarandombox.MultiverseCore.display; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + import co.aikar.commands.BukkitCommandIssuer; import com.onarandombox.MultiverseCore.display.handlers.DefaultSendHandler; import com.onarandombox.MultiverseCore.display.handlers.SendHandler; import com.onarandombox.MultiverseCore.display.parsers.ContentProvider; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - /** * Helps to display contents such as list and maps in a nicely formatted fashion. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/filters/RegexContentFilter.java b/src/main/java/com/onarandombox/MultiverseCore/display/filters/RegexContentFilter.java index 44cd574d..e3e28150 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/filters/RegexContentFilter.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/filters/RegexContentFilter.java @@ -1,14 +1,14 @@ package com.onarandombox.MultiverseCore.display.filters; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + import com.dumptruckman.minecraft.util.Logging; import com.google.common.base.Strings; import org.bukkit.ChatColor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - /** * Filter content and text based on regex matching. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/BaseSendHandler.java b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/BaseSendHandler.java index 5afd56f6..415ab5b5 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/BaseSendHandler.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/BaseSendHandler.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.display.handlers; +import java.util.List; +import java.util.stream.Collectors; + import co.aikar.commands.BukkitCommandIssuer; import com.google.common.base.Strings; import com.onarandombox.MultiverseCore.display.filters.ContentFilter; @@ -8,9 +11,6 @@ import org.bukkit.ChatColor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.List; -import java.util.stream.Collectors; - /** * Base implementation of {@link SendHandler} with some common parameters. * diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/DefaultSendHandler.java b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/DefaultSendHandler.java index e2230eed..6b37c301 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/DefaultSendHandler.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/DefaultSendHandler.java @@ -1,10 +1,10 @@ package com.onarandombox.MultiverseCore.display.handlers; +import java.util.List; + import co.aikar.commands.BukkitCommandIssuer; import org.jetbrains.annotations.NotNull; -import java.util.List; - /** * Most basic implementation of {@link SendHandler} that just sends content with no formatting. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/InlineSendHandler.java b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/InlineSendHandler.java index 62b06414..568b58b5 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/InlineSendHandler.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/InlineSendHandler.java @@ -1,11 +1,11 @@ package com.onarandombox.MultiverseCore.display.handlers; +import java.util.List; + import co.aikar.commands.BukkitCommandIssuer; import org.bukkit.ChatColor; import org.jetbrains.annotations.NotNull; -import java.util.List; - /** * Display the contents in a single line. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/PagedSendHandler.java b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/PagedSendHandler.java index 4bb62fa2..37a16b06 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/PagedSendHandler.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/PagedSendHandler.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.display.handlers; +import java.util.List; + import co.aikar.commands.BukkitCommandIssuer; import org.bukkit.ChatColor; import org.bukkit.command.ConsoleCommandSender; import org.jetbrains.annotations.NotNull; -import java.util.List; - /** * Display content as a list with optional pagination. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/SendHandler.java b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/SendHandler.java index ad18cebd..c731621f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/handlers/SendHandler.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/handlers/SendHandler.java @@ -1,10 +1,10 @@ package com.onarandombox.MultiverseCore.display.handlers; +import java.util.List; + import co.aikar.commands.BukkitCommandIssuer; import org.jetbrains.annotations.NotNull; -import java.util.List; - /** * Handles the sending of all content to the command sender. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/parsers/ContentProvider.java b/src/main/java/com/onarandombox/MultiverseCore/display/parsers/ContentProvider.java index a86d627c..b8c36e1d 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/parsers/ContentProvider.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/parsers/ContentProvider.java @@ -1,10 +1,10 @@ package com.onarandombox.MultiverseCore.display.parsers; +import java.util.Collection; + import co.aikar.commands.BukkitCommandIssuer; import org.jetbrains.annotations.NotNull; -import java.util.Collection; - /** * Parse objects into string or list of strings. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/parsers/ListContentProvider.java b/src/main/java/com/onarandombox/MultiverseCore/display/parsers/ListContentProvider.java index a2767e27..1242ccb3 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/parsers/ListContentProvider.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/parsers/ListContentProvider.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.display.parsers; -import co.aikar.commands.BukkitCommandIssuer; -import org.jetbrains.annotations.NotNull; - import java.util.Collection; import java.util.List; import java.util.stream.Collectors; +import co.aikar.commands.BukkitCommandIssuer; +import org.jetbrains.annotations.NotNull; + /** * Simple parser for list object. * diff --git a/src/main/java/com/onarandombox/MultiverseCore/display/parsers/MapContentProvider.java b/src/main/java/com/onarandombox/MultiverseCore/display/parsers/MapContentProvider.java index 537493a5..9d39c8f3 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/display/parsers/MapContentProvider.java +++ b/src/main/java/com/onarandombox/MultiverseCore/display/parsers/MapContentProvider.java @@ -1,13 +1,13 @@ package com.onarandombox.MultiverseCore.display.parsers; -import co.aikar.commands.BukkitCommandIssuer; -import org.bukkit.ChatColor; -import org.jetbrains.annotations.NotNull; - import java.util.Collection; import java.util.Map; import java.util.stream.Collectors; +import co.aikar.commands.BukkitCommandIssuer; +import org.bukkit.ChatColor; +import org.jetbrains.annotations.NotNull; + /** * Simple parser for map object. * diff --git a/src/main/java/com/onarandombox/MultiverseCore/economy/ItemEconomy.java b/src/main/java/com/onarandombox/MultiverseCore/economy/ItemEconomy.java index 1155a526..6b5f9b1e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/economy/ItemEconomy.java +++ b/src/main/java/com/onarandombox/MultiverseCore/economy/ItemEconomy.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.economy; +import java.util.HashMap; + import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.util.HashMap; - // TODO: Make thsi no static class ItemEconomy { diff --git a/src/main/java/com/onarandombox/MultiverseCore/event/MVConfigReloadEvent.java b/src/main/java/com/onarandombox/MultiverseCore/event/MVConfigReloadEvent.java index bae3541b..43bc8c2b 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/event/MVConfigReloadEvent.java +++ b/src/main/java/com/onarandombox/MultiverseCore/event/MVConfigReloadEvent.java @@ -7,11 +7,11 @@ package com.onarandombox.MultiverseCore.event; +import java.util.List; + import org.bukkit.event.Event; import org.bukkit.event.HandlerList; -import java.util.List; - /** * Called when the Multiverse-config should be reloaded. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/event/MVVersionEvent.java b/src/main/java/com/onarandombox/MultiverseCore/event/MVVersionEvent.java index 9b1bc632..443ba0a5 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/event/MVVersionEvent.java +++ b/src/main/java/com/onarandombox/MultiverseCore/event/MVVersionEvent.java @@ -1,9 +1,5 @@ package com.onarandombox.MultiverseCore.event; -import com.dumptruckman.minecraft.util.Logging; -import org.bukkit.event.Event; -import org.bukkit.event.HandlerList; - import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -13,6 +9,10 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +import com.dumptruckman.minecraft.util.Logging; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + /** * Called when somebody requests version information about Multiverse. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/inject/binder/PluginBinder.java b/src/main/java/com/onarandombox/MultiverseCore/inject/binder/PluginBinder.java index 2e315b5e..1a6ffe9e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/inject/binder/PluginBinder.java +++ b/src/main/java/com/onarandombox/MultiverseCore/inject/binder/PluginBinder.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.inject.binder; +import java.util.logging.Logger; + import org.bukkit.plugin.Plugin; import org.glassfish.hk2.utilities.binding.AbstractBinder; import org.glassfish.hk2.utilities.binding.ScopedBindingBuilder; import org.jetbrains.annotations.NotNull; -import java.util.logging.Logger; - /** * The base class for all plugin binders. Initiates the binding of the plugin instance and initially binds it to the * {@link Plugin} interface. diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java index c635565b..f1b3fdc3 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java @@ -7,6 +7,10 @@ package com.onarandombox.MultiverseCore.listeners; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.api.SafeTTeleporter; @@ -44,10 +48,6 @@ import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.plugin.Plugin; import org.jvnet.hk2.annotations.Service; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.ConcurrentHashMap; - /** * Multiverse's Listener for players. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleBlockSafety.java b/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleBlockSafety.java index d983c396..f81c3735 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleBlockSafety.java +++ b/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleBlockSafety.java @@ -7,6 +7,10 @@ package com.onarandombox.MultiverseCore.teleportation; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.Set; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.api.BlockSafety; import com.onarandombox.MultiverseCore.api.LocationManipulation; @@ -21,10 +25,6 @@ import org.bukkit.entity.Minecart; import org.bukkit.entity.Vehicle; import org.jvnet.hk2.annotations.Service; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.Set; - /** * The default-implementation of {@link BlockSafety}. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleLocationManipulation.java b/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleLocationManipulation.java index 97feae5b..860a6c82 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleLocationManipulation.java +++ b/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleLocationManipulation.java @@ -7,6 +7,12 @@ package com.onarandombox.MultiverseCore.teleportation; +import java.text.DecimalFormat; +import java.util.Collections; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + import com.onarandombox.MultiverseCore.api.LocationManipulation; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -16,12 +22,6 @@ import org.bukkit.entity.Vehicle; import org.bukkit.util.Vector; import org.jvnet.hk2.annotations.Service; -import java.text.DecimalFormat; -import java.util.Collections; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - /** * The default-implementation of {@link LocationManipulation}. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleSafeTTeleporter.java b/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleSafeTTeleporter.java index 0c9ab878..999a3209 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleSafeTTeleporter.java +++ b/src/main/java/com/onarandombox/MultiverseCore/teleportation/SimpleSafeTTeleporter.java @@ -7,6 +7,8 @@ package com.onarandombox.MultiverseCore.teleportation; +import java.util.concurrent.CompletableFuture; + import co.aikar.commands.BukkitCommandIssuer; import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; @@ -30,8 +32,6 @@ import org.bukkit.entity.Vehicle; import org.bukkit.util.Vector; import org.jvnet.hk2.annotations.Service; -import java.util.concurrent.CompletableFuture; - /** * The default-implementation of {@link SafeTTeleporter}. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/teleportation/TeleportQueue.java b/src/main/java/com/onarandombox/MultiverseCore/teleportation/TeleportQueue.java index f59b1787..dc9e69e1 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/teleportation/TeleportQueue.java +++ b/src/main/java/com/onarandombox/MultiverseCore/teleportation/TeleportQueue.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.teleportation; -import com.dumptruckman.minecraft.util.Logging; -import org.jvnet.hk2.annotations.Service; - import java.util.HashMap; import java.util.Map; import java.util.Optional; +import com.dumptruckman.minecraft.util.Logging; +import org.jvnet.hk2.annotations.Service; + @Service public class TeleportQueue { diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/PlayerFinder.java b/src/main/java/com/onarandombox/MultiverseCore/utils/PlayerFinder.java index 1d286cbe..30eb5a64 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/PlayerFinder.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/PlayerFinder.java @@ -1,5 +1,11 @@ package com.onarandombox.MultiverseCore.utils; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + import com.dumptruckman.minecraft.util.Logging; import com.google.common.base.Strings; import org.bukkit.Bukkit; @@ -8,12 +14,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - /** * Helper class to get {@link Player} from name, UUID or Selectors. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/ReflectHelper.java b/src/main/java/com/onarandombox/MultiverseCore/utils/ReflectHelper.java index 9e81bfe2..9aa138c2 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/ReflectHelper.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/ReflectHelper.java @@ -1,10 +1,10 @@ package com.onarandombox.MultiverseCore.utils; -import org.jetbrains.annotations.Nullable; - import java.lang.reflect.Field; import java.lang.reflect.Method; +import org.jetbrains.annotations.Nullable; + /** * Utility class used to help in doing various reflection actions. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/UnsafeCallWrapper.java b/src/main/java/com/onarandombox/MultiverseCore/utils/UnsafeCallWrapper.java index b459e304..4414864e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/UnsafeCallWrapper.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/UnsafeCallWrapper.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.utils; +import java.util.concurrent.Callable; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.config.MVCoreConfig; import jakarta.inject.Inject; import org.jvnet.hk2.annotations.Service; -import java.util.concurrent.Callable; - /** * Wraps calls that could result in exceptions that are not Multiverse's fault. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/file/FileResClassLoader.java b/src/main/java/com/onarandombox/MultiverseCore/utils/file/FileResClassLoader.java index 369e7c4b..3342841e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/file/FileResClassLoader.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/file/FileResClassLoader.java @@ -1,7 +1,5 @@ package com.onarandombox.MultiverseCore.utils.file; -import org.bukkit.plugin.Plugin; - import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -9,6 +7,8 @@ import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; +import org.bukkit.plugin.Plugin; + /** * A class loader that loads resources from the plugin's locales folder. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/file/FileUtils.java b/src/main/java/com/onarandombox/MultiverseCore/utils/file/FileUtils.java index 614b1d64..0043378c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/file/FileUtils.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/file/FileUtils.java @@ -7,8 +7,8 @@ package com.onarandombox.MultiverseCore.utils.file; -import com.dumptruckman.minecraft.util.Logging; -import org.jetbrains.annotations.Nullable; +import static java.nio.file.StandardCopyOption.COPY_ATTRIBUTES; +import static org.bukkit.Bukkit.getServer; import java.io.File; import java.io.IOException; @@ -21,8 +21,8 @@ import java.util.Comparator; import java.util.List; import java.util.stream.Stream; -import static java.nio.file.StandardCopyOption.COPY_ATTRIBUTES; -import static org.bukkit.Bukkit.getServer; +import com.dumptruckman.minecraft.util.Logging; +import org.jetbrains.annotations.Nullable; /** * File-utilities. diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/message/LocalizedMessage.java b/src/main/java/com/onarandombox/MultiverseCore/utils/message/LocalizedMessage.java index 140de226..db07c010 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/message/LocalizedMessage.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/message/LocalizedMessage.java @@ -1,5 +1,7 @@ package com.onarandombox.MultiverseCore.utils.message; +import java.util.Objects; + import co.aikar.commands.ACFUtil; import co.aikar.commands.CommandIssuer; import co.aikar.locales.MessageKey; @@ -8,8 +10,6 @@ import com.onarandombox.MultiverseCore.commandtools.PluginLocales; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Objects; - final class LocalizedMessage extends Message implements MessageKeyProvider { private final @NotNull MessageKeyProvider messageKeyProvider; diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/message/Message.java b/src/main/java/com/onarandombox/MultiverseCore/utils/message/Message.java index fe459dd5..150a3119 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/message/Message.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/message/Message.java @@ -1,5 +1,7 @@ package com.onarandombox.MultiverseCore.utils.message; +import java.util.Objects; + import co.aikar.commands.ACFUtil; import co.aikar.commands.CommandIssuer; import co.aikar.locales.MessageKeyProvider; @@ -8,8 +10,6 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Objects; - /** * A message that can be formatted with replacements and localized. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/metrics/MetricsConfigurator.java b/src/main/java/com/onarandombox/MultiverseCore/utils/metrics/MetricsConfigurator.java index a8117ad6..c65d6a7b 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/metrics/MetricsConfigurator.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/metrics/MetricsConfigurator.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.utils.metrics; +import java.util.Map; +import java.util.function.Consumer; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.worldnew.LoadedMultiverseWorld; @@ -11,9 +14,6 @@ import org.bstats.bukkit.Metrics; import org.bukkit.World; import org.jvnet.hk2.annotations.Service; -import java.util.Map; -import java.util.function.Consumer; - @Service public class MetricsConfigurator { diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/metrics/MetricsHelper.java b/src/main/java/com/onarandombox/MultiverseCore/utils/metrics/MetricsHelper.java index 8fa8da45..a604ad58 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/metrics/MetricsHelper.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/metrics/MetricsHelper.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.utils.metrics; -import org.bstats.charts.AdvancedPie; -import org.bstats.charts.MultiLineChart; - import java.util.HashMap; import java.util.Map; import java.util.function.Consumer; +import org.bstats.charts.AdvancedPie; +import org.bstats.charts.MultiLineChart; + enum MetricsHelper { ; diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/result/Attempt.java b/src/main/java/com/onarandombox/MultiverseCore/utils/result/Attempt.java index 177a57cc..48ba438e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/result/Attempt.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/result/Attempt.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.utils.result; -import com.onarandombox.MultiverseCore.utils.message.Message; -import com.onarandombox.MultiverseCore.utils.message.MessageReplacement; - import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; +import com.onarandombox.MultiverseCore.utils.message.Message; +import com.onarandombox.MultiverseCore.utils.message.MessageReplacement; + /** * Represents an attempt to process a value that can fail with a reason that has a localized message. * diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/result/Result.java b/src/main/java/com/onarandombox/MultiverseCore/utils/result/Result.java index e127fd03..bc00c9ac 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/result/Result.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/result/Result.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.utils.result; +import java.util.function.Consumer; +import java.util.function.Function; + import com.onarandombox.MultiverseCore.utils.message.Message; import com.onarandombox.MultiverseCore.utils.message.MessageReplacement; import org.jetbrains.annotations.NotNull; -import java.util.function.Consumer; -import java.util.function.Function; - /** * Represents result of an operation with a reason for success or failure that has localized messages. * diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/result/ResultChain.java b/src/main/java/com/onarandombox/MultiverseCore/utils/result/ResultChain.java index 752317dc..1ef5d3e9 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/result/ResultChain.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/result/ResultChain.java @@ -1,9 +1,5 @@ package com.onarandombox.MultiverseCore.utils.result; -import com.google.common.collect.Iterables; -import com.onarandombox.MultiverseCore.utils.message.Message; -import io.vavr.control.Option; - import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -11,6 +7,10 @@ import java.util.function.Consumer; import java.util.function.Supplier; import java.util.stream.Collectors; +import com.google.common.collect.Iterables; +import com.onarandombox.MultiverseCore.utils.message.Message; +import io.vavr.control.Option; + public class ResultChain { public static Builder builder() { return new Builder(true); diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/BitlyURLShortener.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/BitlyURLShortener.java index 745921a8..bcac458e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/BitlyURLShortener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/BitlyURLShortener.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.utils.webpaste; +import java.io.IOException; +import java.util.Map; + import net.minidev.json.JSONObject; import net.minidev.json.parser.JSONParser; import net.minidev.json.parser.ParseException; -import java.io.IOException; -import java.util.Map; - /** * A {@link URLShortener} using {@code bit.ly}. Requires an access token. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/GitHubPasteService.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/GitHubPasteService.java index d17062bd..b7c05edb 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/GitHubPasteService.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/GitHubPasteService.java @@ -1,13 +1,13 @@ package com.onarandombox.MultiverseCore.utils.webpaste; -import net.minidev.json.JSONObject; -import net.minidev.json.parser.JSONParser; -import net.minidev.json.parser.ParseException; - import java.io.IOException; import java.util.HashMap; import java.util.Map; +import net.minidev.json.JSONObject; +import net.minidev.json.parser.JSONParser; +import net.minidev.json.parser.ParseException; + /** * Pastes to {@code gist.github.com}. Requires an access token with the {@code gist} scope. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/McloGsPasteService.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/McloGsPasteService.java index fed91e34..930af75f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/McloGsPasteService.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/McloGsPasteService.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.utils.webpaste; +import java.io.IOException; +import java.util.Map; + import net.minidev.json.JSONObject; import net.minidev.json.parser.JSONParser; import net.minidev.json.parser.ParseException; -import java.io.IOException; -import java.util.Map; - public class McloGsPasteService extends PasteService { private static final String MCLOGS_POST_REQUEST = "https://api.mclo.gs/1/log"; diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteGGPasteService.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteGGPasteService.java index 6c7c08e9..cf54c346 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteGGPasteService.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PasteGGPasteService.java @@ -1,14 +1,14 @@ package com.onarandombox.MultiverseCore.utils.webpaste; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + import net.minidev.json.JSONArray; import net.minidev.json.JSONObject; import net.minidev.json.parser.JSONParser; import net.minidev.json.parser.ParseException; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - /** * Pastes to {@code paste.gg}. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PastesDevPasteService.java b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PastesDevPasteService.java index 20ddc98e..42f042d0 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PastesDevPasteService.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/webpaste/PastesDevPasteService.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.utils.webpaste; +import java.io.IOException; +import java.util.Map; + import net.minidev.json.JSONObject; import net.minidev.json.parser.JSONParser; import net.minidev.json.parser.ParseException; -import java.io.IOException; -import java.util.Map; - /** * Pastes to {@code hastebin.com}. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorld.java index c607f566..2f39b53f 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorld.java @@ -7,6 +7,11 @@ package com.onarandombox.MultiverseCore.world; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.UUID; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.api.BlockSafety; import com.onarandombox.MultiverseCore.api.LocationManipulation; @@ -42,11 +47,6 @@ import org.bukkit.permissions.PermissionDefault; import org.bukkit.util.Vector; import org.jetbrains.annotations.Nullable; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.UUID; - /** * The implementation of a Multiverse handled world. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorldManager.java b/src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorldManager.java index 024290cf..a2356d96 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorldManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/world/SimpleMVWorldManager.java @@ -7,6 +7,24 @@ package com.onarandombox.MultiverseCore.world; +import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getBukkitConfig; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.Stack; +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.api.BlockSafety; @@ -39,24 +57,6 @@ import org.bukkit.permissions.PermissionDefault; import org.bukkit.plugin.Plugin; import org.jvnet.hk2.annotations.Service; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import java.util.Stack; -import java.util.concurrent.Callable; -import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; - -import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getBukkitConfig; - /** * Public facing API to add/remove Multiverse worlds. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/world/SimpleWorldPurger.java b/src/main/java/com/onarandombox/MultiverseCore/world/SimpleWorldPurger.java index 4f3bec2c..897a538d 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/world/SimpleWorldPurger.java +++ b/src/main/java/com/onarandombox/MultiverseCore/world/SimpleWorldPurger.java @@ -7,6 +7,10 @@ package com.onarandombox.MultiverseCore.world; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.api.MVWorld; import com.onarandombox.MultiverseCore.api.WorldPurger; @@ -25,10 +29,6 @@ import org.bukkit.entity.Slime; import org.bukkit.entity.Squid; import org.jvnet.hk2.annotations.Service; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - /** * Utility class that removes animals from worlds that don't belong there. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/world/WorldNameChecker.java b/src/main/java/com/onarandombox/MultiverseCore/world/WorldNameChecker.java index 8a00838e..258e03b5 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/world/WorldNameChecker.java +++ b/src/main/java/com/onarandombox/MultiverseCore/world/WorldNameChecker.java @@ -1,15 +1,15 @@ package com.onarandombox.MultiverseCore.world; -import org.bukkit.Bukkit; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - import java.io.File; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.regex.Pattern; +import org.bukkit.Bukkit; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + /** *

Utility class in helping to check the status of a world name and it's associated world folder.

* diff --git a/src/main/java/com/onarandombox/MultiverseCore/world/WorldProperties.java b/src/main/java/com/onarandombox/MultiverseCore/world/WorldProperties.java index c42429c0..d650f435 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/world/WorldProperties.java +++ b/src/main/java/com/onarandombox/MultiverseCore/world/WorldProperties.java @@ -1,5 +1,13 @@ package com.onarandombox.MultiverseCore.world; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import com.onarandombox.MultiverseCore.world.SimpleMVWorld.NullLocation; import com.onarandombox.MultiverseCore.world.configuration.AllowedPortalType; import com.onarandombox.MultiverseCore.world.configuration.EnglishChatColor; @@ -23,14 +31,6 @@ import org.bukkit.World.Environment; import org.bukkit.configuration.serialization.SerializableAs; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - /* * This is a property class, I think we don't need that much javadoc. * BEGIN CHECKSTYLE-SUPPRESSION: Javadoc diff --git a/src/main/java/com/onarandombox/MultiverseCore/world/configuration/EntryFee.java b/src/main/java/com/onarandombox/MultiverseCore/world/configuration/EntryFee.java index f8fe8008..32afbd1c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/world/configuration/EntryFee.java +++ b/src/main/java/com/onarandombox/MultiverseCore/world/configuration/EntryFee.java @@ -1,5 +1,7 @@ package com.onarandombox.MultiverseCore.world.configuration; +import java.util.Map; + import com.onarandombox.MultiverseCore.utils.MaterialConverter; import me.main__.util.SerializationConfig.Property; import me.main__.util.SerializationConfig.SerializationConfig; @@ -8,8 +10,6 @@ import org.bukkit.Material; import org.bukkit.configuration.serialization.SerializableAs; import org.jetbrains.annotations.Nullable; -import java.util.Map; - /** * Entryfee-settings. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/world/configuration/SpawnSettings.java b/src/main/java/com/onarandombox/MultiverseCore/world/configuration/SpawnSettings.java index 391c1fd0..977c8939 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/world/configuration/SpawnSettings.java +++ b/src/main/java/com/onarandombox/MultiverseCore/world/configuration/SpawnSettings.java @@ -1,11 +1,11 @@ package com.onarandombox.MultiverseCore.world.configuration; +import java.util.Map; + import me.main__.util.SerializationConfig.Property; import me.main__.util.SerializationConfig.SerializationConfig; import org.bukkit.configuration.serialization.SerializableAs; -import java.util.Map; - /** * Spawning-Settings. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/world/configuration/SubSpawnSettings.java b/src/main/java/com/onarandombox/MultiverseCore/world/configuration/SubSpawnSettings.java index bde127f0..ee75ac96 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/world/configuration/SubSpawnSettings.java +++ b/src/main/java/com/onarandombox/MultiverseCore/world/configuration/SubSpawnSettings.java @@ -1,13 +1,13 @@ package com.onarandombox.MultiverseCore.world.configuration; -import me.main__.util.SerializationConfig.Property; -import me.main__.util.SerializationConfig.SerializationConfig; -import org.bukkit.configuration.serialization.SerializableAs; - import java.util.ArrayList; import java.util.List; import java.util.Map; +import me.main__.util.SerializationConfig.Property; +import me.main__.util.SerializationConfig.SerializationConfig; +import org.bukkit.configuration.serialization.SerializableAs; + /** * SpawnSubSettings. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/LoadedMultiverseWorld.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/LoadedMultiverseWorld.java index 1bf6f19e..a50fd96c 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/LoadedMultiverseWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/LoadedMultiverseWorld.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.worldnew; +import java.util.List; +import java.util.UUID; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.api.BlockSafety; import com.onarandombox.MultiverseCore.api.LocationManipulation; @@ -15,9 +18,6 @@ import org.bukkit.WorldType; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; -import java.util.List; -import java.util.UUID; - /** * Extension of {@link MultiverseWorld} that represents a world that is currently loaded with bukkit world object. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/MultiverseWorld.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/MultiverseWorld.java index 49b817fc..de6f9414 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/MultiverseWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/MultiverseWorld.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.worldnew; +import java.util.Collection; +import java.util.List; + import com.google.common.base.Strings; import com.onarandombox.MultiverseCore.world.configuration.AllowedPortalType; import com.onarandombox.MultiverseCore.worldnew.config.WorldConfig; @@ -12,9 +15,6 @@ import org.bukkit.Material; import org.bukkit.World; import org.jetbrains.annotations.Nullable; -import java.util.Collection; -import java.util.List; - /** * Represents a world handled by Multiverse which has all the custom properties provided by Multiverse. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldManager.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldManager.java index 8117c645..56930a2e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldManager.java @@ -1,5 +1,19 @@ package com.onarandombox.MultiverseCore.worldnew; +import static com.onarandombox.MultiverseCore.utils.message.MessageReplacement.replace; +import static com.onarandombox.MultiverseCore.worldnew.helpers.DataStore.WorldBorderStore; +import static com.onarandombox.MultiverseCore.worldnew.helpers.DataStore.WorldConfigStore; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + import com.dumptruckman.minecraft.util.Logging; import com.google.common.base.Strings; import com.onarandombox.MultiverseCore.api.BlockSafety; @@ -41,20 +55,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - -import static com.onarandombox.MultiverseCore.utils.message.MessageReplacement.replace; -import static com.onarandombox.MultiverseCore.worldnew.helpers.DataStore.WorldBorderStore; -import static com.onarandombox.MultiverseCore.worldnew.helpers.DataStore.WorldConfigStore; - /** * This manager contains all the world managing functions that your heart desires. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldNameChecker.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldNameChecker.java index 856c0032..a7bbbb80 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldNameChecker.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldNameChecker.java @@ -1,14 +1,14 @@ package com.onarandombox.MultiverseCore.worldnew; +import java.io.File; +import java.util.Set; +import java.util.regex.Pattern; + import org.bukkit.Bukkit; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.io.File; -import java.util.Set; -import java.util.regex.Pattern; - /** *

Utility class in helping to check the status of a world name and it's associated world folder.

* diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldPurger.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldPurger.java index cf553917..3fe4e535 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldPurger.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/WorldPurger.java @@ -1,5 +1,10 @@ package com.onarandombox.MultiverseCore.worldnew; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; + import com.dumptruckman.minecraft.util.Logging; import org.bukkit.World; import org.bukkit.command.CommandSender; @@ -19,11 +24,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Objects; - // TODO: This entire class is a mess. /** * Used to remove animals from worlds that don't belong there. diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/LegacyAliasMigrator.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/LegacyAliasMigrator.java index 1a0a473b..32709f1a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/LegacyAliasMigrator.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/LegacyAliasMigrator.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.worldnew.config; +import java.util.concurrent.atomic.AtomicReference; + import com.onarandombox.MultiverseCore.configuration.migration.MigratorAction; import io.vavr.control.Try; import org.bukkit.ChatColor; import org.bukkit.configuration.ConfigurationSection; -import java.util.concurrent.atomic.AtomicReference; - class LegacyAliasMigrator implements MigratorAction { @Override public void migrate(ConfigurationSection config) { diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/NullLocation.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/NullLocation.java index ffba0b0f..5825a3e6 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/NullLocation.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/NullLocation.java @@ -1,14 +1,14 @@ package com.onarandombox.MultiverseCore.worldnew.config; +import java.util.Collections; +import java.util.Map; + import com.onarandombox.MultiverseCore.world.SimpleMVWorld; import org.bukkit.Location; import org.bukkit.configuration.serialization.SerializableAs; import org.bukkit.util.Vector; import org.jetbrains.annotations.NotNull; -import java.util.Collections; -import java.util.Map; - /** * Null-location. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/SpawnLocation.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/SpawnLocation.java index cf8f087a..797603c2 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/SpawnLocation.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/SpawnLocation.java @@ -1,5 +1,10 @@ package com.onarandombox.MultiverseCore.worldnew.config; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; +import java.util.HashMap; +import java.util.Map; + import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.World; @@ -8,11 +13,6 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.configuration.serialization.SerializableAs; import org.jetbrains.annotations.NotNull; -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; -import java.util.HashMap; -import java.util.Map; - /** * Just like a regular {@link Location}, however {@code world} is usually {@code null} * or just a weak reference and it implements {@link ConfigurationSerializable}. diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldConfig.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldConfig.java index f8569c1c..349443aa 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldConfig.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldConfig.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.worldnew.config; +import java.util.Collection; +import java.util.List; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.configuration.handle.ConfigurationSectionHandle; import com.onarandombox.MultiverseCore.configuration.migration.BooleanMigratorAction; @@ -21,9 +24,6 @@ import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collection; -import java.util.List; - /** * Represents a world configuration. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldConfigNodes.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldConfigNodes.java index 9930767c..940ec695 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldConfigNodes.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldConfigNodes.java @@ -1,5 +1,8 @@ package com.onarandombox.MultiverseCore.worldnew.config; +import java.util.ArrayList; +import java.util.List; + import com.onarandombox.MultiverseCore.configuration.node.ConfigNode; import com.onarandombox.MultiverseCore.configuration.node.Node; import com.onarandombox.MultiverseCore.configuration.node.NodeGroup; @@ -11,9 +14,6 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; -import java.util.ArrayList; -import java.util.List; - /** * Represents nodes in a world configuration. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldsConfigManager.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldsConfigManager.java index 8c815db5..47ce1b1a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldsConfigManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/config/WorldsConfigManager.java @@ -1,5 +1,14 @@ package com.onarandombox.MultiverseCore.worldnew.config; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; import io.vavr.Tuple2; @@ -12,15 +21,6 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import org.jvnet.hk2.annotations.Service; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - /** * Manages the worlds.yml file. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/entrycheck/WorldEntryChecker.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/entrycheck/WorldEntryChecker.java index 0c82c11c..84df53f4 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/entrycheck/WorldEntryChecker.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/entrycheck/WorldEntryChecker.java @@ -1,5 +1,9 @@ package com.onarandombox.MultiverseCore.worldnew.entrycheck; +import static com.onarandombox.MultiverseCore.utils.message.MessageReplacement.replace; + +import java.util.Collection; + import com.onarandombox.MultiverseCore.config.MVCoreConfig; import com.onarandombox.MultiverseCore.economy.MVEconomist; import com.onarandombox.MultiverseCore.permissions.CorePermissionsChecker; @@ -17,10 +21,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collection; - -import static com.onarandombox.MultiverseCore.utils.message.MessageReplacement.replace; - /** * Checks if a player can enter a world. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/GeneratorPlugin.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/GeneratorPlugin.java index f6264285..824a2db4 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/GeneratorPlugin.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/GeneratorPlugin.java @@ -1,10 +1,10 @@ package com.onarandombox.MultiverseCore.worldnew.generators; +import java.util.Collection; + import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Collection; - /** *

A generator API for Multiverse.

* diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/GeneratorProvider.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/GeneratorProvider.java index 1f282666..d2d09491 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/GeneratorProvider.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/GeneratorProvider.java @@ -1,5 +1,16 @@ package com.onarandombox.MultiverseCore.worldnew.generators; +import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getBukkitConfig; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.MultiverseCore; import io.vavr.control.Try; @@ -18,17 +29,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jvnet.hk2.annotations.Service; -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import static com.onarandombox.MultiverseCore.utils.file.FileUtils.getBukkitConfig; - /** * Parse the default world generators from the bukkit config and load any generator plugins. * Helps in suggesting and validating generator strings. diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/SimpleGeneratorPlugin.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/SimpleGeneratorPlugin.java index 6a701c09..5c05f050 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/SimpleGeneratorPlugin.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/generators/SimpleGeneratorPlugin.java @@ -1,11 +1,11 @@ package com.onarandombox.MultiverseCore.worldnew.generators; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - import java.util.Collection; import java.util.Collections; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + /** * A default implementation of {@link GeneratorPlugin} for those generator plugins that do not provide their own * custom {@link GeneratorPlugin} implementation to Multiverse. diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/helpers/DataStore.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/helpers/DataStore.java index bd65e57c..b39697e7 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/helpers/DataStore.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/helpers/DataStore.java @@ -1,5 +1,9 @@ package com.onarandombox.MultiverseCore.worldnew.helpers; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + import com.dumptruckman.minecraft.util.Logging; import com.onarandombox.MultiverseCore.worldnew.LoadedMultiverseWorld; import io.vavr.control.Try; @@ -7,10 +11,6 @@ import org.bukkit.GameRule; import org.bukkit.World; import org.jvnet.hk2.annotations.Service; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** * A data store for storing and restoring data from an object. * diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/helpers/FilesManipulator.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/helpers/FilesManipulator.java index 6661ae22..49ade635 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/helpers/FilesManipulator.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/helpers/FilesManipulator.java @@ -1,9 +1,6 @@ package com.onarandombox.MultiverseCore.worldnew.helpers; -import com.dumptruckman.minecraft.util.Logging; -import io.vavr.control.Try; -import org.jetbrains.annotations.NotNull; -import org.jvnet.hk2.annotations.Service; +import static java.nio.file.StandardCopyOption.COPY_ATTRIBUTES; import java.io.File; import java.io.IOException; @@ -17,7 +14,10 @@ import java.util.Comparator; import java.util.List; import java.util.stream.Stream; -import static java.nio.file.StandardCopyOption.COPY_ATTRIBUTES; +import com.dumptruckman.minecraft.util.Logging; +import io.vavr.control.Try; +import org.jetbrains.annotations.NotNull; +import org.jvnet.hk2.annotations.Service; /** * A helper class for manipulating files and folders. diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/options/CreateWorldOptions.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/options/CreateWorldOptions.java index 9da8f633..f769bbeb 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/options/CreateWorldOptions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/options/CreateWorldOptions.java @@ -1,12 +1,12 @@ package com.onarandombox.MultiverseCore.worldnew.options; +import java.util.Random; + import org.bukkit.World; import org.bukkit.WorldType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Random; - /** * Options for customizing the creation of a new world. */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/worldnew/options/RegenWorldOptions.java b/src/main/java/com/onarandombox/MultiverseCore/worldnew/options/RegenWorldOptions.java index 35167bf7..600796f0 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/worldnew/options/RegenWorldOptions.java +++ b/src/main/java/com/onarandombox/MultiverseCore/worldnew/options/RegenWorldOptions.java @@ -1,11 +1,11 @@ package com.onarandombox.MultiverseCore.worldnew.options; +import java.util.Random; + import com.onarandombox.MultiverseCore.worldnew.LoadedMultiverseWorld; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.Random; - /** * Options for customizing the regeneration of a world. */ diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/TestDebugMode.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestDebugMode.java index 4ec5d539..5c5357a2 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/TestDebugMode.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/TestDebugMode.java @@ -7,9 +7,15 @@ package com.onarandombox.MultiverseCore; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.File; + import com.onarandombox.MultiverseCore.api.MVCore; import com.onarandombox.MultiverseCore.utils.TestInstanceCreator; -import junit.framework.Assert; import org.bukkit.Server; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -18,13 +24,6 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import java.io.File; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - public class TestDebugMode { TestInstanceCreator creator; Server mockServer; diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/TestEntitySpawnRules.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestEntitySpawnRules.java index 3392ed1f..a5a8e824 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/TestEntitySpawnRules.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/TestEntitySpawnRules.java @@ -1,7 +1,20 @@ package com.onarandombox.MultiverseCore; -import com.onarandombox.MultiverseCore.api.MVWorldManager; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + import com.onarandombox.MultiverseCore.api.MVWorld; +import com.onarandombox.MultiverseCore.api.MVWorldManager; import com.onarandombox.MultiverseCore.listeners.MVEntityListener; import com.onarandombox.MultiverseCore.utils.MockWorldFactory; import com.onarandombox.MultiverseCore.utils.TestInstanceCreator; @@ -17,19 +30,6 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import java.lang.reflect.Field; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.anyBoolean; -import static org.mockito.Mockito.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - public class TestEntitySpawnRules { TestInstanceCreator creator; MultiverseCore core; diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/TestEntryFeeConversion.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestEntryFeeConversion.java index f62c91bc..dd7a1d3f 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/TestEntryFeeConversion.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/TestEntryFeeConversion.java @@ -1,5 +1,9 @@ package com.onarandombox.MultiverseCore; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + import java.util.HashMap; import java.util.Map; @@ -10,10 +14,6 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - public class TestEntryFeeConversion { private TestInstanceCreator creator; diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/TestModifyCommand.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestModifyCommand.java index 74c57e6b..f324ddae 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/TestModifyCommand.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/TestModifyCommand.java @@ -1,21 +1,17 @@ package com.onarandombox.MultiverseCore; -import com.onarandombox.MultiverseCore.api.MVWorld; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import com.onarandombox.MultiverseCore.utils.TestInstanceCreator; import org.bukkit.Server; -import org.bukkit.World.Environment; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.junit.After; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - public class TestModifyCommand { TestInstanceCreator creator; Server mockServer; diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java index e08a0ff8..b36aec3b 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java @@ -7,6 +7,13 @@ package com.onarandombox.MultiverseCore; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + import com.onarandombox.MultiverseCore.api.MVWorld; import com.onarandombox.MultiverseCore.utils.MockWorldFactory; import com.onarandombox.MultiverseCore.utils.TestInstanceCreator; @@ -30,18 +37,6 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - public class TestWorldProperties { private TestInstanceCreator creator; private MultiverseCore core; diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldPurger.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldPurger.java index c95c04aa..fb0f5088 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldPurger.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldPurger.java @@ -1,5 +1,13 @@ package com.onarandombox.MultiverseCore; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.util.Arrays; + import com.onarandombox.MultiverseCore.api.MVWorld; import com.onarandombox.MultiverseCore.api.WorldPurger; import com.onarandombox.MultiverseCore.utils.TestInstanceCreator; @@ -11,14 +19,6 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import java.util.Arrays; - -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - public class TestWorldPurger { TestInstanceCreator creator; MultiverseCore core; diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldStuff.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldStuff.java index 0c3372fc..04367c04 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldStuff.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldStuff.java @@ -7,34 +7,25 @@ package com.onarandombox.MultiverseCore; -import com.onarandombox.MultiverseCore.api.MVWorld; -import com.onarandombox.MultiverseCore.exceptions.PropertyDoesNotExistException; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.File; + import com.onarandombox.MultiverseCore.utils.MockWorldFactory; import com.onarandombox.MultiverseCore.utils.TestInstanceCreator; -import com.onarandombox.MultiverseCore.utils.WorldCreatorMatcher; import org.bukkit.ChatColor; -import org.bukkit.GameMode; import org.bukkit.Server; -import org.bukkit.WorldCreator; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.plugin.Plugin; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.mockito.ArgumentMatchers; -import org.mockito.internal.verification.VerificationModeFactory; - -import java.io.File; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; public class TestWorldStuff { diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/utils/FileUtilsTest.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/FileUtilsTest.java index 84e705ae..e125d882 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/utils/FileUtilsTest.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/utils/FileUtilsTest.java @@ -1,9 +1,7 @@ package com.onarandombox.MultiverseCore.utils; -import com.onarandombox.MultiverseCore.utils.file.FileUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.io.IOException; import java.nio.file.Files; @@ -12,8 +10,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import com.onarandombox.MultiverseCore.utils.file.FileUtils; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; public class FileUtilsTest { diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/utils/MockWorldFactory.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/MockWorldFactory.java index aecf9697..60d6ff76 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/utils/MockWorldFactory.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/utils/MockWorldFactory.java @@ -7,15 +7,11 @@ package com.onarandombox.MultiverseCore.utils; -import org.bukkit.Difficulty; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.World; -import org.bukkit.WorldType; -import org.bukkit.block.Block; -import org.bukkit.generator.ChunkGenerator; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import java.io.File; import java.io.IOException; @@ -27,11 +23,15 @@ import java.util.Map; import java.util.UUID; import java.util.WeakHashMap; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.anyBoolean; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; +import org.bukkit.Difficulty; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.WorldType; +import org.bukkit.block.Block; +import org.bukkit.generator.ChunkGenerator; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; public class MockWorldFactory { diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/utils/TestInstanceCreator.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/TestInstanceCreator.java index 55110a51..cd135da1 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/utils/TestInstanceCreator.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/utils/TestInstanceCreator.java @@ -7,6 +7,18 @@ package com.onarandombox.MultiverseCore.utils; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.anyLong; +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.isA; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; + import java.io.File; import java.lang.reflect.Field; import java.util.ArrayList; @@ -16,12 +28,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import com.onarandombox.MultiverseCore.MultiverseCore; -import com.onarandombox.MultiverseCore.api.MVWorld; -import com.onarandombox.MultiverseCore.listeners.MVEntityListener; -import com.onarandombox.MultiverseCore.listeners.MVPlayerListener; -import com.onarandombox.MultiverseCore.listeners.MVWeatherListener; import com.onarandombox.MultiverseCore.utils.file.FileUtils; -import com.onarandombox.MultiverseCore.world.SimpleMVWorldManager; import junit.framework.Assert; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -40,18 +47,6 @@ import org.mockito.internal.util.reflection.ReflectionMemberAccessor; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.anyBoolean; -import static org.mockito.Mockito.anyLong; -import static org.mockito.Mockito.anyString; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.isA; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - public class TestInstanceCreator { private MultiverseCore core; private Server mockServer; diff --git a/src/old-test/java/com/onarandombox/MultiverseCore/utils/Util.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/Util.java index 974720d0..dd00e021 100644 --- a/src/old-test/java/com/onarandombox/MultiverseCore/utils/Util.java +++ b/src/old-test/java/com/onarandombox/MultiverseCore/utils/Util.java @@ -10,8 +10,8 @@ package com.onarandombox.MultiverseCore.utils; import java.util.logging.ConsoleHandler; import java.util.logging.Handler; import java.util.logging.Level; -import java.util.logging.Logger; import java.util.logging.LogRecord; +import java.util.logging.Logger; public class Util { private Util() {} diff --git a/src/test/java/org/mvplugins/multiverse/core/commandtools/LocalizationTest.kt b/src/test/java/org/mvplugins/multiverse/core/commandtools/LocalizationTest.kt index f2a38114..f466c14c 100644 --- a/src/test/java/org/mvplugins/multiverse/core/commandtools/LocalizationTest.kt +++ b/src/test/java/org/mvplugins/multiverse/core/commandtools/LocalizationTest.kt @@ -17,11 +17,7 @@ import org.mockito.kotlin.argumentCaptor import org.mockito.kotlin.spy import org.mockito.kotlin.verify import org.mvplugins.multiverse.core.TestWithMockBukkit -import kotlin.test.BeforeTest -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertNotEquals -import kotlin.test.assertNotNull +import kotlin.test.* class LocalizationTest : TestWithMockBukkit() { diff --git a/src/test/java/org/mvplugins/multiverse/core/config/ConfigTest.kt b/src/test/java/org/mvplugins/multiverse/core/config/ConfigTest.kt index 32d0d4b4..55f1f5a8 100644 --- a/src/test/java/org/mvplugins/multiverse/core/config/ConfigTest.kt +++ b/src/test/java/org/mvplugins/multiverse/core/config/ConfigTest.kt @@ -5,13 +5,7 @@ import org.mvplugins.multiverse.core.TestWithMockBukkit import java.io.File import java.nio.file.Path import kotlin.io.path.absolutePathString -import kotlin.test.BeforeTest -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertFalse -import kotlin.test.assertNotNull -import kotlin.test.assertNull -import kotlin.test.assertTrue +import kotlin.test.* class ConfigTest : TestWithMockBukkit() { diff --git a/src/test/java/org/mvplugins/multiverse/core/inject/InjectionTest.kt b/src/test/java/org/mvplugins/multiverse/core/inject/InjectionTest.kt index 303b8ecb..bbe27068 100644 --- a/src/test/java/org/mvplugins/multiverse/core/inject/InjectionTest.kt +++ b/src/test/java/org/mvplugins/multiverse/core/inject/InjectionTest.kt @@ -10,12 +10,7 @@ import com.onarandombox.MultiverseCore.commandtools.MultiverseCommand import com.onarandombox.MultiverseCore.commandtools.PluginLocales import com.onarandombox.MultiverseCore.config.MVCoreConfig import com.onarandombox.MultiverseCore.economy.MVEconomist -import com.onarandombox.MultiverseCore.listeners.MVChatListener -import com.onarandombox.MultiverseCore.listeners.MVEntityListener -import com.onarandombox.MultiverseCore.listeners.MVPlayerListener -import com.onarandombox.MultiverseCore.listeners.MVPortalListener -import com.onarandombox.MultiverseCore.listeners.MVWeatherListener -import com.onarandombox.MultiverseCore.listeners.MVWorldListener +import com.onarandombox.MultiverseCore.listeners.* import com.onarandombox.MultiverseCore.teleportation.SimpleBlockSafety import com.onarandombox.MultiverseCore.teleportation.SimpleLocationManipulation import com.onarandombox.MultiverseCore.teleportation.SimpleSafeTTeleporter @@ -24,11 +19,7 @@ import com.onarandombox.MultiverseCore.utils.UnsafeCallWrapper import com.onarandombox.MultiverseCore.utils.metrics.MetricsConfigurator import com.onarandombox.MultiverseCore.worldnew.WorldManager import org.mvplugins.multiverse.core.TestWithMockBukkit -import kotlin.test.Ignore -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertNotNull -import kotlin.test.assertNull +import kotlin.test.* class InjectionTest : TestWithMockBukkit() { diff --git a/src/test/java/org/mvplugins/multiverse/core/world/WorldConfigTest.kt b/src/test/java/org/mvplugins/multiverse/core/world/WorldConfigTest.kt index 44e41b3b..0cde8102 100644 --- a/src/test/java/org/mvplugins/multiverse/core/world/WorldConfigTest.kt +++ b/src/test/java/org/mvplugins/multiverse/core/world/WorldConfigTest.kt @@ -2,17 +2,11 @@ package org.mvplugins.multiverse.core.world import com.onarandombox.MultiverseCore.worldnew.config.WorldConfig import com.onarandombox.MultiverseCore.worldnew.config.WorldsConfigManager -import org.bukkit.Location -import org.junit.jupiter.api.Assertions import org.mvplugins.multiverse.core.TestWithMockBukkit import java.io.File import java.nio.file.Path import kotlin.io.path.absolutePathString -import kotlin.test.BeforeTest -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertNotNull -import kotlin.test.assertTrue +import kotlin.test.* class WorldConfigTest : TestWithMockBukkit() { diff --git a/src/test/java/org/mvplugins/multiverse/core/world/WorldManagerTest.kt b/src/test/java/org/mvplugins/multiverse/core/world/WorldManagerTest.kt index 19237c50..6ef0d3f7 100644 --- a/src/test/java/org/mvplugins/multiverse/core/world/WorldManagerTest.kt +++ b/src/test/java/org/mvplugins/multiverse/core/world/WorldManagerTest.kt @@ -6,11 +6,7 @@ import com.onarandombox.MultiverseCore.worldnew.options.CreateWorldOptions import org.bukkit.World import org.bukkit.WorldType import org.mvplugins.multiverse.core.TestWithMockBukkit -import kotlin.test.BeforeTest -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertFalse -import kotlin.test.assertNotNull +import kotlin.test.* class WorldManagerTest : TestWithMockBukkit() {