Minor StuffManager log fixes

This commit is contained in:
Arnaud G. GIBERT 2021-05-08 17:57:46 +02:00
parent d0162730fb
commit c81aa6417b

View File

@ -63,12 +63,12 @@ public class StuffManager {
nhat.set("Price", 50); nhat.set("Price", 50);
nhat.set("Name", "JackOHat"); nhat.set("Name", "JackOHat");
nhat.set("Material", Material.JACK_O_LANTERN.toString()); nhat.set("Material", Material.JACK_O_LANTERN.toString());
nhat.set("Description", (String.valueOf(ChatColor.BOLD.toString()) + "It's cool !")); nhat.set("Description", (String.valueOf(ChatColor.BOLD.toString()) + "It's cool!"));
try { try {
nhat.save(new File(_plugin.getDataFolder(), "/Stuff/Hats/JackOHat.yml")); nhat.save(new File(_plugin.getDataFolder(), "/Stuff/Hats/JackOHat.yml"));
} }
catch (IOException e) { catch (IOException e) {
_plugin.getLogger().warning("save JackOHat impossible !"); _plugin.getLogger().warning("save JackOHat impossible!");
} }
YamlConfiguration nhatt = YamlConfiguration.loadConfiguration((File)new File("")); YamlConfiguration nhatt = YamlConfiguration.loadConfiguration((File)new File(""));
nhatt.set("Implementation", "HatCustomFile"); nhatt.set("Implementation", "HatCustomFile");
@ -80,7 +80,7 @@ public class StuffManager {
nhatt.save(new File(_plugin.getDataFolder(), "/Stuff/Hats/Geekpower14.yml")); nhatt.save(new File(_plugin.getDataFolder(), "/Stuff/Hats/Geekpower14.yml"));
} }
catch (IOException e) { catch (IOException e) {
_plugin.getLogger().warning("save JackOHat impossible !"); _plugin.getLogger().warning("save Geekpower14 impossible!");
} }
f.mkdirs(); f.mkdirs();
} }
@ -90,7 +90,6 @@ public class StuffManager {
while (e < n) { while (e < n) {
YamlConfiguration config; YamlConfiguration config;
File file = arrfile[e]; File file = arrfile[e];
_plugin.getLogger().warning(file.getPath());
if (file.isFile() && file.getPath().endsWith(".yml") && (config = YamlConfiguration.loadConfiguration((File)file)).contains("Implementation")) { if (file.isFile() && file.getPath().endsWith(".yml") && (config = YamlConfiguration.loadConfiguration((File)file)).contains("Implementation")) {
_plugin.getLogger().info(String.valueOf(file.getPath()) + " found implementation"); _plugin.getLogger().info(String.valueOf(file.getPath()) + " found implementation");
HatBasic hat = HatFactory.getInstance(config.getString("Implementation"), file.getPath()); HatBasic hat = HatFactory.getInstance(config.getString("Implementation"), file.getPath());
@ -136,7 +135,6 @@ public class StuffManager {
while (meta < l) { while (meta < l) {
YamlConfiguration config; YamlConfiguration config;
File file = e[meta]; File file = e[meta];
_plugin.getLogger().warning(file.getPath());
if (file.isFile() && file.getPath().endsWith(".yml") && (config = YamlConfiguration.loadConfiguration((File)file)).contains("Implementation")) { if (file.isFile() && file.getPath().endsWith(".yml") && (config = YamlConfiguration.loadConfiguration((File)file)).contains("Implementation")) {
_plugin.getLogger().info(file.getPath() + " found implementation"); _plugin.getLogger().info(file.getPath() + " found implementation");
ArmorBasic armor = ArmorFactory.getInstance(config.getString("Implementation"), file.getPath()); ArmorBasic armor = ArmorFactory.getInstance(config.getString("Implementation"), file.getPath());