V3.14.1.2

This commit is contained in:
rockyhawk64 2020-12-04 18:00:11 +11:00
parent ab214f1143
commit 25f3fcf999
5 changed files with 25 additions and 2 deletions

View File

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

View File

@ -52,6 +52,9 @@ public class Commandpanel implements CommandExecutor {
//do console command command //do console command command
if(args.length == 2){ if(args.length == 2){
if(!args[1].equals("item")){ if(!args[1].equals("item")){
if(plugin.openPanels.hasPanelOpen(plugin.getServer().getPlayer(args[1]).getName())) {
plugin.openPanels.skipPanels.add(plugin.getServer().getPlayer(args[1]).getName());
}
plugin.openVoids.openCommandPanel(sender,plugin.getServer().getPlayer(args[1]),panelName,cf,true); plugin.openVoids.openCommandPanel(sender,plugin.getServer().getPlayer(args[1]),panelName,cf,true);
}else{ }else{
sender.sendMessage(plugin.papi(plugin.tag + ChatColor.RED + "Usage: /cp <panel> [item] [player]")); sender.sendMessage(plugin.papi(plugin.tag + ChatColor.RED + "Usage: /cp <panel> [item] [player]"));
@ -73,12 +76,18 @@ public class Commandpanel implements CommandExecutor {
Player p = (Player) sender; Player p = (Player) sender;
//do player command //do player command
if (args.length == 1) { if (args.length == 1) {
if(plugin.openPanels.hasPanelOpen(p.getName())) {
plugin.openPanels.skipPanels.add(p.getName());
}
plugin.openVoids.openCommandPanel(sender, p, panelName, cf,false); plugin.openVoids.openCommandPanel(sender, p, panelName, cf,false);
return true; return true;
}else if(args.length == 2){ }else if(args.length == 2){
if (args[1].equals("item")) { if (args[1].equals("item")) {
plugin.openVoids.giveHotbarItem(sender, p, cf, false); plugin.openVoids.giveHotbarItem(sender, p, cf, false);
}else{ }else{
if(plugin.openPanels.hasPanelOpen(plugin.getServer().getPlayer(args[1]).getName())) {
plugin.openPanels.skipPanels.add(plugin.getServer().getPlayer(args[1]).getName());
}
plugin.openVoids.openCommandPanel(sender, plugin.getServer().getPlayer(args[1]), panelName, cf,true); plugin.openVoids.openCommandPanel(sender, plugin.getServer().getPlayer(args[1]), panelName, cf,true);
} }
return true; return true;

View File

@ -34,6 +34,9 @@ public class Commandpanelcustom implements Listener {
for(String cmd : panelCommands){ for(String cmd : panelCommands){
if(cmd.equalsIgnoreCase(e.getMessage().replace("/", ""))){ if(cmd.equalsIgnoreCase(e.getMessage().replace("/", ""))){
e.setCancelled(true); e.setCancelled(true);
if(plugin.openPanels.hasPanelOpen(e.getPlayer().getName())) {
plugin.openPanels.skipPanels.add(e.getPlayer().getName());
}
plugin.openVoids.openCommandPanel(e.getPlayer(), e.getPlayer(), panelName[0], tempFile, false); plugin.openVoids.openCommandPanel(e.getPlayer(), e.getPlayer(), panelName[0], tempFile, false);
return; return;
} }
@ -59,6 +62,9 @@ public class Commandpanelcustom implements Listener {
for(String[] placeholder : placeholders){ for(String[] placeholder : placeholders){
plugin.customCommand.addCCP(panelName[0],e.getPlayer().getName(),placeholder[0],placeholder[1]); plugin.customCommand.addCCP(panelName[0],e.getPlayer().getName(),placeholder[0],placeholder[1]);
} }
if(plugin.openPanels.hasPanelOpen(e.getPlayer().getName())) {
plugin.openPanels.skipPanels.add(e.getPlayer().getName());
}
plugin.openVoids.openCommandPanel(e.getPlayer(), e.getPlayer(), panelName[0], tempFile, false); plugin.openVoids.openCommandPanel(e.getPlayer(), e.getPlayer(), panelName[0], tempFile, false);
return; return;
} }

View File

@ -51,6 +51,9 @@ public class UtilsOpenWithItem implements Listener {
if (e.getSlot() == Integer.parseInt(Objects.requireNonNull(tempFile.getString("open-with-item.stationary")))) { if (e.getSlot() == Integer.parseInt(Objects.requireNonNull(tempFile.getString("open-with-item.stationary")))) {
e.setCancelled(true); e.setCancelled(true);
p.updateInventory(); p.updateInventory();
if(plugin.openPanels.hasPanelOpen(p.getName())) {
plugin.openPanels.skipPanels.add(p.getName());
}
plugin.openVoids.openCommandPanel(p,p,tempName,tempFile,false); plugin.openVoids.openCommandPanel(p,p,tempName,tempFile,false);
return; return;
} }
@ -366,6 +369,9 @@ public class UtilsOpenWithItem implements Listener {
if (p.getInventory().getHeldItemSlot() == Integer.parseInt(Objects.requireNonNull(tempFile.getString("open-with-item.stationary")))) { if (p.getInventory().getHeldItemSlot() == Integer.parseInt(Objects.requireNonNull(tempFile.getString("open-with-item.stationary")))) {
e.setCancelled(true); e.setCancelled(true);
p.updateInventory(); p.updateInventory();
if(plugin.openPanels.hasPanelOpen(p.getName())) {
plugin.openPanels.skipPanels.add(p.getName());
}
plugin.openVoids.openCommandPanel(p,p,tempName,tempFile,false); plugin.openVoids.openCommandPanel(p,p,tempName,tempFile,false);
} }
} }

View File

@ -45,7 +45,9 @@ public class PanelBlockOnClick implements Listener {
if(temp[0].equals(plugin.blockConfig.getString("blocks." + configLocation + ".panel"))){ if(temp[0].equals(plugin.blockConfig.getString("blocks." + configLocation + ".panel"))){
String panelName = temp[0]; String panelName = temp[0];
YamlConfiguration cf = YamlConfiguration.loadConfiguration(new File(plugin.panelsf + File.separator + plugin.panelFiles.get(Integer.parseInt(temp[1])))); YamlConfiguration cf = YamlConfiguration.loadConfiguration(new File(plugin.panelsf + File.separator + plugin.panelFiles.get(Integer.parseInt(temp[1]))));
plugin.openVoids.openCommandPanel(p,p,panelName,cf.getConfigurationSection("panels." + panelName),false); if(!plugin.openPanels.hasPanelOpen(p.getName())) {
plugin.openVoids.openCommandPanel(p, p, panelName, cf.getConfigurationSection("panels." + panelName), false);
}
return; return;
} }
} }