added logging

This commit is contained in:
danielb 2024-05-23 19:03:24 +00:00
parent 2f24400415
commit 67cd19b5f9

View File

@ -87,12 +87,14 @@ public class WorldConfig {
public static void create(UUID uuid, WorldTemplate template) { public static void create(UUID uuid, WorldTemplate template) {
DependenceConfig dc = new DependenceConfig(uuid); DependenceConfig dc = new DependenceConfig(uuid);
String worldname = dc.getWorldname(); String worldname = dc.getWorldname();
WorldSystem.logger().log(Level.INFO, PluginConfig.getWorlddir() + worldname);
File file = new File(PluginConfig.getWorlddir() + worldname + "/worldconfig.yml"); File file = new File(PluginConfig.getWorlddir() + worldname + "/worldconfig.yml");
try { try {
file.createNewFile(); file.createNewFile();
} catch (IOException e1) { } catch (IOException e1) {
e1.printStackTrace();
WorldSystem.logger().log(Level.SEVERE,"Error while creating worldconfig for " + uuid.toString()); WorldSystem.logger().log(Level.SEVERE,"Error while creating worldconfig for " + uuid.toString());
WorldSystem.logger().log(Level.SEVERE,e1.getMessage());
e1.printStackTrace();
} }
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file); YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
cfg.set("Informations.ID", dc.getID()); cfg.set("Informations.ID", dc.getID());