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
name: CommandPanels
author: RockyHawk

View File

@ -52,6 +52,9 @@ public class Commandpanel implements CommandExecutor {
//do console command command
if(args.length == 2){
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);
}else{
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;
//do player command
if (args.length == 1) {
if(plugin.openPanels.hasPanelOpen(p.getName())) {
plugin.openPanels.skipPanels.add(p.getName());
}
plugin.openVoids.openCommandPanel(sender, p, panelName, cf,false);
return true;
}else if(args.length == 2){
if (args[1].equals("item")) {
plugin.openVoids.giveHotbarItem(sender, p, cf, false);
}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);
}
return true;

View File

@ -34,6 +34,9 @@ public class Commandpanelcustom implements Listener {
for(String cmd : panelCommands){
if(cmd.equalsIgnoreCase(e.getMessage().replace("/", ""))){
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);
return;
}
@ -59,6 +62,9 @@ public class Commandpanelcustom implements Listener {
for(String[] placeholder : placeholders){
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);
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")))) {
e.setCancelled(true);
p.updateInventory();
if(plugin.openPanels.hasPanelOpen(p.getName())) {
plugin.openPanels.skipPanels.add(p.getName());
}
plugin.openVoids.openCommandPanel(p,p,tempName,tempFile,false);
return;
}
@ -366,6 +369,9 @@ public class UtilsOpenWithItem implements Listener {
if (p.getInventory().getHeldItemSlot() == Integer.parseInt(Objects.requireNonNull(tempFile.getString("open-with-item.stationary")))) {
e.setCancelled(true);
p.updateInventory();
if(plugin.openPanels.hasPanelOpen(p.getName())) {
plugin.openPanels.skipPanels.add(p.getName());
}
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"))){
String panelName = temp[0];
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;
}
}