Merge branch 'development' of gitlab.com:Songoda/epicheads into development

This commit is contained in:
jascotty2 2019-10-11 12:38:03 -05:00
commit 5d088d7189
6 changed files with 14 additions and 23 deletions

View File

@ -4,7 +4,7 @@ stages:
variables:
name: "EpicHeads"
path: "/builds/$CI_PROJECT_PATH"
version: "3.2.0"
version: "3.2.3"
build:
stage: build

View File

@ -78,8 +78,8 @@
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<artifactId>spigot</artifactId>
<version>1.14.4</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -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

View File

@ -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",

View File

@ -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;
}
}

View File

@ -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,6 +108,7 @@ 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 {
if (data.exists())
copyFile(data, dataClone);
} catch (IOException e) {
e.printStackTrace();