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
- commandpanels:commandpanelclose
- console= title %cp-player-name% times 20 60 20
- console= title %cp-player-name% subtitle {"text":"You are now in creative
mode!","color":"green"}
- console= title %cp-player-name% subtitle {"text":"You are now in creative mode!","color":"green"}
- console= title %cp-player-name% title {"text":"Awesome %cp-player-displayname%"}

View File

@ -131,6 +131,5 @@ panels:
- gamemode creative
- commandpanels:commandpanelclose
- console= title %cp-player-name% times 20 60 20
- console= title %cp-player-name% subtitle {"text":"You are now in creative
mode!","color":"green"}
- console= title %cp-player-name% subtitle {"text":"You are now in creative mode!","color":"green"}
- 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
name: CommandPanels
author: RockyHawk

View File

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

View File

@ -27,27 +27,32 @@ public class Commandpanelcustom implements Listener {
}
ConfigurationSection tempFile;
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]);
if(tempFile.contains("commands")) {
List<String> panelCommands = tempFile.getStringList("commands");
if(panelCommands.contains(e.getMessage().replace("/",""))){
e.setCancelled(true);
plugin.openVoids.openCommandPanel(e.getPlayer(),e.getPlayer(),panelName[0],tempFile,false);
return;
try {
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]);
if (tempFile.contains("commands")) {
List<String> panelCommands = tempFile.getStringList("commands");
if (panelCommands.contains(e.getMessage().replace("/", ""))) {
e.setCancelled(true);
plugin.openVoids.openCommandPanel(e.getPlayer(), e.getPlayer(), panelName[0], tempFile, false);
return;
}
}
}
//this will be deleted next update
if(tempFile.contains("command")) {
List<String> panelCommands = Arrays.asList(tempFile.getString("command").split("\\s"));
if(panelCommands.contains(e.getMessage().replace("/",""))){
e.setCancelled(true);
plugin.getServer().getConsoleSender().sendMessage(ChatColor.RED + "[CommandPanels] Using command: for custom commands will soon be deprecated. Please use commands: as shown in the wiki instead!");
plugin.openVoids.openCommandPanel(e.getPlayer(),e.getPlayer(),panelName[0],tempFile,false);
return;
//this will be deleted in 3.13.x
if (tempFile.contains("command")) {
List<String> panelCommands = Arrays.asList(tempFile.getString("command").split("\\s"));
if (panelCommands.contains(e.getMessage().replace("/", ""))) {
e.setCancelled(true);
plugin.getServer().getConsoleSender().sendMessage(ChatColor.RED + "[CommandPanels] Using command: for custom commands will soon be deprecated. Please use commands: as shown in the wiki instead!");
plugin.openVoids.openCommandPanel(e.getPlayer(), e.getPlayer(), panelName[0], tempFile, false);
return;
}
}
}
}catch(NullPointerException exc){
//this is placed to prevent null exceptions if the commandpanels reload command has file changes
plugin.debug(exc);
}
}
}