v3.15.5.3

This commit is contained in:
rockyhawk64 2021-05-17 20:03:46 +10:00
parent 58af388ab0
commit d0f28a11a5
4 changed files with 23 additions and 4 deletions

View File

@ -150,8 +150,15 @@ public class Utils implements Listener {
//end custom command PlaceHolders
//do commands
String command = plugin.tex.papi(panel,p,commands.get(i));
//make the command
String command;
if(commands.get(i).split("\\s")[0].equalsIgnoreCase("nopapi=")){
//won't parse PAPI placeholders
command = plugin.tex.papi(plugin.placeholders.setCpPlaceholders(panel,p,commands.get(i))).replace("nopapi=","").trim();
}else{
//will parse every placeholder
command = plugin.tex.papi(panel,p,commands.get(i));
}
int val = plugin.commandTags.commandPayWall(p,command);
if(val == 0){

View File

@ -62,8 +62,6 @@ public class ExecuteOpenVoids {
try {
//create and open the GUI
plugin.createGUI.openGui(panel, p,1,0);
//open the panel
plugin.openPanels.openPanelForLoader(p.getName(), panel);
//execute commands once the panel opens
if (panel.getConfig().contains("commands-on-open")) {

View File

@ -160,6 +160,8 @@ public class OpenGUI {
}
if (onOpen == 1 || onOpen == 3) {
//onOpen 1 is default and 3 is for the editor
//open the panel
plugin.openPanels.openPanelForLoader(p.getName(), panel);
p.openInventory(i);
} else if (onOpen == 0) {
//onOpen 0 will just refresh the panel

View File

@ -4,9 +4,11 @@ import me.rockyhawk.commandpanels.CommandPanels;
import me.rockyhawk.commandpanels.ioclasses.NBTEditor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
@ -55,4 +57,14 @@ public class UtilsPanelsLoader implements Listener {
}
}
}
//if the regular InventoryOpenEvent is called
@EventHandler(priority = EventPriority.HIGHEST)
public void vanillaOpenedEvent(InventoryOpenEvent e){
if(e.isCancelled()) {
if (plugin.openPanels.hasPanelOpen(e.getPlayer().getName())) {
plugin.openPanels.closePanelForLoader(e.getPlayer().getName());
}
}
}
}