diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 296c22c..b9eeb94 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: variables: name: "EpicHeads" path: "/builds/$CI_PROJECT_PATH" - version: "3.2.0" + version: "3.2.3" build: stage: build diff --git a/pom.xml b/pom.xml index 0935719..9827931 100644 --- a/pom.xml +++ b/pom.xml @@ -78,8 +78,8 @@ org.spigotmc - spigot-api - 1.14.4-R0.1-SNAPSHOT + spigot + 1.14.4 provided diff --git a/src/main/java/com/songoda/epicheads/EpicHeads.java b/src/main/java/com/songoda/epicheads/EpicHeads.java index eda9f0f..6c5daf2 100644 --- a/src/main/java/com/songoda/epicheads/EpicHeads.java +++ b/src/main/java/com/songoda/epicheads/EpicHeads.java @@ -44,7 +44,7 @@ public class EpicHeads extends SongodaPlugin { private HeadManager headManager; private PlayerManager playerManager; private CommandManager commandManager; - PluginHook itemEconomyHook = PluginHook.addHook(Economy.class, "EpicHeads", com.songoda.epicheads.economy.ItemEconomy.class); + private PluginHook itemEconomyHook; private Storage storage; @@ -55,6 +55,7 @@ public class EpicHeads extends SongodaPlugin { @Override public void onPluginLoad() { INSTANCE = this; + this.itemEconomyHook = PluginHook.addHook(Economy.class, "EpicHeads", com.songoda.epicheads.utils.ItemEconomy.class); } @Override diff --git a/src/main/java/com/songoda/epicheads/settings/Settings.java b/src/main/java/com/songoda/epicheads/settings/Settings.java index 3688385..d7c3fc3 100644 --- a/src/main/java/com/songoda/epicheads/settings/Settings.java +++ b/src/main/java/com/songoda/epicheads/settings/Settings.java @@ -15,7 +15,7 @@ import java.util.stream.Collectors; */ public class Settings { - static final Config config = EpicHeads.getInstance().getConfig().getCoreConfig(); + static final Config config = EpicHeads.getInstance().getCoreConfig(); public static final ConfigSetting AUTOSAVE = new ConfigSetting(config, "Main.Auto Save Interval In Seconds", 15, "The amount of time in between saving to file.", @@ -49,7 +49,7 @@ public class Settings { public static final ConfigSetting ECONOMY_PLUGIN = new ConfigSetting(config, "Economy.Economy", EconomyManager.getEconomy() == null ? "Vault" : EconomyManager.getEconomy().getName(), "Which economy plugin should be used?", - "Supported plugins you have installed: \"" + EconomyManager.getManager().getRegisteredPlugins().stream().collect(Collectors.joining("\", \"")) + "\"."); + "Supported plugins you have installed: \"" + EconomyManager.getManager().getRegisteredPlugins().stream().filter(p -> !p.equals("EpicHeads")).collect(Collectors.joining("\", \"")) + "\", \"Item\"."); public static final ConfigSetting HEAD_COST = new ConfigSetting(config, "Economy.Head Cost", 24.99, "The cost the of the head. If you wan't to use PlayerPoints", diff --git a/src/main/java/com/songoda/epicheads/utils/ItemEconomy.java b/src/main/java/com/songoda/epicheads/utils/ItemEconomy.java index ba06178..73d93d9 100644 --- a/src/main/java/com/songoda/epicheads/utils/ItemEconomy.java +++ b/src/main/java/com/songoda/epicheads/utils/ItemEconomy.java @@ -1,7 +1,6 @@ -package com.songoda.epicheads.economy; +package com.songoda.epicheads.utils; import com.songoda.core.hooks.economies.Economy; -import com.songoda.epicheads.utils.Methods; import org.bukkit.OfflinePlayer; import org.bukkit.inventory.ItemStack; @@ -68,6 +67,6 @@ public class ItemEconomy extends Economy { @Override public boolean isEnabled() { - return false; + return true; } } diff --git a/src/main/java/com/songoda/epicheads/utils/storage/types/StorageYaml.java b/src/main/java/com/songoda/epicheads/utils/storage/types/StorageYaml.java index d82dbe6..fb5cf7b 100644 --- a/src/main/java/com/songoda/epicheads/utils/storage/types/StorageYaml.java +++ b/src/main/java/com/songoda/epicheads/utils/storage/types/StorageYaml.java @@ -6,19 +6,9 @@ import com.songoda.epicheads.utils.storage.StorageItem; import com.songoda.epicheads.utils.storage.StorageRow; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.MemorySection; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Deque; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; + +import java.io.*; +import java.util.*; public class StorageYaml extends Storage { @@ -118,7 +108,8 @@ public class StorageYaml extends Storage { File data = new File(instance.getDataFolder(), "data.yml"); File dataClone = new File(instance.getDataFolder(), "data-backup-" + System.currentTimeMillis() + ".yml"); try { - copyFile(data, dataClone); + if (data.exists()) + copyFile(data, dataClone); } catch (IOException e) { e.printStackTrace(); }