diff --git a/resource/plugin.yml b/resource/plugin.yml index 26c72d8..b8170b3 100644 --- a/resource/plugin.yml +++ b/resource/plugin.yml @@ -1,4 +1,4 @@ -version: 3.16.2.1 +version: 3.16.2.2 main: me.rockyhawk.commandpanels.CommandPanels name: CommandPanels author: RockyHawk diff --git a/src/me/rockyhawk/commandpanels/interactives/input/UserInputUtils.java b/src/me/rockyhawk/commandpanels/interactives/input/UserInputUtils.java index 6b65278..a505ce9 100644 --- a/src/me/rockyhawk/commandpanels/interactives/input/UserInputUtils.java +++ b/src/me/rockyhawk/commandpanels/interactives/input/UserInputUtils.java @@ -32,6 +32,14 @@ public class UserInputUtils implements Listener { return; } playerInput.get(e.getPlayer()).panel.placeholders.addPlaceholder("player-input",e.getMessage()); + + //get certain words from the input + int c = 0; + for(String message : e.getMessage().split("\\s")){ + playerInput.get(e.getPlayer()).panel.placeholders.addPlaceholder("player-input-" + (c+1),message); + c++; + } + plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { public void run() { plugin.commandTags.runCommands(playerInput.get(e.getPlayer()).panel, PanelPosition.Top,e.getPlayer(), playerInput.get(e.getPlayer()).commands); //I have to do this to run regular Bukkit voids in an ASYNC Event diff --git a/src/me/rockyhawk/commandpanels/openpanelsmanager/OpenGUI.java b/src/me/rockyhawk/commandpanels/openpanelsmanager/OpenGUI.java index fc9dd63..fe6467a 100644 --- a/src/me/rockyhawk/commandpanels/openpanelsmanager/OpenGUI.java +++ b/src/me/rockyhawk/commandpanels/openpanelsmanager/OpenGUI.java @@ -43,6 +43,13 @@ public class OpenGUI { } }else{ i = p.getInventory(); + //if middle or bottom position, old items need to be cleared + for (int c = 0; getInvSize(i,position) > c; ++c) { + if(pconfig.getConfigurationSection("item").getKeys(false).contains(String.valueOf(c))){ + continue; + } + setItem(null, c, i, p, position); + } } Set itemList = pconfig.getConfigurationSection("item").getKeys(false);