Fixes v3.12.6

This commit is contained in:
rockyhawk64 2020-10-27 11:20:31 +11:00
parent 0201b7b7cb
commit d44c72a68b
5 changed files with 26 additions and 22 deletions

View File

@ -129,6 +129,5 @@ panels:
- gamemode creative - gamemode creative
- commandpanels:commandpanelclose - commandpanels:commandpanelclose
- console= title %cp-player-name% times 20 60 20 - console= title %cp-player-name% times 20 60 20
- console= title %cp-player-name% subtitle {"text":"You are now in creative - console= title %cp-player-name% subtitle {"text":"You are now in creative mode!","color":"green"}
mode!","color":"green"}
- console= title %cp-player-name% title {"text":"Awesome %cp-player-displayname%"} - console= title %cp-player-name% title {"text":"Awesome %cp-player-displayname%"}

View File

@ -131,6 +131,5 @@ panels:
- gamemode creative - gamemode creative
- commandpanels:commandpanelclose - commandpanels:commandpanelclose
- console= title %cp-player-name% times 20 60 20 - console= title %cp-player-name% times 20 60 20
- console= title %cp-player-name% subtitle {"text":"You are now in creative - console= title %cp-player-name% subtitle {"text":"You are now in creative mode!","color":"green"}
mode!","color":"green"}
- console= title %cp-player-name% title {"text":"Awesome %cp-player-displayname%"} - console= title %cp-player-name% title {"text":"Awesome %cp-player-displayname%"}

View File

@ -1,4 +1,4 @@
version: 3.12.5 version: 3.12.6
main: me.rockyhawk.commandpanels.CommandPanels main: me.rockyhawk.commandpanels.CommandPanels
name: CommandPanels name: CommandPanels
author: RockyHawk author: RockyHawk

View File

@ -476,6 +476,7 @@ public class CommandPanels extends JavaPlugin {
public void debug(Exception e) { public void debug(Exception e) {
if (debug) { if (debug) {
getServer().getConsoleSender().sendMessage(ChatColor.DARK_RED + "[CommandPanels] The plugin has generated a debug error, find the error below");
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@ -27,6 +27,7 @@ public class Commandpanelcustom implements Listener {
} }
ConfigurationSection tempFile; ConfigurationSection tempFile;
try {
for (String[] panelName : plugin.panelNames) { for (String[] panelName : plugin.panelNames) {
tempFile = YamlConfiguration.loadConfiguration(new File(plugin.panelsf + File.separator + plugin.panelFiles.get(Integer.parseInt(panelName[1])))).getConfigurationSection("panels." + panelName[0]); tempFile = YamlConfiguration.loadConfiguration(new File(plugin.panelsf + File.separator + plugin.panelFiles.get(Integer.parseInt(panelName[1])))).getConfigurationSection("panels." + panelName[0]);
if (tempFile.contains("commands")) { if (tempFile.contains("commands")) {
@ -38,7 +39,7 @@ public class Commandpanelcustom implements Listener {
} }
} }
//this will be deleted next update //this will be deleted in 3.13.x
if (tempFile.contains("command")) { if (tempFile.contains("command")) {
List<String> panelCommands = Arrays.asList(tempFile.getString("command").split("\\s")); List<String> panelCommands = Arrays.asList(tempFile.getString("command").split("\\s"));
if (panelCommands.contains(e.getMessage().replace("/", ""))) { if (panelCommands.contains(e.getMessage().replace("/", ""))) {
@ -49,5 +50,9 @@ public class Commandpanelcustom implements Listener {
} }
} }
} }
}catch(NullPointerException exc){
//this is placed to prevent null exceptions if the commandpanels reload command has file changes
plugin.debug(exc);
}
} }
} }