diff --git a/src/main/java/com/songoda/ultimatekits/UltimateKits.java b/src/main/java/com/songoda/ultimatekits/UltimateKits.java index ff3c04b..22d9a63 100644 --- a/src/main/java/com/songoda/ultimatekits/UltimateKits.java +++ b/src/main/java/com/songoda/ultimatekits/UltimateKits.java @@ -26,8 +26,18 @@ import com.songoda.ultimatekits.handlers.DisplayItemHandler; import com.songoda.ultimatekits.handlers.ParticleHandler; import com.songoda.ultimatekits.key.Key; import com.songoda.ultimatekits.key.KeyManager; -import com.songoda.ultimatekits.kit.*; -import com.songoda.ultimatekits.listeners.*; +import com.songoda.ultimatekits.kit.Kit; +import com.songoda.ultimatekits.kit.KitAnimation; +import com.songoda.ultimatekits.kit.KitBlockData; +import com.songoda.ultimatekits.kit.KitItem; +import com.songoda.ultimatekits.kit.KitManager; +import com.songoda.ultimatekits.kit.KitType; +import com.songoda.ultimatekits.listeners.BlockListeners; +import com.songoda.ultimatekits.listeners.ChatListeners; +import com.songoda.ultimatekits.listeners.ChunkListeners; +import com.songoda.ultimatekits.listeners.EntityListeners; +import com.songoda.ultimatekits.listeners.InteractListeners; +import com.songoda.ultimatekits.listeners.PlayerListeners; import com.songoda.ultimatekits.settings.Settings; import com.songoda.ultimatekits.utils.ItemSerializer; import com.songoda.ultimatekits.utils.Methods; @@ -38,7 +48,11 @@ import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.plugin.PluginManager; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; import java.util.stream.Collectors; public class UltimateKits extends SongodaPlugin { diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandCategories.java b/src/main/java/com/songoda/ultimatekits/commands/CommandCategories.java index 4e3daea..96e09bd 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandCategories.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandCategories.java @@ -4,12 +4,9 @@ import com.songoda.core.commands.AbstractCommand; import com.songoda.core.gui.GuiManager; import com.songoda.ultimatekits.UltimateKits; import com.songoda.ultimatekits.gui.CategoryEditorGui; -import com.songoda.ultimatekits.gui.KitEditorGui; -import com.songoda.ultimatekits.kit.Kit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import java.util.Arrays; import java.util.List; public class CommandCategories extends AbstractCommand { @@ -24,7 +21,7 @@ public class CommandCategories extends AbstractCommand { @Override protected ReturnType runCommand(CommandSender sender, String... args) { - guiManager.showGUI((Player)sender, new CategoryEditorGui(plugin, (Player)sender)); + guiManager.showGUI((Player) sender, new CategoryEditorGui(plugin, (Player) sender)); return ReturnType.SUCCESS; } diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandKey.java b/src/main/java/com/songoda/ultimatekits/commands/CommandKey.java index 584e7d2..12658d2 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandKey.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandKey.java @@ -15,7 +15,7 @@ import java.util.Arrays; import java.util.List; public class CommandKey extends AbstractCommand { - + final UltimateKits instance = UltimateKits.getInstance(); public CommandKey() { diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandReload.java b/src/main/java/com/songoda/ultimatekits/commands/CommandReload.java index f85c023..1e4df6d 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandReload.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandReload.java @@ -10,6 +10,7 @@ import java.util.List; public class CommandReload extends AbstractCommand { final UltimateKits instance = UltimateKits.getInstance(); + public CommandReload() { super(false, "reload"); } diff --git a/src/main/java/com/songoda/ultimatekits/commands/CommandRemove.java b/src/main/java/com/songoda/ultimatekits/commands/CommandRemove.java index c3e56f1..5f02d52 100644 --- a/src/main/java/com/songoda/ultimatekits/commands/CommandRemove.java +++ b/src/main/java/com/songoda/ultimatekits/commands/CommandRemove.java @@ -14,6 +14,7 @@ import java.util.List; public class CommandRemove extends AbstractCommand { final UltimateKits instance = UltimateKits.getInstance(); + public CommandRemove() { super(true, "remove"); } diff --git a/src/main/java/com/songoda/ultimatekits/conversion/hooks/CMIHook.java b/src/main/java/com/songoda/ultimatekits/conversion/hooks/CMIHook.java index 27a217f..0ee9bca 100644 --- a/src/main/java/com/songoda/ultimatekits/conversion/hooks/CMIHook.java +++ b/src/main/java/com/songoda/ultimatekits/conversion/hooks/CMIHook.java @@ -5,12 +5,8 @@ import com.Zrips.CMI.Modules.Kits.Kit; import com.songoda.ultimatekits.UltimateKits; import com.songoda.ultimatekits.conversion.Hook; import com.songoda.ultimatekits.kit.type.KitContentCommand; -import org.bukkit.ChatColor; -import org.bukkit.Material; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import java.util.ArrayList; import java.util.HashSet; import java.util.Set; diff --git a/src/main/java/com/songoda/ultimatekits/conversion/hooks/DefaultHook.java b/src/main/java/com/songoda/ultimatekits/conversion/hooks/DefaultHook.java index 8cd2950..1483dc5 100644 --- a/src/main/java/com/songoda/ultimatekits/conversion/hooks/DefaultHook.java +++ b/src/main/java/com/songoda/ultimatekits/conversion/hooks/DefaultHook.java @@ -29,7 +29,7 @@ public class DefaultHook implements Hook { for (Kits kit : Kits.values()) { if (kit == Kits.BRIANNA_1_12 && ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13) || kit == Kits.BRIANNA_1_13 && !ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) continue; - kits.add(kit.name().toLowerCase().replace("_1_12", "").replace("_1_13", "")); + kits.add(kit.name().toLowerCase().replace("_1_12", "").replace("_1_13", "")); } return kits; diff --git a/src/main/java/com/songoda/ultimatekits/crate/CrateManager.java b/src/main/java/com/songoda/ultimatekits/crate/CrateManager.java index fabe0a4..59a1bc2 100644 --- a/src/main/java/com/songoda/ultimatekits/crate/CrateManager.java +++ b/src/main/java/com/songoda/ultimatekits/crate/CrateManager.java @@ -15,6 +15,7 @@ public class CrateManager { public boolean addCrate(Crate crate) { return crate != null && registeredCrates.add(crate); } + public Crate getCrate(String name) { for (Crate crate : registeredCrates) if (crate.getName().equalsIgnoreCase(name)) diff --git a/src/main/java/com/songoda/ultimatekits/database/DataManager.java b/src/main/java/com/songoda/ultimatekits/database/DataManager.java index 4b453ce..cc8a78d 100644 --- a/src/main/java/com/songoda/ultimatekits/database/DataManager.java +++ b/src/main/java/com/songoda/ultimatekits/database/DataManager.java @@ -75,7 +75,7 @@ public class DataManager extends DataManagerAbstract { public void createBlockData(KitBlockData blockData) { if (blockData.getWorld() == null) return; this.async(() -> this.databaseConnector.connect(connection -> { - String createData ="INSERT INTO " + this.getTablePrefix() + "blockdata (" + + String createData = "INSERT INTO " + this.getTablePrefix() + "blockdata (" + "type, kit, holograms, displayItems, particles, itemOverride, world, x, y, z)" + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; try (PreparedStatement statement = connection.prepareStatement(createData)) { diff --git a/src/main/java/com/songoda/ultimatekits/database/migrations/_2_DuplicateMigration.java b/src/main/java/com/songoda/ultimatekits/database/migrations/_2_DuplicateMigration.java index df14cdc..0fb4ce8 100644 --- a/src/main/java/com/songoda/ultimatekits/database/migrations/_2_DuplicateMigration.java +++ b/src/main/java/com/songoda/ultimatekits/database/migrations/_2_DuplicateMigration.java @@ -1,6 +1,7 @@ package com.songoda.ultimatekits.database.migrations; import com.songoda.core.database.DataMigration; + import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -11,6 +12,7 @@ import java.util.HashMap; public class _2_DuplicateMigration extends DataMigration { final boolean sqlite; + public _2_DuplicateMigration(boolean sqlite) { super(2); this.sqlite = sqlite; @@ -19,7 +21,7 @@ public class _2_DuplicateMigration extends DataMigration { @Override public void migrate(Connection connection, String tablePrefix) throws SQLException { // Fix duplicate data caused by old sqlite data duplication bug - if(sqlite) { + if (sqlite) { HashMap data = new HashMap(); // grab a copy of the unique data values try (Statement statement = connection.createStatement()) { @@ -30,7 +32,7 @@ public class _2_DuplicateMigration extends DataMigration { int y = allData.getInt("y"); int z = allData.getInt("z"); String key = world + ";" + x + ";" + y + ";" + z + ";"; - if(!data.containsKey(key)) { + if (!data.containsKey(key)) { data.put(key, new TempKitData( allData.getString("type"), allData.getString("kit"), @@ -44,7 +46,7 @@ public class _2_DuplicateMigration extends DataMigration { } allData.close(); } - if(data.isEmpty()) return; + if (data.isEmpty()) return; connection.setAutoCommit(false); // first delete old data try (Statement statement = connection.createStatement()) { @@ -54,7 +56,7 @@ public class _2_DuplicateMigration extends DataMigration { try (PreparedStatement statement = connection.prepareStatement("INSERT INTO " + tablePrefix + "blockdata (" + "type, kit, holograms, displayItems, particles, itemOverride, world, x, y, z)" + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { - for(TempKitData blockData : data.values()) { + for (TempKitData blockData : data.values()) { statement.setString(1, blockData.type); statement.setString(2, blockData.kit); statement.setBoolean(3, blockData.holograms); @@ -77,7 +79,7 @@ public class _2_DuplicateMigration extends DataMigration { } } } - + static class TempKitData { final String type, kit, world; final int x, y, z; diff --git a/src/main/java/com/songoda/ultimatekits/gui/AnimatedKitGui.java b/src/main/java/com/songoda/ultimatekits/gui/AnimatedKitGui.java index 331ca1f..21ba352 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/AnimatedKitGui.java +++ b/src/main/java/com/songoda/ultimatekits/gui/AnimatedKitGui.java @@ -9,16 +9,17 @@ import com.songoda.ultimatekits.kit.Kit; import com.songoda.ultimatekits.kit.KitItem; import com.songoda.ultimatekits.settings.Settings; import com.songoda.ultimatekits.utils.ArmorType; +import org.apache.commons.lang.WordUtils; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + import java.util.ArrayDeque; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Random; -import org.apache.commons.lang.WordUtils; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; public class AnimatedKitGui extends Gui { @@ -48,7 +49,7 @@ public class AnimatedKitGui extends Gui { // ideally, we'd populate the items in such a way that the end item isn't far from the center when the animation is complete // would be something to do if people have large kit loot tables. List kitItems = kit.getContents(); - if(kitItems.isEmpty()) { + if (kitItems.isEmpty()) { throw new RuntimeException("Cannot give an empty kit!"); } Collections.shuffle(kitItems); @@ -56,7 +57,7 @@ public class AnimatedKitGui extends Gui { while (this.items.size() < 10) { items.addAll(kitItems); } - + setItem(4, GuiUtils.getBorderItem(CompatibleMaterial.TRIPWIRE_HOOK)); setItem(22, GuiUtils.getBorderItem(CompatibleMaterial.TRIPWIRE_HOOK)); tick(); @@ -79,7 +80,7 @@ public class AnimatedKitGui extends Gui { // now update the display // rainbow disco! for (int col = 0; col < 9; ++col) { - if(col == 4) continue; + if (col == 4) continue; setItem(0, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16)))); setItem(2, col, GuiUtils.getBorderItem(CompatibleMaterial.getGlassPaneColor(rand.nextInt(16)))); } @@ -90,7 +91,7 @@ public class AnimatedKitGui extends Gui { items.addFirst(items.getLast()); items.removeLast(); Iterator itemIter = items.iterator(); - for (int i = 9; i < 18; i++) { + for (int i = 9; i < 18; i++) { setItem(0, i, itemIter.next().getItem()); } } @@ -99,7 +100,7 @@ public class AnimatedKitGui extends Gui { if (finish) { ItemStack item = getItem(13); KitItem kitItem = items.stream().filter(i -> i.getItem().isSimilar(item)).findFirst().orElse(null); - if(item == null) { + if (item == null) { done = true; // idk. } else if (item.isSimilar(give)) { if (!done) { @@ -127,6 +128,7 @@ public class AnimatedKitGui extends Gui { } } + private void finish() { Bukkit.getScheduler().cancelTask(task); exit(); diff --git a/src/main/java/com/songoda/ultimatekits/gui/BlockEditorGui.java b/src/main/java/com/songoda/ultimatekits/gui/BlockEditorGui.java index 0462e89..db95063 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/BlockEditorGui.java +++ b/src/main/java/com/songoda/ultimatekits/gui/BlockEditorGui.java @@ -10,6 +10,7 @@ import com.songoda.ultimatekits.settings.Settings; import com.songoda.ultimatekits.utils.Methods; import org.bukkit.ChatColor; import org.bukkit.event.inventory.ClickType; + import java.util.Arrays; import java.util.List; diff --git a/src/main/java/com/songoda/ultimatekits/gui/CategorySelectorGui.java b/src/main/java/com/songoda/ultimatekits/gui/CategorySelectorGui.java index f9ff58d..cf6eecc 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/CategorySelectorGui.java +++ b/src/main/java/com/songoda/ultimatekits/gui/CategorySelectorGui.java @@ -13,7 +13,9 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.util.*; +import java.util.LinkedHashSet; +import java.util.Random; +import java.util.Set; public class CategorySelectorGui extends Gui { diff --git a/src/main/java/com/songoda/ultimatekits/gui/KitDecorOptionsGui.java b/src/main/java/com/songoda/ultimatekits/gui/KitDecorOptionsGui.java index e1649e7..407a3e7 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/KitDecorOptionsGui.java +++ b/src/main/java/com/songoda/ultimatekits/gui/KitDecorOptionsGui.java @@ -10,6 +10,7 @@ import com.songoda.ultimatekits.kit.KitBlockData; import com.songoda.ultimatekits.settings.Settings; import com.songoda.ultimatekits.utils.Methods; import org.bukkit.event.inventory.ClickType; + import java.util.Random; public class KitDecorOptionsGui extends Gui { @@ -77,8 +78,8 @@ public class KitDecorOptionsGui extends Gui { setButton(1, 7, GuiUtils.createButtonItem(kit.getDisplayItem() != null ? kit.getDisplayItem() : CompatibleMaterial.BEACON, plugin.getLocale().getMessage("interface.kitdecor.displayone").getMessage(), plugin.getLocale().getMessage("interface.kitdecor.displayonelore") - .processPlaceholder("enabled", kitBlockData.isItemOverride() ? enableLore : disableLore) - .getMessage().split("\\|")), + .processPlaceholder("enabled", kitBlockData.isItemOverride() ? enableLore : disableLore) + .getMessage().split("\\|")), event -> { kitBlockData.setItemOverride(!kitBlockData.isItemOverride()); updateItemLore(event.slot, kitBlockData.isItemOverride() ? enableLore : disableLore); diff --git a/src/main/java/com/songoda/ultimatekits/gui/KitEditorGui.java b/src/main/java/com/songoda/ultimatekits/gui/KitEditorGui.java index dae5fcd..ef1e069 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/KitEditorGui.java +++ b/src/main/java/com/songoda/ultimatekits/gui/KitEditorGui.java @@ -424,7 +424,7 @@ public class KitEditorGui extends DoubleGui { else itemLore = new ArrayList<>(); itemLore.add(TextUtils.formatText("&8----")); itemLore.add(ChatColor.GRAY.toString() + plugin.getLocale().getMessage("general.type.chance").getMessage().replaceFirst("^" + ChatColor.RESET.toString(), "") - + ": " + ChatColor.GOLD.toString() + item.getChance() + "%"); //TODO use a placeholder message in locales + + ": " + ChatColor.GOLD.toString() + item.getChance() + "%"); //TODO use a placeholder message in locales if (isInFunction) { itemLore.addAll(Arrays.asList(plugin.getLocale().getMessage("interface.kiteditor.itemfunctionlore") .processPlaceholder("item", item.getDisplayItem() == null ? "" : item.getDisplayItem().name()) diff --git a/src/main/java/com/songoda/ultimatekits/gui/KitGeneralOptionsGui.java b/src/main/java/com/songoda/ultimatekits/gui/KitGeneralOptionsGui.java index fc6b4f2..0d28e44 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/KitGeneralOptionsGui.java +++ b/src/main/java/com/songoda/ultimatekits/gui/KitGeneralOptionsGui.java @@ -85,7 +85,7 @@ public class KitGeneralOptionsGui extends Gui { } else if (event.clickType == ClickType.RIGHT) { kit.setCategory(null); updateItemLore(event.slot, plugin.getLocale().getMessage("interface.kitoptions.categorylore") - .processPlaceholder("category", kit.getCategory() == null ? "none" : kit.getCategory().getName()).getMessage().split("\\|")); + .processPlaceholder("category", kit.getCategory() == null ? "none" : kit.getCategory().getName()).getMessage().split("\\|")); } }); diff --git a/src/main/java/com/songoda/ultimatekits/gui/KitSelectorGui.java b/src/main/java/com/songoda/ultimatekits/gui/KitSelectorGui.java index 07d7a75..e1891cb 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/KitSelectorGui.java +++ b/src/main/java/com/songoda/ultimatekits/gui/KitSelectorGui.java @@ -144,7 +144,7 @@ public class KitSelectorGui extends Gui { .processPlaceholder("kit", TextUtils.formatText(kitItem, true)).getMessage(); setButton(row, col, GuiUtils.createButtonItem( - kit.getDisplayItem() != null ? kit.getDisplayItem() : CompatibleMaterial.ENCHANTED_BOOK,kitTitle, + kit.getDisplayItem() != null ? kit.getDisplayItem() : CompatibleMaterial.ENCHANTED_BOOK, kitTitle, getKitLore(kit)), event -> { if (event.clickType == ClickType.MIDDLE && player.hasPermission("ultimatekits.admin")) { diff --git a/src/main/java/com/songoda/ultimatekits/gui/KitSellingOptionsGui.java b/src/main/java/com/songoda/ultimatekits/gui/KitSellingOptionsGui.java index b0d4277..1a3df5f 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/KitSellingOptionsGui.java +++ b/src/main/java/com/songoda/ultimatekits/gui/KitSellingOptionsGui.java @@ -51,9 +51,9 @@ public class KitSellingOptionsGui extends Gui { setButton(1, 2, GuiUtils.createButtonItem(CompatibleMaterial.BARRIER, plugin.getLocale().getMessage("interface.kitsell.nosell").getMessage(), plugin.getLocale().getMessage("interface.kitsell.noselllore") - .processPlaceholder("onoff", plugin.getLocale().getMessage( + .processPlaceholder("onoff", plugin.getLocale().getMessage( kit.getPrice() != 0 || kit.getLink() != null ? "interface.kitsell.nosellon" : "interface.kitsell.noselloff").getMessage() - ).getMessage().split("\\|")), + ).getMessage().split("\\|")), event -> { kit.setPrice(0); kit.setLink(null); @@ -64,10 +64,10 @@ public class KitSellingOptionsGui extends Gui { setButton(1, 4, GuiUtils.createButtonItem(CompatibleMaterial.PAPER, plugin.getLocale().getMessage("interface.kitsell.link").getMessage(), plugin.getLocale().getMessage("interface.kitsell.linklore") - .processPlaceholder("onoff", - kit.getLink() != null ? plugin.getLocale().getMessage("interface.kitsell.linkon").processPlaceholder("kit", kit.getLink()).getMessage() - : plugin.getLocale().getMessage("interface.kitsell.linkoff").getMessage() - ).getMessage().split("\\|")), + .processPlaceholder("onoff", + kit.getLink() != null ? plugin.getLocale().getMessage("interface.kitsell.linkon").processPlaceholder("kit", kit.getLink()).getMessage() + : plugin.getLocale().getMessage("interface.kitsell.linkoff").getMessage() + ).getMessage().split("\\|")), event -> { AnvilGui gui = new AnvilGui(event.player, this); gui.setTitle(plugin.getLocale().getMessage("interface.kitsell.linkprompt").getMessage()); @@ -89,11 +89,11 @@ public class KitSellingOptionsGui extends Gui { setButton(1, 6, GuiUtils.createButtonItem(CompatibleMaterial.SUNFLOWER, plugin.getLocale().getMessage("interface.kitsell.price").getMessage(), plugin.getLocale().getMessage("interface.kitsell.pricelore") - .processPlaceholder("onoff", - kit.getPrice() != 0 ? plugin.getLocale().getMessage("interface.kitsell.priceon") - .processPlaceholder("price", kit.getPrice()).getMessage() - : plugin.getLocale().getMessage("interface.kitsell.priceoff").getMessage() - ).getMessage().split("\\|")), + .processPlaceholder("onoff", + kit.getPrice() != 0 ? plugin.getLocale().getMessage("interface.kitsell.priceon") + .processPlaceholder("price", kit.getPrice()).getMessage() + : plugin.getLocale().getMessage("interface.kitsell.priceoff").getMessage() + ).getMessage().split("\\|")), event -> { if (!EconomyManager.isEnabled()) { plugin.getLocale().getMessage("interface.kitsell.pricenoeco").sendPrefixedMessage(event.player); @@ -104,10 +104,10 @@ public class KitSellingOptionsGui extends Gui { gui.setAction(aevent -> { final String msg = gui.getInputText().trim(); double d = 0; - try { - d = Double.parseDouble(msg); - } catch (NumberFormatException e) { - } + try { + d = Double.parseDouble(msg); + } catch (NumberFormatException e) { + } if (d <= 0) { plugin.getLocale().getMessage("interface.kitsell.pricenonumber").processPlaceholder("input", msg).sendPrefixedMessage(player); } else { diff --git a/src/main/java/com/songoda/ultimatekits/gui/PreviewKitGui.java b/src/main/java/com/songoda/ultimatekits/gui/PreviewKitGui.java index fca5689..6646fc3 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/PreviewKitGui.java +++ b/src/main/java/com/songoda/ultimatekits/gui/PreviewKitGui.java @@ -14,6 +14,7 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; diff --git a/src/main/java/com/songoda/ultimatekits/handlers/DisplayItemHandler.java b/src/main/java/com/songoda/ultimatekits/handlers/DisplayItemHandler.java index 569d5e4..ea933de 100644 --- a/src/main/java/com/songoda/ultimatekits/handlers/DisplayItemHandler.java +++ b/src/main/java/com/songoda/ultimatekits/handlers/DisplayItemHandler.java @@ -2,12 +2,10 @@ package com.songoda.ultimatekits.handlers; import com.songoda.core.nms.NmsManager; import com.songoda.core.nms.nbt.NBTItem; -import com.songoda.core.utils.TextUtils; import com.songoda.ultimatekits.UltimateKits; import com.songoda.ultimatekits.kit.Kit; import com.songoda.ultimatekits.kit.KitBlockData; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; diff --git a/src/main/java/com/songoda/ultimatekits/kit/Kit.java b/src/main/java/com/songoda/ultimatekits/kit/Kit.java index cfa1bf6..044bdd9 100644 --- a/src/main/java/com/songoda/ultimatekits/kit/Kit.java +++ b/src/main/java/com/songoda/ultimatekits/kit/Kit.java @@ -20,7 +20,6 @@ import com.songoda.ultimatekits.gui.PreviewKitGui; import com.songoda.ultimatekits.key.Key; import com.songoda.ultimatekits.kit.type.KitContentCommand; import com.songoda.ultimatekits.kit.type.KitContentEconomy; -import com.songoda.ultimatekits.kit.type.KitContentItem; import com.songoda.ultimatekits.settings.Settings; import com.songoda.ultimatekits.utils.ArmorType; import com.songoda.ultimatekits.utils.Methods; @@ -31,7 +30,11 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; /** * Created by songoda on 2/24/2017. @@ -293,10 +296,11 @@ public class Kit { int kitSize = innerContents.size(); // Amount of items from the kit to give to the player. - if (kitAnimation == KitAnimation.ROULETTE) itemAmount = 1; //TODO how about kitAmount > 1? generateRandomItem() will only give 1 random item instead of kitAmount + if (kitAnimation == KitAnimation.ROULETTE) + itemAmount = 1; //TODO how about kitAmount > 1? generateRandomItem() will only give 1 random item instead of kitAmount int itemGiveAmount = itemAmount > 0 ? itemAmount : kitSize; if (kitAmount > 0) itemGiveAmount = itemGiveAmount * kitAmount; - + if (Settings.NO_REDEEM_WHEN_FULL.getBoolean() && !hasRoom(player, itemGiveAmount)) { plugin.getLocale().getMessage("event.claim.full").sendPrefixedMessage(player); return false; diff --git a/src/main/java/com/songoda/ultimatekits/kit/KitItem.java b/src/main/java/com/songoda/ultimatekits/kit/KitItem.java index 431a148..8e779a8 100644 --- a/src/main/java/com/songoda/ultimatekits/kit/KitItem.java +++ b/src/main/java/com/songoda/ultimatekits/kit/KitItem.java @@ -9,13 +9,15 @@ import com.songoda.ultimatekits.kit.type.KitContentCommand; import com.songoda.ultimatekits.kit.type.KitContentEconomy; import com.songoda.ultimatekits.kit.type.KitContentItem; import com.songoda.ultimatekits.settings.Settings; -import org.apache.commons.lang.WordUtils; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import java.util.*; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class KitItem { @@ -106,6 +108,7 @@ public class KitItem { nbtItem.set("display-lore", displayLore); return nbtItem.finish(); } + private String compileOptionsText() { String line = ""; if (chance != 0) diff --git a/src/main/java/com/songoda/ultimatekits/kit/KitManager.java b/src/main/java/com/songoda/ultimatekits/kit/KitManager.java index d726def..75bd4dc 100644 --- a/src/main/java/com/songoda/ultimatekits/kit/KitManager.java +++ b/src/main/java/com/songoda/ultimatekits/kit/KitManager.java @@ -3,7 +3,12 @@ package com.songoda.ultimatekits.kit; import com.songoda.ultimatekits.UltimateKits; import org.bukkit.Location; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; public final class KitManager { diff --git a/src/main/java/com/songoda/ultimatekits/kit/type/KitContentCommand.java b/src/main/java/com/songoda/ultimatekits/kit/type/KitContentCommand.java index 2b5c5e6..dc60802 100644 --- a/src/main/java/com/songoda/ultimatekits/kit/type/KitContentCommand.java +++ b/src/main/java/com/songoda/ultimatekits/kit/type/KitContentCommand.java @@ -2,13 +2,13 @@ package com.songoda.ultimatekits.kit.type; import com.songoda.ultimatekits.UltimateKits; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import java.util.ArrayList; -import org.bukkit.ChatColor; public class KitContentCommand implements KitContent { diff --git a/src/main/java/com/songoda/ultimatekits/kit/type/KitContentEconomy.java b/src/main/java/com/songoda/ultimatekits/kit/type/KitContentEconomy.java index 00a9129..80d0bd9 100644 --- a/src/main/java/com/songoda/ultimatekits/kit/type/KitContentEconomy.java +++ b/src/main/java/com/songoda/ultimatekits/kit/type/KitContentEconomy.java @@ -3,13 +3,13 @@ package com.songoda.ultimatekits.kit.type; import com.songoda.core.hooks.EconomyManager; import com.songoda.ultimatekits.UltimateKits; import com.songoda.ultimatekits.utils.Methods; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import java.util.ArrayList; -import org.bukkit.ChatColor; public class KitContentEconomy implements KitContent { diff --git a/src/main/java/com/songoda/ultimatekits/listeners/ChunkListeners.java b/src/main/java/com/songoda/ultimatekits/listeners/ChunkListeners.java index 711bca2..bd74f51 100644 --- a/src/main/java/com/songoda/ultimatekits/listeners/ChunkListeners.java +++ b/src/main/java/com/songoda/ultimatekits/listeners/ChunkListeners.java @@ -1,19 +1,10 @@ package com.songoda.ultimatekits.listeners; import com.songoda.ultimatekits.UltimateKits; -import com.songoda.ultimatekits.key.Key; -import com.songoda.ultimatekits.kit.Kit; -import com.songoda.ultimatekits.kit.KitBlockData; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.block.Block; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.world.ChunkLoadEvent; -import org.bukkit.inventory.ItemStack; /** * Created by songoda on 2/24/2017. @@ -30,8 +21,8 @@ public class ChunkListeners implements Listener { public void onChunkLoad(ChunkLoadEvent event) { instance.getKitManager().getKitLocations().values().stream() .filter(l -> l.getLocation().getWorld() == event.getWorld() - && l.getLocation().getBlockX() >> 4 == event.getChunk().getX() - && l.getLocation().getBlockZ() >> 4 == event.getChunk().getZ()) + && l.getLocation().getBlockX() >> 4 == event.getChunk().getX() + && l.getLocation().getBlockZ() >> 4 == event.getChunk().getZ()) .forEach(instance::updateHologram); } } diff --git a/src/main/java/com/songoda/ultimatekits/listeners/EntityListeners.java b/src/main/java/com/songoda/ultimatekits/listeners/EntityListeners.java index a3cec9f..0c4b6d5 100644 --- a/src/main/java/com/songoda/ultimatekits/listeners/EntityListeners.java +++ b/src/main/java/com/songoda/ultimatekits/listeners/EntityListeners.java @@ -21,35 +21,35 @@ public class EntityListeners implements Listener { @EventHandler(priority = EventPriority.LOWEST) public void onPlayerEntityInteract(EntityDamageEvent event) { - if (event.getEntity().getType() != EntityType.ARMOR_STAND || instance.getConfig().getString("data.hologramHandler") == null) { - return; - } - ConfigurationSection section = instance.getConfig().getConfigurationSection("data.hologramHandler"); - for (String loc : section.getKeys(false)) { - String str[] = loc.split(":"); - World world = Bukkit.getServer().getWorld(str[1].substring(0, str[1].length() - 1)); - double x = Double.parseDouble(str[2].substring(0, str[2].length() - 1)) + .5; - double z = Double.parseDouble(str[4]) + .5; - if (world == event.getEntity().getLocation().getWorld() && x == event.getEntity().getLocation().getX() && z == event.getEntity().getLocation().getZ()) { - event.setCancelled(true); - } + if (event.getEntity().getType() != EntityType.ARMOR_STAND || instance.getConfig().getString("data.hologramHandler") == null) { + return; + } + ConfigurationSection section = instance.getConfig().getConfigurationSection("data.hologramHandler"); + for (String loc : section.getKeys(false)) { + String str[] = loc.split(":"); + World world = Bukkit.getServer().getWorld(str[1].substring(0, str[1].length() - 1)); + double x = Double.parseDouble(str[2].substring(0, str[2].length() - 1)) + .5; + double z = Double.parseDouble(str[4]) + .5; + if (world == event.getEntity().getLocation().getWorld() && x == event.getEntity().getLocation().getX() && z == event.getEntity().getLocation().getZ()) { + event.setCancelled(true); } + } } @EventHandler public void onPlayerEntityInteract(PlayerInteractAtEntityEvent event) { - if (event.getRightClicked().getType() != EntityType.ARMOR_STAND || instance.getConfig().getString("data.hologramHandler") == null) { - return; - } - ConfigurationSection section = instance.getConfig().getConfigurationSection("data.hologramHandler"); - for (String loc : section.getKeys(false)) { - String str[] = loc.split(":"); - World w = Bukkit.getServer().getWorld(str[1].substring(0, str[1].length() - 1)); - double x = Double.parseDouble(str[2].substring(0, str[2].length() - 1)) + .5; - double z = Double.parseDouble(str[4]) + .5; - if (w == event.getRightClicked().getLocation().getWorld() && x == event.getRightClicked().getLocation().getX() && z == event.getRightClicked().getLocation().getZ()) { - event.setCancelled(true); - } + if (event.getRightClicked().getType() != EntityType.ARMOR_STAND || instance.getConfig().getString("data.hologramHandler") == null) { + return; + } + ConfigurationSection section = instance.getConfig().getConfigurationSection("data.hologramHandler"); + for (String loc : section.getKeys(false)) { + String str[] = loc.split(":"); + World w = Bukkit.getServer().getWorld(str[1].substring(0, str[1].length() - 1)); + double x = Double.parseDouble(str[2].substring(0, str[2].length() - 1)) + .5; + double z = Double.parseDouble(str[4]) + .5; + if (w == event.getRightClicked().getLocation().getWorld() && x == event.getRightClicked().getLocation().getX() && z == event.getRightClicked().getLocation().getZ()) { + event.setCancelled(true); } + } } } diff --git a/src/main/java/com/songoda/ultimatekits/settings/Settings.java b/src/main/java/com/songoda/ultimatekits/settings/Settings.java index 8b8346f..876671d 100644 --- a/src/main/java/com/songoda/ultimatekits/settings/Settings.java +++ b/src/main/java/com/songoda/ultimatekits/settings/Settings.java @@ -51,7 +51,7 @@ public class Settings { public static final ConfigSetting PARTICLE_AMOUNT = new ConfigSetting(config, "data.particlesettings.amount", 25); public static final ConfigSetting PARTICLE_TYPE = new ConfigSetting(config, "data.particlesettings.type", "SPELL_WITCH"); - + /** * In order to set dynamic economy comment correctly, this needs to be * called after EconomyManager load @@ -59,7 +59,7 @@ public class Settings { public static void setupConfig() { config .setDefaultComment("Main", "General settings and options.") - .setDefaultComment("Interfaces", + .setDefaultComment("Interfaces", "These settings allow you to alter the way interfaces look.", "They are used in GUI's to make patterns, change them up then open up a", "# GUI to see how it works.") diff --git a/src/main/java/com/songoda/ultimatekits/utils/ArmorType.java b/src/main/java/com/songoda/ultimatekits/utils/ArmorType.java index 72167d8..cafa5f2 100644 --- a/src/main/java/com/songoda/ultimatekits/utils/ArmorType.java +++ b/src/main/java/com/songoda/ultimatekits/utils/ArmorType.java @@ -1,10 +1,7 @@ package com.songoda.ultimatekits.utils; -import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; -import org.bukkit.event.inventory.InventoryType; -import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; public enum ArmorType { @@ -75,26 +72,27 @@ public enum ArmorType { try { ArmorType type = ArmorType.valueOf(item.getType().toString()); - boolean equipped = false; + boolean equipped = false; - if ((type.isHelmet() && player.getInventory().getHelmet() == null) - || (type.isChestplate() && player.getInventory().getChestplate() == null) - || (type.isLeggings() && player.getInventory().getLeggings() == null) - || (type.isBoots() && player.getInventory().getBoots() == null) - || (type.isOffHand() && player.getInventory().getItemInOffHand().getType() == Material.AIR)) equipped = true; + if ((type.isHelmet() && player.getInventory().getHelmet() == null) + || (type.isChestplate() && player.getInventory().getChestplate() == null) + || (type.isLeggings() && player.getInventory().getLeggings() == null) + || (type.isBoots() && player.getInventory().getBoots() == null) + || (type.isOffHand() && player.getInventory().getItemInOffHand().getType() == Material.AIR)) + equipped = true; - if (type.isHelmet() && player.getInventory().getHelmet() == null) - player.getInventory().setHelmet(item); - if (type.isChestplate() && player.getInventory().getChestplate() == null) - player.getInventory().setChestplate(item); - if (type.isLeggings() && player.getInventory().getLeggings() == null) - player.getInventory().setLeggings(item); - if (type.isBoots() && player.getInventory().getBoots() == null) - player.getInventory().setBoots(item); - if (type.isOffHand() && player.getInventory().getItemInOffHand().getType() == Material.AIR) - player.getInventory().setItemInOffHand(item); + if (type.isHelmet() && player.getInventory().getHelmet() == null) + player.getInventory().setHelmet(item); + if (type.isChestplate() && player.getInventory().getChestplate() == null) + player.getInventory().setChestplate(item); + if (type.isLeggings() && player.getInventory().getLeggings() == null) + player.getInventory().setLeggings(item); + if (type.isBoots() && player.getInventory().getBoots() == null) + player.getInventory().setBoots(item); + if (type.isOffHand() && player.getInventory().getItemInOffHand().getType() == Material.AIR) + player.getInventory().setItemInOffHand(item); - return equipped; + return equipped; } catch (IllegalArgumentException e) { return false; diff --git a/src/main/java/com/songoda/ultimatekits/utils/ItemSerializer.java b/src/main/java/com/songoda/ultimatekits/utils/ItemSerializer.java index bccf556..eb6aaa3 100644 --- a/src/main/java/com/songoda/ultimatekits/utils/ItemSerializer.java +++ b/src/main/java/com/songoda/ultimatekits/utils/ItemSerializer.java @@ -9,102 +9,102 @@ import java.lang.reflect.Method; public class ItemSerializer { - // classes needed for reflections + // classes needed for reflections - private Class classMojangsonParser = Class.forName(formatNMS("net.minecraft.server.NMS.MojangsonParser")); - private Class classItemStack = Class.forName(formatNMS("net.minecraft.server.NMS.ItemStack")); - private Class classCraftItemStack = Class.forName(formatNMS("org.bukkit.craftbukkit.NMS.inventory.CraftItemStack")); - private Class classNBTTagCompound = Class.forName(formatNMS("net.minecraft.server.NMS.NBTTagCompound")); - private Class classBukkitItemStack = Class.forName("org.bukkit.inventory.ItemStack"); + private Class classMojangsonParser = Class.forName(formatNMS("net.minecraft.server.NMS.MojangsonParser")); + private Class classItemStack = Class.forName(formatNMS("net.minecraft.server.NMS.ItemStack")); + private Class classCraftItemStack = Class.forName(formatNMS("org.bukkit.craftbukkit.NMS.inventory.CraftItemStack")); + private Class classNBTTagCompound = Class.forName(formatNMS("net.minecraft.server.NMS.NBTTagCompound")); + private Class classBukkitItemStack = Class.forName("org.bukkit.inventory.ItemStack"); - private Constructor constructorItemStack; + private Constructor constructorItemStack; - // reflected methods + // reflected methods - private Method methodParseString; - private Method methodCreateStack; - private Method methodToItemStack; - private Method methodTobItemStack; - private Method methodTocItemStack; - private Method methodSaveTagToStack; - private Method methodToString; + private Method methodParseString; + private Method methodCreateStack; + private Method methodToItemStack; + private Method methodTobItemStack; + private Method methodTocItemStack; + private Method methodSaveTagToStack; + private Method methodToString; - /** - * Initializes all reflection methods - * - * @throws NoSuchMethodException - * @throws SecurityException - * @throws ClassNotFoundException - */ - public ItemSerializer() throws NoSuchMethodException, SecurityException, ClassNotFoundException { - methodParseString = classMojangsonParser.getMethod("parse", String.class); - if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) - methodToItemStack = classItemStack.getMethod("a", classNBTTagCompound); - else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) - constructorItemStack = classItemStack.getConstructor(classNBTTagCompound); - else - methodCreateStack = classItemStack.getMethod("createStack", classNBTTagCompound); - methodTobItemStack = classCraftItemStack.getMethod("asBukkitCopy", classItemStack); + /** + * Initializes all reflection methods + * + * @throws NoSuchMethodException + * @throws SecurityException + * @throws ClassNotFoundException + */ + public ItemSerializer() throws NoSuchMethodException, SecurityException, ClassNotFoundException { + methodParseString = classMojangsonParser.getMethod("parse", String.class); + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) + methodToItemStack = classItemStack.getMethod("a", classNBTTagCompound); + else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) + constructorItemStack = classItemStack.getConstructor(classNBTTagCompound); + else + methodCreateStack = classItemStack.getMethod("createStack", classNBTTagCompound); + methodTobItemStack = classCraftItemStack.getMethod("asBukkitCopy", classItemStack); - methodTocItemStack = classCraftItemStack.getDeclaredMethod("asNMSCopy", classBukkitItemStack); - methodSaveTagToStack = classItemStack.getMethod("save", classNBTTagCompound); - methodToString = classNBTTagCompound.getMethod("toString"); - } + methodTocItemStack = classCraftItemStack.getDeclaredMethod("asNMSCopy", classBukkitItemStack); + methodSaveTagToStack = classItemStack.getMethod("save", classNBTTagCompound); + methodToString = classNBTTagCompound.getMethod("toString"); + } - /** - * Inserts the version declaration for any string containing NMS - * - * @param s the string to format, must contain NMS. - * @return formatted string - */ - private String formatNMS(String s) { - String packageName = Bukkit.getServer().getClass().getPackage().getName(); - String nmsVersion = packageName.substring(packageName.lastIndexOf('.') + 1); - return s.replace("NMS", nmsVersion); - } + /** + * Inserts the version declaration for any string containing NMS + * + * @param s the string to format, must contain NMS. + * @return formatted string + */ + private String formatNMS(String s) { + String packageName = Bukkit.getServer().getClass().getPackage().getName(); + String nmsVersion = packageName.substring(packageName.lastIndexOf('.') + 1); + return s.replace("NMS", nmsVersion); + } - /** - * Deserializes a JSON String - * - * @param jsonString the JSON String to parse - * @return the deserialized ItemStack - */ - public ItemStack deserializeItemStackFromJson(String jsonString) { - try { - Object nbtTagCompound = methodParseString.invoke(null, jsonString); - Object citemStack; + /** + * Deserializes a JSON String + * + * @param jsonString the JSON String to parse + * @return the deserialized ItemStack + */ + public ItemStack deserializeItemStackFromJson(String jsonString) { + try { + Object nbtTagCompound = methodParseString.invoke(null, jsonString); + Object citemStack; - if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) - citemStack = methodToItemStack.invoke(null, nbtTagCompound); - else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) - citemStack = constructorItemStack.newInstance(nbtTagCompound); - else - citemStack = methodCreateStack.invoke(null, nbtTagCompound); + if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) + citemStack = methodToItemStack.invoke(null, nbtTagCompound); + else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_11)) + citemStack = constructorItemStack.newInstance(nbtTagCompound); + else + citemStack = methodCreateStack.invoke(null, nbtTagCompound); - return (ItemStack) methodTobItemStack.invoke(null, citemStack); - } catch (Exception ex) { - ex.printStackTrace(); - return null; - } - } + return (ItemStack) methodTobItemStack.invoke(null, citemStack); + } catch (Exception ex) { + ex.printStackTrace(); + return null; + } + } - /** - * Serializes an item stack - * - * @param itemStack the ItemStack to parse - * @return condensed JSON String - */ - public String serializeItemStackToJson(ItemStack itemStack) { - try { - Object citemStack = methodTocItemStack.invoke(null, itemStack); - Object nbtTagCompoundObject = classNBTTagCompound.newInstance(); + /** + * Serializes an item stack + * + * @param itemStack the ItemStack to parse + * @return condensed JSON String + */ + public String serializeItemStackToJson(ItemStack itemStack) { + try { + Object citemStack = methodTocItemStack.invoke(null, itemStack); + Object nbtTagCompoundObject = classNBTTagCompound.newInstance(); - methodSaveTagToStack.invoke(citemStack, nbtTagCompoundObject); + methodSaveTagToStack.invoke(citemStack, nbtTagCompoundObject); - return (String) methodToString.invoke(nbtTagCompoundObject); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } + return (String) methodToString.invoke(nbtTagCompoundObject); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } } \ No newline at end of file diff --git a/src/main/java/com/songoda/ultimatekits/utils/Methods.java b/src/main/java/com/songoda/ultimatekits/utils/Methods.java index ab7cce1..27d3808 100644 --- a/src/main/java/com/songoda/ultimatekits/utils/Methods.java +++ b/src/main/java/com/songoda/ultimatekits/utils/Methods.java @@ -1,11 +1,16 @@ package com.songoda.ultimatekits.utils; import com.songoda.core.compatibility.CompatibleMaterial; -import com.songoda.core.compatibility.ServerVersion; import com.songoda.core.gui.Gui; import com.songoda.core.gui.GuiUtils; -import com.songoda.ultimatekits.UltimateKits; import com.songoda.ultimatekits.settings.Settings; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + import java.text.DecimalFormat; import java.util.Arrays; import java.util.HashMap; @@ -13,12 +18,6 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.concurrent.TimeUnit; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; /** * Created by songoda on 2/24/2017.