This commit is contained in:
rockyhawk64 2021-08-11 20:54:43 +10:00
parent b9854fa6e9
commit d55008e18c
3 changed files with 10 additions and 7 deletions

View File

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

View File

@ -41,11 +41,6 @@ public class Utils implements Listener {
//set the panel to the top panel //set the panel to the top panel
Panel panel = plugin.openPanels.getOpenPanel(p.getName(),PanelPosition.Top); Panel panel = plugin.openPanels.getOpenPanel(p.getName(),PanelPosition.Top);
if(e.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY){
e.setCancelled(true);
return;
}
if(e.getSlotType() == InventoryType.SlotType.OUTSIDE){ if(e.getSlotType() == InventoryType.SlotType.OUTSIDE){
//if the panel is clicked on the outside area of the GUI //if the panel is clicked on the outside area of the GUI
if (panel.getConfig().contains("outside-commands")) { if (panel.getConfig().contains("outside-commands")) {
@ -60,6 +55,13 @@ public class Utils implements Listener {
PanelPosition position = PanelPosition.Top; PanelPosition position = PanelPosition.Top;
if(e.getClickedInventory().getType() == InventoryType.PLAYER) { if(e.getClickedInventory().getType() == InventoryType.PLAYER) {
//cancel the event and return, stops items going from players inventory to the panels
if(e.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY){
e.setCancelled(true);
return;
}
//do player or panel inventory checks
if (e.getSlotType() == InventoryType.SlotType.CONTAINER) { if (e.getSlotType() == InventoryType.SlotType.CONTAINER) {
if(plugin.openPanels.hasPanelOpen(p.getName(),PanelPosition.Middle)) { if(plugin.openPanels.hasPanelOpen(p.getName(),PanelPosition.Middle)) {
position = PanelPosition.Middle; position = PanelPosition.Middle;
@ -108,6 +110,7 @@ public class Utils implements Listener {
} }
} }
//updates the inventory to stop item glitches
e.setCancelled(true); e.setCancelled(true);
p.updateInventory(); p.updateInventory();

View File

@ -218,7 +218,7 @@ public class OpenGUI {
return false; return false;
} }
try { try {
int d = Integer.parseInt(strNum); int unused = Integer.parseInt(strNum);
} catch (NumberFormatException nfe) { } catch (NumberFormatException nfe) {
return false; return false;
} }