diff --git a/resource/example.yml b/resource/example.yml index 06d6f33..e291b5f 100644 --- a/resource/example.yml +++ b/resource/example.yml @@ -1,6 +1,6 @@ # |------------------------------------------------------------------------ # | CommandPanels Example File -# | By RockyHawk v2.2 +# | By RockyHawk v2.3 # | https://www.spigotmc.org/resources/command-panels-custom-guis.67788/ # |------------------------------------------------------------------------ panels: @@ -19,7 +19,6 @@ panels: name: '&6[&bExample Panel&6]' lore: - '&3Click me to open the panel!' - stationary: 4 item: '0': material: LEATHER_HELMET diff --git a/resource/exampleLegacy.yml b/resource/exampleLegacy.yml index 833a209..e7c5ca4 100644 --- a/resource/exampleLegacy.yml +++ b/resource/exampleLegacy.yml @@ -19,7 +19,6 @@ panels: name: '&6[&bExample Panel&6]' lore: - '&3Click me to open the panel!' - stationary: 4 item: '0': material: LEATHER_HELMET diff --git a/resource/plugin.yml b/resource/plugin.yml index 7cba55d..d8bae2c 100644 --- a/resource/plugin.yml +++ b/resource/plugin.yml @@ -1,4 +1,4 @@ -version: 3.15.2.2 +version: 3.15.2.3 main: me.rockyhawk.commandpanels.CommandPanels name: CommandPanels author: RockyHawk diff --git a/src/me/rockyhawk/commandpanels/CommandPanels.java b/src/me/rockyhawk/commandpanels/CommandPanels.java index f730671..d771d0d 100644 --- a/src/me/rockyhawk/commandpanels/CommandPanels.java +++ b/src/me/rockyhawk/commandpanels/CommandPanels.java @@ -413,10 +413,16 @@ public class CommandPanels extends JavaPlugin{ fileNamesFromDirectory(new File(directory + File.separator + fileName)); continue; } - int ind = fileName.lastIndexOf("."); - if(!fileName.substring(ind).equalsIgnoreCase(".yml") && !fileName.substring(ind).equalsIgnoreCase(".yaml")){ + + try { + int ind = fileName.lastIndexOf("."); + if (!fileName.substring(ind).equalsIgnoreCase(".yml") && !fileName.substring(ind).equalsIgnoreCase(".yaml")) { + continue; + } + }catch (Exception ex){ continue; } + //check before adding the file to commandpanels if(!checkPanels(YamlConfiguration.loadConfiguration(new File(directory + File.separator + fileName)))){ this.getServer().getConsoleSender().sendMessage("[CommandPanels]" + ChatColor.RED + " Error in: " + fileName);