mirror of
https://github.com/songoda/EpicHeads.git
synced 2024-11-26 04:25:16 +01:00
Merge branch 'development' of gitlab.com:Songoda/epicheads into development
This commit is contained in:
commit
5d088d7189
@ -4,7 +4,7 @@ stages:
|
|||||||
variables:
|
variables:
|
||||||
name: "EpicHeads"
|
name: "EpicHeads"
|
||||||
path: "/builds/$CI_PROJECT_PATH"
|
path: "/builds/$CI_PROJECT_PATH"
|
||||||
version: "3.2.0"
|
version: "3.2.3"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
4
pom.xml
4
pom.xml
@ -78,8 +78,8 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>1.14.4-R0.1-SNAPSHOT</version>
|
<version>1.14.4</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -44,7 +44,7 @@ public class EpicHeads extends SongodaPlugin {
|
|||||||
private HeadManager headManager;
|
private HeadManager headManager;
|
||||||
private PlayerManager playerManager;
|
private PlayerManager playerManager;
|
||||||
private CommandManager commandManager;
|
private CommandManager commandManager;
|
||||||
PluginHook itemEconomyHook = PluginHook.addHook(Economy.class, "EpicHeads", com.songoda.epicheads.economy.ItemEconomy.class);
|
private PluginHook itemEconomyHook;
|
||||||
|
|
||||||
private Storage storage;
|
private Storage storage;
|
||||||
|
|
||||||
@ -55,6 +55,7 @@ public class EpicHeads extends SongodaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onPluginLoad() {
|
public void onPluginLoad() {
|
||||||
INSTANCE = this;
|
INSTANCE = this;
|
||||||
|
this.itemEconomyHook = PluginHook.addHook(Economy.class, "EpicHeads", com.songoda.epicheads.utils.ItemEconomy.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -15,7 +15,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
public class Settings {
|
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,
|
public static final ConfigSetting AUTOSAVE = new ConfigSetting(config, "Main.Auto Save Interval In Seconds", 15,
|
||||||
"The amount of time in between saving to file.",
|
"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(),
|
public static final ConfigSetting ECONOMY_PLUGIN = new ConfigSetting(config, "Economy.Economy", EconomyManager.getEconomy() == null ? "Vault" : EconomyManager.getEconomy().getName(),
|
||||||
"Which economy plugin should be used?",
|
"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,
|
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",
|
"The cost the of the head. If you wan't to use PlayerPoints",
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.songoda.epicheads.economy;
|
package com.songoda.epicheads.utils;
|
||||||
|
|
||||||
import com.songoda.core.hooks.economies.Economy;
|
import com.songoda.core.hooks.economies.Economy;
|
||||||
import com.songoda.epicheads.utils.Methods;
|
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
@ -68,6 +67,6 @@ public class ItemEconomy extends Economy {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,19 +6,9 @@ import com.songoda.epicheads.utils.storage.StorageItem;
|
|||||||
import com.songoda.epicheads.utils.storage.StorageRow;
|
import com.songoda.epicheads.utils.storage.StorageRow;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.MemorySection;
|
import org.bukkit.configuration.MemorySection;
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
import java.io.*;
|
||||||
import java.io.FileOutputStream;
|
import java.util.*;
|
||||||
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;
|
|
||||||
|
|
||||||
public class StorageYaml extends Storage {
|
public class StorageYaml extends Storage {
|
||||||
|
|
||||||
@ -118,7 +108,8 @@ public class StorageYaml extends Storage {
|
|||||||
File data = new File(instance.getDataFolder(), "data.yml");
|
File data = new File(instance.getDataFolder(), "data.yml");
|
||||||
File dataClone = new File(instance.getDataFolder(), "data-backup-" + System.currentTimeMillis() + ".yml");
|
File dataClone = new File(instance.getDataFolder(), "data-backup-" + System.currentTimeMillis() + ".yml");
|
||||||
try {
|
try {
|
||||||
copyFile(data, dataClone);
|
if (data.exists())
|
||||||
|
copyFile(data, dataClone);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user