mirror of
https://github.com/darksaid98/EntityBingo.git
synced 2026-12-01 15:58:46 +00:00
moved all data storage to primary config.yml
This commit is contained in:
1 parent
37823ee981
commit
9a1fab48e5
6 files changed
+123
-127
No files matched your search
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>org.aubrithehuman</groupId>
|
||||
<artifactId>EntityBingo</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<version>1.0.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>EntityBingo</name>
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
package org.aubrithehuman.entitybingo;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.MemoryConfiguration;
|
||||
import org.bukkit.configuration.MemorySection;
|
||||
import org.bukkit.event.entity.EntityTameEvent;
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
@@ -9,6 +14,7 @@ import java.nio.file.Files;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
@@ -21,9 +27,6 @@ public class DataManager {
|
||||
|
||||
public static void init() {
|
||||
plugin = EntityBingo.getInstance();
|
||||
|
||||
createFolders();
|
||||
genDefaultFiles();
|
||||
}
|
||||
|
||||
private static String dataFolder = "plugins" + File.separator + "EntityBingo" + File.separator + "data";
|
||||
@@ -35,48 +38,62 @@ public class DataManager {
|
||||
* @param map - Map to be saved
|
||||
*/
|
||||
public static void saveData(String filePath, HashMap<String, Object> map) {
|
||||
File file = getFile(filePath);
|
||||
Bukkit.getLogger().log(Level.WARNING, "scoreboard.yml printout1");
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print isAbsolute: " + (file == null ? "" : file.isAbsolute()));
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print isFile: " + (file == null ? "" : file.isFile()));
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print canWrite: " + (file == null ? "" : file.canWrite()));
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print exists: " + (file == null ? "" : file.exists()));
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print canRead: " + (file == null ? "" : file.canRead()));
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print isHidden: " + (file == null ? "" : file.isHidden()));
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print path: " + (file == null ? "" : file.getPath()));
|
||||
PrintWriter writer = null;
|
||||
// File file = getFile(filePath);
|
||||
// Bukkit.getLogger().log(Level.WARNING, "scoreboard.yml printout1");
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print isAbsolute: " + (file == null ? "" : file.isAbsolute()));
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print isFile: " + (file == null ? "" : file.isFile()));
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print canWrite: " + (file == null ? "" : file.canWrite()));
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print exists: " + (file == null ? "" : file.exists()));
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print canRead: " + (file == null ? "" : file.canRead()));
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print isHidden: " + (file == null ? "" : file.isHidden()));
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print path: " + (file == null ? "" : file.getPath()));
|
||||
// PrintWriter writer = null;
|
||||
// try {
|
||||
// file.setWritable(true);
|
||||
// Bukkit.getLogger().log(Level.WARNING, "scoreboard.yml printout2");
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print isAbsolute: " + file.isAbsolute());
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print isFile: " + file.isFile());
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print canWrite: " + file.canWrite());
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print exists: " + file.exists());
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print canRead: " + file.canRead());
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print isHidden: " + file.isHidden());
|
||||
// Bukkit.getLogger().log(Level.WARNING, "Error Print path: " + file.getPath());
|
||||
// writer = new PrintWriter(file);
|
||||
// } catch (FileNotFoundException e) {
|
||||
// EntityBingo.getInstance().getLogger().log(Level.WARNING, "Encountered FileNotFound error when creating PrintWriter for " + filePath);
|
||||
// e.printStackTrace();
|
||||
// return;
|
||||
// } catch (NullPointerException e) {
|
||||
// EntityBingo.getInstance().getLogger().log(Level.WARNING, "Encountered NullPointer error when creating PrintWriter for " + filePath);
|
||||
// e.printStackTrace();
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (options == null) {
|
||||
// options = new DumperOptions();
|
||||
// options.setIndent(2);
|
||||
// options.setPrettyFlow(true);
|
||||
// options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
// }
|
||||
//
|
||||
// Yaml yaml = new Yaml(options);
|
||||
// yaml.dump(map, writer);
|
||||
// writer.flush();
|
||||
// writer.close();
|
||||
|
||||
MemorySection data = (MemorySection) EntityBingo.getInstance().getConfig().get("scores");
|
||||
Map<String, Object> raw = (Map<String, Object>) map.get("scores");
|
||||
for (String s : raw.keySet()) {
|
||||
Bukkit.getLogger().info("saving: " + s + ": " + raw.get(s));
|
||||
data.set(s, raw.get(s));
|
||||
}
|
||||
Bukkit.getLogger().info(data.toString());
|
||||
|
||||
try {
|
||||
file.setWritable(true);
|
||||
Bukkit.getLogger().log(Level.WARNING, "scoreboard.yml printout2");
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print isAbsolute: " + file.isAbsolute());
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print isFile: " + file.isFile());
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print canWrite: " + file.canWrite());
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print exists: " + file.exists());
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print canRead: " + file.canRead());
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print isHidden: " + file.isHidden());
|
||||
Bukkit.getLogger().log(Level.WARNING, "Error Print path: " + file.getPath());
|
||||
writer = new PrintWriter(file);
|
||||
} catch (FileNotFoundException e) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Encountered FileNotFound error when creating PrintWriter for " + filePath);
|
||||
EntityBingo.getInstance().getConfig().save("plugins" + File.separator + "EntityBingo" + File.separator + "config.yml");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
} catch (NullPointerException e) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Encountered NullPointer error when creating PrintWriter for " + filePath);
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
if (options == null) {
|
||||
options = new DumperOptions();
|
||||
options.setIndent(2);
|
||||
options.setPrettyFlow(true);
|
||||
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
}
|
||||
|
||||
Yaml yaml = new Yaml(options);
|
||||
yaml.dump(map, writer);
|
||||
writer.flush();
|
||||
writer.close();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +102,7 @@ public class DataManager {
|
||||
* @param filePath - FilePath of data
|
||||
* @return HashMap of data or null
|
||||
*/
|
||||
public static HashMap<String, Object> getData(String filePath) {
|
||||
public static Map<String, Object> getData(String filePath) {
|
||||
File file = getFile(filePath);
|
||||
return getData(file);
|
||||
}
|
||||
@@ -96,30 +113,40 @@ public class DataManager {
|
||||
* @param file - Data file
|
||||
* @return HashMap of data or null
|
||||
*/
|
||||
public static HashMap<String, Object> getData(File file) {
|
||||
if (!file.exists()) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Attempted to retrieve non-existant file: " + file.getPath());
|
||||
return null;
|
||||
}
|
||||
public static Map<String, Object> getData(File file) {
|
||||
// if (!file.exists()) {
|
||||
// EntityBingo.getInstance().getLogger().log(Level.WARNING, "Attempted to retrieve non-existant file: " + file.getPath());
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// InputStream inputStream = null;
|
||||
// try {
|
||||
// inputStream = new FileInputStream(file);
|
||||
// } catch (FileNotFoundException e) {
|
||||
// EntityBingo.getInstance().getLogger().log(Level.WARNING, "Encountered error when creating FileInputStream for " + file.getPath());
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// Yaml yaml = new Yaml();
|
||||
// HashMap<String, Object> data = yaml.load(inputStream);
|
||||
// try {
|
||||
// inputStream.close();
|
||||
// } catch (IOException e) {
|
||||
// EntityBingo.getInstance().getLogger().log(Level.SEVERE, e.getMessage());
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
inputStream = new FileInputStream(file);
|
||||
} catch (FileNotFoundException e) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Encountered error when creating FileInputStream for " + file.getPath());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
Yaml yaml = new Yaml();
|
||||
HashMap<String, Object> data = yaml.load(inputStream);
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.SEVERE, e.getMessage());
|
||||
EntityBingo.getInstance().getConfig().load("plugins" + File.separator + "EntityBingo" + File.separator + "config.yml");
|
||||
} catch (IOException | InvalidConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return data;
|
||||
MemorySection data = ((MemorySection) EntityBingo.getInstance().getConfig().get("scores"));
|
||||
Bukkit.getLogger().info(data.toString());
|
||||
Bukkit.getLogger().info(data.getValues(true).toString());
|
||||
Map<String,Object> raw = new HashMap<>();
|
||||
raw.put("scores", data.getValues(true));
|
||||
return raw;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,42 +193,4 @@ public class DataManager {
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates Default Files
|
||||
*/
|
||||
private static void genDefaultFiles() {
|
||||
List<String> paths = List.of(
|
||||
"scoreboard.yml"
|
||||
);
|
||||
|
||||
for (String path : paths) {
|
||||
File file = new File(dataFolder + File.separator + path);
|
||||
if (!file.exists()) {
|
||||
HashMap<String, Object> raw = new HashMap<>();
|
||||
raw.put("scores", new HashMap<String, Object>());
|
||||
saveData(path, raw);
|
||||
EntityBingo.getInstance().getLogger().info("Couldn't find file \"" + path + "\", generated default.");
|
||||
} else {
|
||||
EntityBingo.getInstance().getLogger().info("Found existing scoreboard file at " + dataFolder + File.separator + path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial creation of all needed folders
|
||||
*/
|
||||
private static void createFolders() {
|
||||
List<String> paths = Arrays.asList(
|
||||
"plugins" + File.separator + "EntityBingo" + File.separator + "data"
|
||||
);
|
||||
|
||||
for (String path : paths) {
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
EntityBingo.getInstance().getLogger().info("Couldn't find folder \"" + path + "\", generated default.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,9 +33,9 @@ public final class EntityBingo extends JavaPlugin {
|
||||
DataManager.init();
|
||||
|
||||
//Reload scoreboard
|
||||
HashMap<String, Object> raw = DataManager.getData("scoreboard.yml");
|
||||
Map<String, Object> raw = DataManager.getData("config.yml");
|
||||
try {
|
||||
HashMap<String, Object> data = (HashMap<String, Object>) raw.get("scores");
|
||||
Map<String, Object> data = (Map<String, Object>) raw.get("scores");
|
||||
//grab only entries with integer values, should be all, but we need to check anyway
|
||||
Map<String, Integer> filtered = data.entrySet()
|
||||
.stream()
|
||||
@@ -47,7 +47,7 @@ public final class EntityBingo extends JavaPlugin {
|
||||
//Save to static scoreboard reference
|
||||
ChatListener.scoreboard = Helper.sortData(filtered);
|
||||
} catch (ClassCastException ex) {
|
||||
this.getLogger().log(Level.WARNING, "Failed to load scoreboard! Is scoreboard.yml broken?");
|
||||
this.getLogger().log(Level.WARNING, "Failed to load scoreboard! Is config.yml broken?");
|
||||
}
|
||||
|
||||
this.getLogger().info("EntityBingo loaded.");
|
||||
|
||||
@@ -145,9 +145,9 @@ public class EntityBingoCommand implements CommandExecutor, TabCompleter {
|
||||
return true;
|
||||
}
|
||||
|
||||
HashMap<String, Object> raw = DataManager.getData("scoreboard.yml");
|
||||
Map<String, Object> raw = DataManager.getData("config.yml");
|
||||
try {
|
||||
HashMap<String, Object> data = (HashMap<String, Object>) raw.get("scores");
|
||||
Map<String, Object> data = (Map<String, Object>) raw.get("scores");
|
||||
//grab only entries with integer values, should be all, but we need to check anyway
|
||||
Map<String, Integer> filtered = data.entrySet()
|
||||
.stream()
|
||||
@@ -163,15 +163,16 @@ public class EntityBingoCommand implements CommandExecutor, TabCompleter {
|
||||
sender.sendMessage(Helper.chatLabel() + Helper.color("&cReloaded scoreboard."));
|
||||
EntityBingo.getInstance().getLogger().info(Helper.color("&cAdmin reloaded scoreboard!"));
|
||||
} catch (ClassCastException ex) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is scoreboard.yml broken?");
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is config.yml broken?");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
} else if (args[0].equalsIgnoreCase("addscore")) {
|
||||
if(args.length >= 3) {
|
||||
OfflinePlayer p = Bukkit.getOfflinePlayer(args[1]);
|
||||
HashMap<String, Object> raw = DataManager.getData("scoreboard.yml");
|
||||
Map<String, Object> raw = DataManager.getData("config.yml");
|
||||
try {
|
||||
HashMap<String, Object> data = (HashMap<String, Object>) raw.get("scores");
|
||||
Map<String, Object> data = (Map<String, Object>) raw.get("scores");
|
||||
|
||||
try {
|
||||
int old = (int) data.get(p.getUniqueId().toString());
|
||||
@@ -196,16 +197,17 @@ public class EntityBingoCommand implements CommandExecutor, TabCompleter {
|
||||
//save scoreboard
|
||||
HashMap<String, Object> out = new HashMap<>();
|
||||
out.put("scores", filtered);
|
||||
DataManager.saveData("scoreboard.yml", out);
|
||||
DataManager.saveData("config.yml", out);
|
||||
|
||||
sender.sendMessage(Helper.chatLabel() + Helper.color("&EB score for player " + args[1] + " added " + args[2]));
|
||||
EntityBingo.getInstance().getLogger().info(Helper.color("&EB score for player " + args[1] + " added " + args[2]));
|
||||
sender.sendMessage(Helper.chatLabel() + Helper.color("&eEB score for player " + args[1] + " added " + args[2]));
|
||||
EntityBingo.getInstance().getLogger().info(Helper.color("&eEB score for player " + args[1] + " added " + args[2]));
|
||||
|
||||
//clear event
|
||||
sender.sendMessage(Helper.chatLabel() + Helper.color("&cReloaded scoreboard."));
|
||||
EntityBingo.getInstance().getLogger().info(Helper.color("&cAdmin reloaded scoreboard!"));
|
||||
} catch (ClassCastException ex) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is scoreboard.yml broken?");
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is config.yml broken?");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
reloadScoreboard(sender);
|
||||
@@ -213,9 +215,9 @@ public class EntityBingoCommand implements CommandExecutor, TabCompleter {
|
||||
} else if (args[0].equalsIgnoreCase("setscore")) {
|
||||
if(args.length >= 3) {
|
||||
OfflinePlayer p = Bukkit.getOfflinePlayer(args[1]);
|
||||
HashMap<String, Object> raw = DataManager.getData("scoreboard.yml");
|
||||
Map<String, Object> raw = DataManager.getData("config.yml");
|
||||
try {
|
||||
HashMap<String, Object> data = (HashMap<String, Object>) raw.get("scores");
|
||||
Map<String, Object> data = (Map<String, Object>) raw.get("scores");
|
||||
|
||||
try {
|
||||
data.put(p.getUniqueId().toString(), Integer.parseInt(args[2]));
|
||||
@@ -239,7 +241,7 @@ public class EntityBingoCommand implements CommandExecutor, TabCompleter {
|
||||
//save scoreboard
|
||||
HashMap<String, Object> out = new HashMap<>();
|
||||
out.put("scores", filtered);
|
||||
DataManager.saveData("scoreboard.yml", out);
|
||||
DataManager.saveData("config.yml", out);
|
||||
|
||||
sender.sendMessage(Helper.chatLabel() + Helper.color("&cSet EB score for player " + args[1] + " to " + args[2]));
|
||||
EntityBingo.getInstance().getLogger().info(Helper.color("&cSet EB score for player " + args[1] + " to " + args[2]));
|
||||
@@ -248,7 +250,8 @@ public class EntityBingoCommand implements CommandExecutor, TabCompleter {
|
||||
sender.sendMessage(Helper.chatLabel() + Helper.color("&cReloaded scoreboard."));
|
||||
EntityBingo.getInstance().getLogger().info(Helper.color("&cAdmin reloaded scoreboard!"));
|
||||
} catch (ClassCastException ex) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is scoreboard.yml broken?");
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is config.yml broken?");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
reloadScoreboard(sender);
|
||||
@@ -261,9 +264,9 @@ public class EntityBingoCommand implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
|
||||
private static void reloadScoreboard(CommandSender sender) {
|
||||
HashMap<String, Object> raw = DataManager.getData("scoreboard.yml");
|
||||
Map<String, Object> raw = DataManager.getData("config.yml");
|
||||
try {
|
||||
HashMap<String, Object> data = (HashMap<String, Object>) raw.get("scores");
|
||||
Map<String, Object> data = (Map<String, Object>) raw.get("scores");
|
||||
//grab only entries with integer values, should be all, but we need to check anyway
|
||||
Map<String, Integer> filtered = data.entrySet()
|
||||
.stream()
|
||||
@@ -279,7 +282,8 @@ public class EntityBingoCommand implements CommandExecutor, TabCompleter {
|
||||
sender.sendMessage(Helper.chatLabel() + Helper.color("&cReloaded scoreboard."));
|
||||
EntityBingo.getInstance().getLogger().info(Helper.color("&cAdmin reloaded scoreboard!"));
|
||||
} catch (ClassCastException ex) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is scoreboard.yml broken?");
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is config.yml broken?");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ChatListener implements Listener {
|
||||
Bukkit.broadcastMessage(Helper.chatLabel() + "No one guessed correctly.");
|
||||
EntityBingo.getInstance().getLogger().info(Helper.chatLabel() + "No one guessed correctly.");
|
||||
} else {
|
||||
HashMap<String, Object> raw = DataManager.getData("scoreboard.yml");
|
||||
Map<String, Object> raw = DataManager.getData("config.yml");
|
||||
if(raw.containsKey("scores")) {
|
||||
try {
|
||||
HashMap<String, Integer> data = (HashMap<String, Integer>) raw.get("scores");
|
||||
@@ -106,7 +106,7 @@ public class ChatListener implements Listener {
|
||||
data.put(uuid.toString(), 1);
|
||||
}
|
||||
} else {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Data failed to load, plugins/EntityBingo/data/scoreboard.yml may be broken.");
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Data failed to load, plugins/EntityBingo/config.yml may be broken.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class ChatListener implements Listener {
|
||||
//save scoreboard
|
||||
HashMap<String, Object> out = new HashMap<>();
|
||||
out.put("scores", data);
|
||||
DataManager.saveData("scoreboard.yml", out);
|
||||
DataManager.saveData("config.yml", out);
|
||||
|
||||
//grab only entries with integer values, should be all, but we need to check anyway
|
||||
Map<String, Integer> filtered = data.entrySet()
|
||||
@@ -128,7 +128,8 @@ public class ChatListener implements Listener {
|
||||
scoreboard = Helper.sortData(filtered);
|
||||
}
|
||||
} catch (ClassCastException ex) {
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is scoreboard.yml broken?");
|
||||
EntityBingo.getInstance().getLogger().log(Level.WARNING, "Failed to load scores, is config.yml broken?");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
@@ -148,7 +149,7 @@ public class ChatListener implements Listener {
|
||||
//save scoreboard
|
||||
HashMap<String, Object> out = new HashMap<>();
|
||||
out.put("scores", data);
|
||||
DataManager.saveData("scoreboard.yml", out);
|
||||
DataManager.saveData("config.yml", out);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,4 +3,6 @@ startMessage: '§4[ClearLag] §cWarning Ground items will be removed in §760 §
|
||||
#check against this to end
|
||||
endMessage: '§6[ClearLag] §aRemoved '
|
||||
#max age for event (in seconds), used in case the ending fails
|
||||
maxEventAge: 120
|
||||
maxEventAge: 120
|
||||
#score data
|
||||
scores: {}
|
||||
Reference in new issue
Block a user