From 1b34ba1fbdae7363c3d66be992dacd83f32ec4a7 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 25 Mar 2020 14:22:50 +0100 Subject: [PATCH] Organize imports --- .../java/de/epiceric/shopchest/ShopChest.java | 53 +++++++------- .../shopchest/command/ShopCommand.java | 38 +++++----- .../command/ShopCommandExecutor.java | 42 +++++------ .../shopchest/command/ShopSubCommand.java | 6 +- .../shopchest/command/ShopTabCompleter.java | 14 ++-- .../de/epiceric/shopchest/config/Config.java | 18 ++--- .../shopchest/config/HologramFormat.java | 18 ++--- .../config/LanguageConfiguration.java | 16 +++-- .../shopchest/event/ShopBuySellEvent.java | 3 +- .../shopchest/event/ShopCreateEvent.java | 3 +- .../epiceric/shopchest/event/ShopEvent.java | 3 +- .../shopchest/event/ShopExtendEvent.java | 4 +- .../shopchest/event/ShopInfoEvent.java | 3 +- .../shopchest/event/ShopOpenEvent.java | 3 +- .../shopchest/event/ShopPreCreateEvent.java | 3 +- .../shopchest/event/ShopRemoveAllEvent.java | 5 +- .../shopchest/event/ShopRemoveEvent.java | 3 +- .../external/PlotSquaredShopFlag.java | 4 +- .../shopchest/language/LanguageUtils.java | 20 +++--- .../shopchest/language/PotionName.java | 1 - .../shopchest/listeners/AreaShopListener.java | 9 +-- .../listeners/BlockExplodeListener.java | 5 +- .../listeners/ChestProtectListener.java | 32 ++++----- .../listeners/ShopInteractListener.java | 71 ++++++++++--------- .../shopchest/listeners/ShopItemListener.java | 15 ++-- .../listeners/ShopUpdateListener.java | 8 +-- .../shopchest/nms/ArmorStandWrapper.java | 9 +-- .../shopchest/nms/CustomBookMeta.java | 11 +-- .../de/epiceric/shopchest/nms/Hologram.java | 15 ++-- .../epiceric/shopchest/nms/JsonBuilder.java | 11 +-- .../epiceric/shopchest/nms/SpawnEggMeta.java | 13 ++-- .../java/de/epiceric/shopchest/shop/Shop.java | 26 ++++--- .../de/epiceric/shopchest/shop/ShopItem.java | 17 ++--- .../de/epiceric/shopchest/sql/Database.java | 37 +++++----- .../java/de/epiceric/shopchest/sql/MySQL.java | 9 +-- .../de/epiceric/shopchest/sql/SQLite.java | 5 +- .../de/epiceric/shopchest/utils/Callback.java | 3 +- .../epiceric/shopchest/utils/ClickType.java | 14 ++-- .../epiceric/shopchest/utils/ItemUtils.java | 6 +- .../epiceric/shopchest/utils/ShopUpdater.java | 7 +- .../epiceric/shopchest/utils/ShopUtils.java | 23 +++--- .../shopchest/utils/UpdateChecker.java | 4 +- 42 files changed, 332 insertions(+), 278 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/ShopChest.java b/src/main/java/de/epiceric/shopchest/ShopChest.java index 9b2be51..88f3c43 100644 --- a/src/main/java/de/epiceric/shopchest/ShopChest.java +++ b/src/main/java/de/epiceric/shopchest/ShopChest.java @@ -1,7 +1,34 @@ package de.epiceric.shopchest; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.stream.Stream; + import com.palmergames.bukkit.towny.Towny; import com.wasteofplastic.askyblock.ASkyBlock; + +import org.bstats.bukkit.Metrics; +import org.bukkit.Bukkit; +import org.bukkit.Chunk; +import org.bukkit.World; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.RegisteredServiceProvider; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; +import org.codemc.worldguardwrapper.WorldGuardWrapper; + import de.epiceric.shopchest.command.ShopCommand; import de.epiceric.shopchest.config.Config; import de.epiceric.shopchest.config.HologramFormat; @@ -43,36 +70,10 @@ import fr.xephi.authme.AuthMe; import me.ryanhamshire.GriefPrevention.GriefPrevention; import me.wiefferink.areashop.AreaShop; import net.milkbowl.vault.economy.Economy; -import org.bstats.bukkit.Metrics; -import org.bukkit.Bukkit; -import org.bukkit.Chunk; -import org.bukkit.World; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.RegisteredServiceProvider; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitRunnable; -import org.codemc.worldguardwrapper.WorldGuardWrapper; - import pl.islandworld.IslandWorld; import us.talabrek.ultimateskyblock.api.uSkyBlockAPI; import world.bentobox.bentobox.BentoBox; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.stream.Stream; - public class ShopChest extends JavaPlugin { private static ShopChest instance; diff --git a/src/main/java/de/epiceric/shopchest/command/ShopCommand.java b/src/main/java/de/epiceric/shopchest/command/ShopCommand.java index c437781..0a0b90b 100644 --- a/src/main/java/de/epiceric/shopchest/command/ShopCommand.java +++ b/src/main/java/de/epiceric/shopchest/command/ShopCommand.java @@ -1,21 +1,5 @@ package de.epiceric.shopchest.command; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; -import de.epiceric.shopchest.config.Placeholder; -import de.epiceric.shopchest.language.LanguageUtils; -import de.epiceric.shopchest.language.Message; -import de.epiceric.shopchest.language.Replacement; -import de.epiceric.shopchest.utils.Permissions; -import de.epiceric.shopchest.utils.ClickType.SelectClickType; - -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.command.*; -import org.bukkit.entity.Player; -import org.bukkit.permissions.PermissionAttachmentInfo; -import org.bukkit.plugin.Plugin; - import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; @@ -24,6 +8,28 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandMap; +import org.bukkit.command.CommandSender; +import org.bukkit.command.PluginCommand; +import org.bukkit.command.SimpleCommandMap; +import org.bukkit.command.TabCompleter; +import org.bukkit.entity.Player; +import org.bukkit.permissions.PermissionAttachmentInfo; +import org.bukkit.plugin.Plugin; + +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; +import de.epiceric.shopchest.config.Placeholder; +import de.epiceric.shopchest.language.LanguageUtils; +import de.epiceric.shopchest.language.Message; +import de.epiceric.shopchest.language.Replacement; +import de.epiceric.shopchest.utils.ClickType.SelectClickType; +import de.epiceric.shopchest.utils.Permissions; + public class ShopCommand { private static boolean commandCreated = false; diff --git a/src/main/java/de/epiceric/shopchest/command/ShopCommandExecutor.java b/src/main/java/de/epiceric/shopchest/command/ShopCommandExecutor.java index 79571f2..7087cbc 100644 --- a/src/main/java/de/epiceric/shopchest/command/ShopCommandExecutor.java +++ b/src/main/java/de/epiceric/shopchest/command/ShopCommandExecutor.java @@ -1,5 +1,23 @@ package de.epiceric.shopchest.command; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Stream; + +import org.bukkit.Bukkit; +import org.bukkit.Chunk; +import org.bukkit.GameMode; +import org.bukkit.OfflinePlayer; +import org.bukkit.World; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + import de.epiceric.shopchest.ShopChest; import de.epiceric.shopchest.config.Config; import de.epiceric.shopchest.config.Placeholder; @@ -13,35 +31,17 @@ import de.epiceric.shopchest.language.LanguageUtils; import de.epiceric.shopchest.language.Message; import de.epiceric.shopchest.language.Replacement; import de.epiceric.shopchest.shop.Shop; -import de.epiceric.shopchest.shop.ShopProduct; import de.epiceric.shopchest.shop.Shop.ShopType; +import de.epiceric.shopchest.shop.ShopProduct; import de.epiceric.shopchest.utils.Callback; import de.epiceric.shopchest.utils.ClickType; +import de.epiceric.shopchest.utils.ClickType.CreateClickType; +import de.epiceric.shopchest.utils.ClickType.SelectClickType; import de.epiceric.shopchest.utils.ItemUtils; import de.epiceric.shopchest.utils.Permissions; import de.epiceric.shopchest.utils.ShopUtils; import de.epiceric.shopchest.utils.UpdateChecker; import de.epiceric.shopchest.utils.Utils; -import de.epiceric.shopchest.utils.ClickType.CreateClickType; -import de.epiceric.shopchest.utils.ClickType.SelectClickType; - -import org.bukkit.Bukkit; -import org.bukkit.Chunk; -import org.bukkit.GameMode; -import org.bukkit.OfflinePlayer; -import org.bukkit.World; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.stream.Stream; class ShopCommandExecutor implements CommandExecutor { diff --git a/src/main/java/de/epiceric/shopchest/command/ShopSubCommand.java b/src/main/java/de/epiceric/shopchest/command/ShopSubCommand.java index 526b5be..d52f7f6 100644 --- a/src/main/java/de/epiceric/shopchest/command/ShopSubCommand.java +++ b/src/main/java/de/epiceric/shopchest/command/ShopSubCommand.java @@ -1,13 +1,13 @@ package de.epiceric.shopchest.command; +import java.util.ArrayList; +import java.util.List; + import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; -import java.util.ArrayList; -import java.util.List; - public abstract class ShopSubCommand { private String name; private boolean playerCommand; diff --git a/src/main/java/de/epiceric/shopchest/command/ShopTabCompleter.java b/src/main/java/de/epiceric/shopchest/command/ShopTabCompleter.java index b9c89ab..48f0f7f 100644 --- a/src/main/java/de/epiceric/shopchest/command/ShopTabCompleter.java +++ b/src/main/java/de/epiceric/shopchest/command/ShopTabCompleter.java @@ -1,7 +1,10 @@ package de.epiceric.shopchest.command; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; import org.bukkit.Bukkit; import org.bukkit.command.Command; @@ -9,11 +12,8 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; class ShopTabCompleter implements TabCompleter { diff --git a/src/main/java/de/epiceric/shopchest/config/Config.java b/src/main/java/de/epiceric/shopchest/config/Config.java index e3c57d7..ba136f6 100644 --- a/src/main/java/de/epiceric/shopchest/config/Config.java +++ b/src/main/java/de/epiceric/shopchest/config/Config.java @@ -1,14 +1,5 @@ package de.epiceric.shopchest.config; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.language.LanguageUtils; -import de.epiceric.shopchest.sql.Database; -import de.epiceric.shopchest.utils.ItemUtils; -import de.epiceric.shopchest.utils.Utils; - -import org.bukkit.configuration.InvalidConfigurationException; -import org.bukkit.inventory.ItemStack; - import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -19,6 +10,15 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import org.bukkit.configuration.InvalidConfigurationException; +import org.bukkit.inventory.ItemStack; + +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.language.LanguageUtils; +import de.epiceric.shopchest.sql.Database; +import de.epiceric.shopchest.utils.ItemUtils; +import de.epiceric.shopchest.utils.Utils; + public class Config { /** diff --git a/src/main/java/de/epiceric/shopchest/config/HologramFormat.java b/src/main/java/de/epiceric/shopchest/config/HologramFormat.java index 8b7077d..6e50ddf 100644 --- a/src/main/java/de/epiceric/shopchest/config/HologramFormat.java +++ b/src/main/java/de/epiceric/shopchest/config/HologramFormat.java @@ -1,19 +1,21 @@ package de.epiceric.shopchest.config; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.utils.Operator; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; - -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; import java.io.File; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; + +import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.file.YamlConfiguration; + +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.utils.Operator; + public class HologramFormat { public enum Requirement { diff --git a/src/main/java/de/epiceric/shopchest/config/LanguageConfiguration.java b/src/main/java/de/epiceric/shopchest/config/LanguageConfiguration.java index 921edc2..7bc3f3c 100644 --- a/src/main/java/de/epiceric/shopchest/config/LanguageConfiguration.java +++ b/src/main/java/de/epiceric/shopchest/config/LanguageConfiguration.java @@ -1,14 +1,20 @@ package de.epiceric.shopchest.config; -import de.epiceric.shopchest.ShopChest; -import org.bukkit.configuration.InvalidConfigurationException; -import org.bukkit.configuration.file.FileConfiguration; - -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; +import org.bukkit.configuration.InvalidConfigurationException; +import org.bukkit.configuration.file.FileConfiguration; + +import de.epiceric.shopchest.ShopChest; + public class LanguageConfiguration extends FileConfiguration { private ArrayList lines = new ArrayList<>(); diff --git a/src/main/java/de/epiceric/shopchest/event/ShopBuySellEvent.java b/src/main/java/de/epiceric/shopchest/event/ShopBuySellEvent.java index e47d2a1..eaa17cb 100644 --- a/src/main/java/de/epiceric/shopchest/event/ShopBuySellEvent.java +++ b/src/main/java/de/epiceric/shopchest/event/ShopBuySellEvent.java @@ -1,9 +1,10 @@ package de.epiceric.shopchest.event; -import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +import de.epiceric.shopchest.shop.Shop; + /** * Called when a player buys or sells something from or to a shop */ diff --git a/src/main/java/de/epiceric/shopchest/event/ShopCreateEvent.java b/src/main/java/de/epiceric/shopchest/event/ShopCreateEvent.java index 13ce1bb..d8dbd74 100644 --- a/src/main/java/de/epiceric/shopchest/event/ShopCreateEvent.java +++ b/src/main/java/de/epiceric/shopchest/event/ShopCreateEvent.java @@ -1,9 +1,10 @@ package de.epiceric.shopchest.event; -import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +import de.epiceric.shopchest.shop.Shop; + /** * Called when a player creates a shop (clicks on a chest) */ diff --git a/src/main/java/de/epiceric/shopchest/event/ShopEvent.java b/src/main/java/de/epiceric/shopchest/event/ShopEvent.java index 615b123..9eaa980 100644 --- a/src/main/java/de/epiceric/shopchest/event/ShopEvent.java +++ b/src/main/java/de/epiceric/shopchest/event/ShopEvent.java @@ -1,10 +1,11 @@ package de.epiceric.shopchest.event; -import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; +import de.epiceric.shopchest.shop.Shop; + public abstract class ShopEvent extends Event { private static final HandlerList handlers = new HandlerList(); diff --git a/src/main/java/de/epiceric/shopchest/event/ShopExtendEvent.java b/src/main/java/de/epiceric/shopchest/event/ShopExtendEvent.java index cc6a2d9..168059f 100644 --- a/src/main/java/de/epiceric/shopchest/event/ShopExtendEvent.java +++ b/src/main/java/de/epiceric/shopchest/event/ShopExtendEvent.java @@ -1,11 +1,11 @@ package de.epiceric.shopchest.event; -import de.epiceric.shopchest.shop.Shop; - import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +import de.epiceric.shopchest.shop.Shop; + /** * Called when a player extends a shop (making a chest a double chest) */ diff --git a/src/main/java/de/epiceric/shopchest/event/ShopInfoEvent.java b/src/main/java/de/epiceric/shopchest/event/ShopInfoEvent.java index d86bcff..7a14887 100644 --- a/src/main/java/de/epiceric/shopchest/event/ShopInfoEvent.java +++ b/src/main/java/de/epiceric/shopchest/event/ShopInfoEvent.java @@ -1,9 +1,10 @@ package de.epiceric.shopchest.event; -import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +import de.epiceric.shopchest.shop.Shop; + /** * Called when a player retrieves information about a shop (clicks on a chest) */ diff --git a/src/main/java/de/epiceric/shopchest/event/ShopOpenEvent.java b/src/main/java/de/epiceric/shopchest/event/ShopOpenEvent.java index 3aa8a3d..d9c1541 100644 --- a/src/main/java/de/epiceric/shopchest/event/ShopOpenEvent.java +++ b/src/main/java/de/epiceric/shopchest/event/ShopOpenEvent.java @@ -1,9 +1,10 @@ package de.epiceric.shopchest.event; -import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +import de.epiceric.shopchest.shop.Shop; + /** * Called when a player opens a shop (clicks on a chest) */ diff --git a/src/main/java/de/epiceric/shopchest/event/ShopPreCreateEvent.java b/src/main/java/de/epiceric/shopchest/event/ShopPreCreateEvent.java index 18493fc..b93b525 100644 --- a/src/main/java/de/epiceric/shopchest/event/ShopPreCreateEvent.java +++ b/src/main/java/de/epiceric/shopchest/event/ShopPreCreateEvent.java @@ -1,9 +1,10 @@ package de.epiceric.shopchest.event; -import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +import de.epiceric.shopchest.shop.Shop; + /** * Called when a player wants to create a shop (enters the command) */ diff --git a/src/main/java/de/epiceric/shopchest/event/ShopRemoveAllEvent.java b/src/main/java/de/epiceric/shopchest/event/ShopRemoveAllEvent.java index c9b8eaf..5282a8e 100644 --- a/src/main/java/de/epiceric/shopchest/event/ShopRemoveAllEvent.java +++ b/src/main/java/de/epiceric/shopchest/event/ShopRemoveAllEvent.java @@ -1,13 +1,14 @@ package de.epiceric.shopchest.event; -import de.epiceric.shopchest.shop.Shop; +import java.util.List; + import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; -import java.util.List; +import de.epiceric.shopchest.shop.Shop; public class ShopRemoveAllEvent extends Event implements Cancellable { private static final HandlerList handlers = new HandlerList(); diff --git a/src/main/java/de/epiceric/shopchest/event/ShopRemoveEvent.java b/src/main/java/de/epiceric/shopchest/event/ShopRemoveEvent.java index dc0a44e..2376763 100644 --- a/src/main/java/de/epiceric/shopchest/event/ShopRemoveEvent.java +++ b/src/main/java/de/epiceric/shopchest/event/ShopRemoveEvent.java @@ -1,9 +1,10 @@ package de.epiceric.shopchest.event; -import de.epiceric.shopchest.shop.Shop; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +import de.epiceric.shopchest.shop.Shop; + /** * Called when a player removes a shop (clicks on a chest) */ diff --git a/src/main/java/de/epiceric/shopchest/external/PlotSquaredShopFlag.java b/src/main/java/de/epiceric/shopchest/external/PlotSquaredShopFlag.java index 8a8805e..4b72463 100644 --- a/src/main/java/de/epiceric/shopchest/external/PlotSquaredShopFlag.java +++ b/src/main/java/de/epiceric/shopchest/external/PlotSquaredShopFlag.java @@ -1,5 +1,7 @@ package de.epiceric.shopchest.external; +import java.util.Locale; + import com.github.intellectualsites.plotsquared.plot.flag.Flag; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.Plot; @@ -8,8 +10,6 @@ import org.bukkit.entity.Player; import de.epiceric.shopchest.ShopChest; -import java.util.Locale; - public class PlotSquaredShopFlag { private static boolean registered = false; diff --git a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java index 9168510..3c0d683 100644 --- a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java +++ b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java @@ -1,12 +1,8 @@ package de.epiceric.shopchest.language; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; -import de.epiceric.shopchest.config.LanguageConfiguration; -import de.epiceric.shopchest.config.Placeholder; -import de.epiceric.shopchest.nms.CustomBookMeta; -import de.epiceric.shopchest.nms.SpawnEggMeta; -import de.epiceric.shopchest.utils.Utils; +import java.util.ArrayList; +import java.util.Map; +import java.util.StringJoiner; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -21,9 +17,13 @@ import org.bukkit.potion.Potion; import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionType; -import java.util.ArrayList; -import java.util.Map; -import java.util.StringJoiner; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; +import de.epiceric.shopchest.config.LanguageConfiguration; +import de.epiceric.shopchest.config.Placeholder; +import de.epiceric.shopchest.nms.CustomBookMeta; +import de.epiceric.shopchest.nms.SpawnEggMeta; +import de.epiceric.shopchest.utils.Utils; public class LanguageUtils { diff --git a/src/main/java/de/epiceric/shopchest/language/PotionName.java b/src/main/java/de/epiceric/shopchest/language/PotionName.java index 9eae377..3e3211d 100644 --- a/src/main/java/de/epiceric/shopchest/language/PotionName.java +++ b/src/main/java/de/epiceric/shopchest/language/PotionName.java @@ -1,6 +1,5 @@ package de.epiceric.shopchest.language; - import org.bukkit.potion.PotionType; public class PotionName { diff --git a/src/main/java/de/epiceric/shopchest/listeners/AreaShopListener.java b/src/main/java/de/epiceric/shopchest/listeners/AreaShopListener.java index f841f1e..3bc72d3 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/AreaShopListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/AreaShopListener.java @@ -1,5 +1,10 @@ package de.epiceric.shopchest.listeners; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.codemc.worldguardwrapper.WorldGuardWrapper; +import org.codemc.worldguardwrapper.region.IWrappedRegion; + import de.epiceric.shopchest.ShopChest; import de.epiceric.shopchest.config.Config; import de.epiceric.shopchest.shop.Shop; @@ -8,10 +13,6 @@ import me.wiefferink.areashop.events.notify.ResoldRegionEvent; import me.wiefferink.areashop.events.notify.SoldRegionEvent; import me.wiefferink.areashop.events.notify.UnrentedRegionEvent; import me.wiefferink.areashop.regions.GeneralRegion; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.codemc.worldguardwrapper.WorldGuardWrapper; -import org.codemc.worldguardwrapper.region.IWrappedRegion; public class AreaShopListener implements Listener { diff --git a/src/main/java/de/epiceric/shopchest/listeners/BlockExplodeListener.java b/src/main/java/de/epiceric/shopchest/listeners/BlockExplodeListener.java index cdae016..55e0a4f 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/BlockExplodeListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/BlockExplodeListener.java @@ -1,13 +1,14 @@ package de.epiceric.shopchest.listeners; -import de.epiceric.shopchest.ShopChest; +import java.util.ArrayList; + import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockExplodeEvent; -import java.util.ArrayList; +import de.epiceric.shopchest.ShopChest; public class BlockExplodeListener implements Listener { diff --git a/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java b/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java index bbe7030..b7af654 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java @@ -1,20 +1,6 @@ package de.epiceric.shopchest.listeners; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; -import de.epiceric.shopchest.config.Placeholder; -import de.epiceric.shopchest.event.ShopExtendEvent; -import de.epiceric.shopchest.language.LanguageUtils; -import de.epiceric.shopchest.language.Message; -import de.epiceric.shopchest.language.Replacement; -import de.epiceric.shopchest.shop.Shop; -import de.epiceric.shopchest.shop.Shop.ShopType; -import de.epiceric.shopchest.utils.Callback; -import de.epiceric.shopchest.utils.ItemUtils; -import de.epiceric.shopchest.utils.Permissions; -import de.epiceric.shopchest.utils.ShopUtils; -import de.epiceric.shopchest.utils.Utils; -import net.milkbowl.vault.economy.EconomyResponse; +import java.util.ArrayList; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -35,7 +21,21 @@ import org.bukkit.event.inventory.InventoryMoveItemEvent; import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.InventoryHolder; -import java.util.ArrayList; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; +import de.epiceric.shopchest.config.Placeholder; +import de.epiceric.shopchest.event.ShopExtendEvent; +import de.epiceric.shopchest.language.LanguageUtils; +import de.epiceric.shopchest.language.Message; +import de.epiceric.shopchest.language.Replacement; +import de.epiceric.shopchest.shop.Shop; +import de.epiceric.shopchest.shop.Shop.ShopType; +import de.epiceric.shopchest.utils.Callback; +import de.epiceric.shopchest.utils.ItemUtils; +import de.epiceric.shopchest.utils.Permissions; +import de.epiceric.shopchest.utils.ShopUtils; +import de.epiceric.shopchest.utils.Utils; +import net.milkbowl.vault.economy.EconomyResponse; public class ChestProtectListener implements Listener { diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java index f6b1d9d..ec187be 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopInteractListener.java @@ -1,34 +1,16 @@ package de.epiceric.shopchest.listeners; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import com.github.intellectualsites.plotsquared.plot.object.Plot; import com.google.gson.JsonPrimitive; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; -import de.epiceric.shopchest.config.Placeholder; -import de.epiceric.shopchest.event.ShopBuySellEvent; -import de.epiceric.shopchest.event.ShopCreateEvent; -import de.epiceric.shopchest.event.ShopInfoEvent; -import de.epiceric.shopchest.event.ShopOpenEvent; -import de.epiceric.shopchest.event.ShopRemoveEvent; -import de.epiceric.shopchest.external.PlotSquaredShopFlag; -import de.epiceric.shopchest.external.PlotSquaredShopFlag.GroupFlag; -import de.epiceric.shopchest.language.LanguageUtils; -import de.epiceric.shopchest.language.Message; -import de.epiceric.shopchest.language.Replacement; -import de.epiceric.shopchest.nms.JsonBuilder; -import de.epiceric.shopchest.shop.Shop; -import de.epiceric.shopchest.shop.ShopProduct; -import de.epiceric.shopchest.shop.Shop.ShopType; -import de.epiceric.shopchest.sql.Database; -import de.epiceric.shopchest.utils.ClickType; -import de.epiceric.shopchest.utils.ItemUtils; -import de.epiceric.shopchest.utils.Permissions; -import de.epiceric.shopchest.utils.ShopUtils; -import de.epiceric.shopchest.utils.Utils; -import de.epiceric.shopchest.utils.ClickType.CreateClickType; -import fr.xephi.authme.api.v3.AuthMeApi; -import net.milkbowl.vault.economy.Economy; -import net.milkbowl.vault.economy.EconomyResponse; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -54,14 +36,33 @@ import org.codemc.worldguardwrapper.WorldGuardWrapper; import org.codemc.worldguardwrapper.flag.IWrappedFlag; import org.codemc.worldguardwrapper.flag.WrappedState; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.UUID; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; +import de.epiceric.shopchest.config.Placeholder; +import de.epiceric.shopchest.event.ShopBuySellEvent; +import de.epiceric.shopchest.event.ShopCreateEvent; +import de.epiceric.shopchest.event.ShopInfoEvent; +import de.epiceric.shopchest.event.ShopOpenEvent; +import de.epiceric.shopchest.event.ShopRemoveEvent; +import de.epiceric.shopchest.external.PlotSquaredShopFlag; +import de.epiceric.shopchest.external.PlotSquaredShopFlag.GroupFlag; +import de.epiceric.shopchest.language.LanguageUtils; +import de.epiceric.shopchest.language.Message; +import de.epiceric.shopchest.language.Replacement; +import de.epiceric.shopchest.nms.JsonBuilder; +import de.epiceric.shopchest.shop.Shop; +import de.epiceric.shopchest.shop.Shop.ShopType; +import de.epiceric.shopchest.shop.ShopProduct; +import de.epiceric.shopchest.sql.Database; +import de.epiceric.shopchest.utils.ClickType; +import de.epiceric.shopchest.utils.ClickType.CreateClickType; +import de.epiceric.shopchest.utils.ItemUtils; +import de.epiceric.shopchest.utils.Permissions; +import de.epiceric.shopchest.utils.ShopUtils; +import de.epiceric.shopchest.utils.Utils; +import fr.xephi.authme.api.v3.AuthMeApi; +import net.milkbowl.vault.economy.Economy; +import net.milkbowl.vault.economy.EconomyResponse; public class ShopInteractListener implements Listener { private static final Pattern COLOR_CODE_PATTERN = Pattern.compile(".*([ยง]([a-fA-F0-9]))"); diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java index 0d73fb6..13679b1 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java @@ -1,8 +1,5 @@ package de.epiceric.shopchest.listeners; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.shop.Shop; -import de.epiceric.shopchest.utils.ShopUtils; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Block; @@ -12,10 +9,20 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.block.*; +import org.bukkit.event.block.BlockFromToEvent; +import org.bukkit.event.block.BlockGrowEvent; +import org.bukkit.event.block.BlockMultiPlaceEvent; +import org.bukkit.event.block.BlockPistonExtendEvent; +import org.bukkit.event.block.BlockPistonRetractEvent; +import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.player.PlayerBucketEmptyEvent; import org.bukkit.event.world.StructureGrowEvent; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.shop.Shop; +import de.epiceric.shopchest.utils.ShopUtils; + public class ShopItemListener implements Listener { private ShopUtils shopUtils; diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopUpdateListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopUpdateListener.java index 3e3d6d8..449713d 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopUpdateListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopUpdateListener.java @@ -1,9 +1,5 @@ package de.epiceric.shopchest.listeners; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.shop.Shop; -import de.epiceric.shopchest.utils.Callback; - import java.util.HashSet; import java.util.Set; @@ -22,6 +18,10 @@ import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.scheduler.BukkitRunnable; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.shop.Shop; +import de.epiceric.shopchest.utils.Callback; + public class ShopUpdateListener implements Listener { private final ShopChest plugin; diff --git a/src/main/java/de/epiceric/shopchest/nms/ArmorStandWrapper.java b/src/main/java/de/epiceric/shopchest/nms/ArmorStandWrapper.java index 1c15b07..f10287a 100644 --- a/src/main/java/de/epiceric/shopchest/nms/ArmorStandWrapper.java +++ b/src/main/java/de/epiceric/shopchest/nms/ArmorStandWrapper.java @@ -1,13 +1,14 @@ package de.epiceric.shopchest.nms; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.utils.Utils; +import java.lang.reflect.Field; +import java.util.UUID; + import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import java.lang.reflect.Field; -import java.util.UUID; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.utils.Utils; public class ArmorStandWrapper { diff --git a/src/main/java/de/epiceric/shopchest/nms/CustomBookMeta.java b/src/main/java/de/epiceric/shopchest/nms/CustomBookMeta.java index e21b8a1..cd51f52 100644 --- a/src/main/java/de/epiceric/shopchest/nms/CustomBookMeta.java +++ b/src/main/java/de/epiceric/shopchest/nms/CustomBookMeta.java @@ -1,10 +1,11 @@ package de.epiceric.shopchest.nms; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.utils.Utils; -import org.bukkit.inventory.ItemStack; - -import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.InvocationTargetException; + +import org.bukkit.inventory.ItemStack; + +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.utils.Utils; // For versions below 1.9.4, since Bukkit's BookMeta // didn't have generations in those versions diff --git a/src/main/java/de/epiceric/shopchest/nms/Hologram.java b/src/main/java/de/epiceric/shopchest/nms/Hologram.java index 4e9ed8b..97caf80 100644 --- a/src/main/java/de/epiceric/shopchest/nms/Hologram.java +++ b/src/main/java/de/epiceric/shopchest/nms/Hologram.java @@ -1,19 +1,22 @@ package de.epiceric.shopchest.nms; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; + import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Player; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; public class Hologram { // concurrent since update task is in async thread - // since this is a fake entity, hologram is hidden per default - private final Set viewers = Collections.newSetFromMap(new ConcurrentHashMap()); + private final Set viewers = ConcurrentHashMap.newKeySet(); private final List wrappers = new ArrayList<>(); private final Location location; private final ShopChest plugin; diff --git a/src/main/java/de/epiceric/shopchest/nms/JsonBuilder.java b/src/main/java/de/epiceric/shopchest/nms/JsonBuilder.java index 522ed05..3bd80ee 100644 --- a/src/main/java/de/epiceric/shopchest/nms/JsonBuilder.java +++ b/src/main/java/de/epiceric/shopchest/nms/JsonBuilder.java @@ -1,10 +1,5 @@ package de.epiceric.shopchest.nms; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.utils.Utils; -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; - import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Arrays; @@ -15,6 +10,12 @@ import java.util.StringJoiner; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.bukkit.ChatColor; +import org.bukkit.entity.Player; + +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.utils.Utils; + public class JsonBuilder { public static class Part { diff --git a/src/main/java/de/epiceric/shopchest/nms/SpawnEggMeta.java b/src/main/java/de/epiceric/shopchest/nms/SpawnEggMeta.java index 81a1c87..0a031d5 100644 --- a/src/main/java/de/epiceric/shopchest/nms/SpawnEggMeta.java +++ b/src/main/java/de/epiceric/shopchest/nms/SpawnEggMeta.java @@ -1,11 +1,12 @@ package de.epiceric.shopchest.nms; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.utils.Utils; -import org.bukkit.entity.EntityType; -import org.bukkit.inventory.ItemStack; - -import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.InvocationTargetException; + +import org.bukkit.entity.EntityType; +import org.bukkit.inventory.ItemStack; + +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.utils.Utils; public class SpawnEggMeta { diff --git a/src/main/java/de/epiceric/shopchest/shop/Shop.java b/src/main/java/de/epiceric/shopchest/shop/Shop.java index 26d7003..586da8e 100644 --- a/src/main/java/de/epiceric/shopchest/shop/Shop.java +++ b/src/main/java/de/epiceric/shopchest/shop/Shop.java @@ -1,15 +1,10 @@ package de.epiceric.shopchest.shop; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; -import de.epiceric.shopchest.config.HologramFormat; -import de.epiceric.shopchest.config.Placeholder; -import de.epiceric.shopchest.exceptions.ChestNotFoundException; -import de.epiceric.shopchest.exceptions.NotEnoughSpaceException; -import de.epiceric.shopchest.language.LanguageUtils; -import de.epiceric.shopchest.nms.Hologram; -import de.epiceric.shopchest.utils.ItemUtils; -import de.epiceric.shopchest.utils.Utils; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; + import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.OfflinePlayer; @@ -25,7 +20,16 @@ import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; -import java.util.*; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; +import de.epiceric.shopchest.config.HologramFormat; +import de.epiceric.shopchest.config.Placeholder; +import de.epiceric.shopchest.exceptions.ChestNotFoundException; +import de.epiceric.shopchest.exceptions.NotEnoughSpaceException; +import de.epiceric.shopchest.language.LanguageUtils; +import de.epiceric.shopchest.nms.Hologram; +import de.epiceric.shopchest.utils.ItemUtils; +import de.epiceric.shopchest.utils.Utils; public class Shop { diff --git a/src/main/java/de/epiceric/shopchest/shop/ShopItem.java b/src/main/java/de/epiceric/shopchest/shop/ShopItem.java index 36014a7..6077a4c 100644 --- a/src/main/java/de/epiceric/shopchest/shop/ShopItem.java +++ b/src/main/java/de/epiceric/shopchest/shop/ShopItem.java @@ -1,24 +1,25 @@ package de.epiceric.shopchest.shop; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.utils.Utils; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; + import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.lang.reflect.InvocationTargetException; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.utils.Utils; public class ShopItem { - private final ShopChest plugin; // concurrent since update task is in async thread - // since this is a fake entity, item is hidden per default - private final Set viewers = Collections.newSetFromMap(new ConcurrentHashMap()); + private final Set viewers = ConcurrentHashMap.newKeySet(); private final ItemStack itemStack; private final Location location; private final UUID uuid = UUID.randomUUID(); diff --git a/src/main/java/de/epiceric/shopchest/sql/Database.java b/src/main/java/de/epiceric/shopchest/sql/Database.java index f59fa83..c96d975 100644 --- a/src/main/java/de/epiceric/shopchest/sql/Database.java +++ b/src/main/java/de/epiceric/shopchest/sql/Database.java @@ -1,23 +1,5 @@ package de.epiceric.shopchest.sql; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; -import de.epiceric.shopchest.event.ShopBuySellEvent; -import de.epiceric.shopchest.event.ShopBuySellEvent.Type; -import de.epiceric.shopchest.shop.Shop; -import de.epiceric.shopchest.shop.ShopProduct; -import de.epiceric.shopchest.shop.Shop.ShopType; -import de.epiceric.shopchest.utils.Callback; -import de.epiceric.shopchest.utils.Utils; -import org.bukkit.Bukkit; -import org.bukkit.Chunk; -import org.bukkit.Location; -import org.bukkit.OfflinePlayer; -import org.bukkit.World; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.scheduler.BukkitRunnable; - import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -37,6 +19,25 @@ import java.util.UUID; import com.zaxxer.hikari.HikariDataSource; +import org.bukkit.Bukkit; +import org.bukkit.Chunk; +import org.bukkit.Location; +import org.bukkit.OfflinePlayer; +import org.bukkit.World; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.scheduler.BukkitRunnable; + +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; +import de.epiceric.shopchest.event.ShopBuySellEvent; +import de.epiceric.shopchest.event.ShopBuySellEvent.Type; +import de.epiceric.shopchest.shop.Shop; +import de.epiceric.shopchest.shop.Shop.ShopType; +import de.epiceric.shopchest.shop.ShopProduct; +import de.epiceric.shopchest.utils.Callback; +import de.epiceric.shopchest.utils.Utils; + public abstract class Database { private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); diff --git a/src/main/java/de/epiceric/shopchest/sql/MySQL.java b/src/main/java/de/epiceric/shopchest/sql/MySQL.java index 2c97b0c..3a6df4e 100644 --- a/src/main/java/de/epiceric/shopchest/sql/MySQL.java +++ b/src/main/java/de/epiceric/shopchest/sql/MySQL.java @@ -1,9 +1,5 @@ package de.epiceric.shopchest.sql; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; -import org.bukkit.scheduler.BukkitRunnable; - import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; @@ -11,6 +7,11 @@ import java.sql.Statement; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; +import org.bukkit.scheduler.BukkitRunnable; + +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; + public class MySQL extends Database { public MySQL(ShopChest plugin) { diff --git a/src/main/java/de/epiceric/shopchest/sql/SQLite.java b/src/main/java/de/epiceric/shopchest/sql/SQLite.java index 02b3cb4..97eb665 100644 --- a/src/main/java/de/epiceric/shopchest/sql/SQLite.java +++ b/src/main/java/de/epiceric/shopchest/sql/SQLite.java @@ -1,8 +1,5 @@ package de.epiceric.shopchest.sql; -import de.epiceric.shopchest.ShopChest; -import org.bukkit.scheduler.BukkitRunnable; - import java.io.File; import java.io.IOException; import java.sql.Connection; @@ -12,6 +9,8 @@ import java.sql.Statement; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; +import de.epiceric.shopchest.ShopChest; + public class SQLite extends Database { public SQLite(ShopChest plugin) { diff --git a/src/main/java/de/epiceric/shopchest/utils/Callback.java b/src/main/java/de/epiceric/shopchest/utils/Callback.java index 2c2b388..bb638d6 100644 --- a/src/main/java/de/epiceric/shopchest/utils/Callback.java +++ b/src/main/java/de/epiceric/shopchest/utils/Callback.java @@ -1,8 +1,9 @@ package de.epiceric.shopchest.utils; -import de.epiceric.shopchest.ShopChest; import org.bukkit.scheduler.BukkitRunnable; +import de.epiceric.shopchest.ShopChest; + public abstract class Callback { private ShopChest plugin; diff --git a/src/main/java/de/epiceric/shopchest/utils/ClickType.java b/src/main/java/de/epiceric/shopchest/utils/ClickType.java index cf80916..0e5a98d 100644 --- a/src/main/java/de/epiceric/shopchest/utils/ClickType.java +++ b/src/main/java/de/epiceric/shopchest/utils/ClickType.java @@ -1,8 +1,9 @@ package de.epiceric.shopchest.utils; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.shop.ShopProduct; -import de.epiceric.shopchest.shop.Shop.ShopType; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -12,10 +13,9 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitTask; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.UUID; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.shop.Shop.ShopType; +import de.epiceric.shopchest.shop.ShopProduct; public class ClickType { private static Map playerClickType = new HashMap<>(); diff --git a/src/main/java/de/epiceric/shopchest/utils/ItemUtils.java b/src/main/java/de/epiceric/shopchest/utils/ItemUtils.java index da96b3c..d7949d4 100644 --- a/src/main/java/de/epiceric/shopchest/utils/ItemUtils.java +++ b/src/main/java/de/epiceric/shopchest/utils/ItemUtils.java @@ -1,5 +1,8 @@ package de.epiceric.shopchest.utils; +import java.util.Arrays; +import java.util.Map; + import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; @@ -8,9 +11,6 @@ import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.potion.Potion; import org.bukkit.potion.PotionType; -import java.util.Arrays; -import java.util.Map; - public class ItemUtils { public static Map getEnchantments(ItemStack itemStack) { diff --git a/src/main/java/de/epiceric/shopchest/utils/ShopUpdater.java b/src/main/java/de/epiceric/shopchest/utils/ShopUpdater.java index 5cf931f..3c7f98d 100644 --- a/src/main/java/de/epiceric/shopchest/utils/ShopUpdater.java +++ b/src/main/java/de/epiceric/shopchest/utils/ShopUpdater.java @@ -1,12 +1,13 @@ package de.epiceric.shopchest.utils; -import de.epiceric.shopchest.ShopChest; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; + import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.entity.Player; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; +import de.epiceric.shopchest.ShopChest; public class ShopUpdater { diff --git a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java index 3735e0c..71ee757 100644 --- a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java +++ b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java @@ -1,10 +1,15 @@ package de.epiceric.shopchest.utils; -import de.epiceric.shopchest.ShopChest; -import de.epiceric.shopchest.config.Config; -import de.epiceric.shopchest.event.ShopsLoadedEvent; -import de.epiceric.shopchest.shop.Shop; -import de.epiceric.shopchest.shop.Shop.ShopType; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; import org.bukkit.Bukkit; import org.bukkit.Chunk; @@ -17,9 +22,11 @@ import org.bukkit.inventory.InventoryHolder; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.util.Vector; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; +import de.epiceric.shopchest.ShopChest; +import de.epiceric.shopchest.config.Config; +import de.epiceric.shopchest.event.ShopsLoadedEvent; +import de.epiceric.shopchest.shop.Shop; +import de.epiceric.shopchest.shop.Shop.ShopType; public class ShopUtils { diff --git a/src/main/java/de/epiceric/shopchest/utils/UpdateChecker.java b/src/main/java/de/epiceric/shopchest/utils/UpdateChecker.java index c713c37..96715aa 100644 --- a/src/main/java/de/epiceric/shopchest/utils/UpdateChecker.java +++ b/src/main/java/de/epiceric/shopchest/utils/UpdateChecker.java @@ -1,7 +1,5 @@ package de.epiceric.shopchest.utils; -import de.epiceric.shopchest.ShopChest; - import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; @@ -10,6 +8,8 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import de.epiceric.shopchest.ShopChest; + public class UpdateChecker { private ShopChest plugin;