From 918ee11ee58112ac2302c079113e8e3019f619cb Mon Sep 17 00:00:00 2001 From: Trixkz Date: Thu, 26 Oct 2023 22:57:38 -0400 Subject: [PATCH] Fixed Some Bugs and Added The Inventory Inspect Feature In The Staff Management System --- .../eventcore/listeners/StaffModeListener.java | 8 ++++++-- .../eventcore/menusystem/menus/ChatManagementMenu.java | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/loganmagnan/eventcore/listeners/StaffModeListener.java b/src/main/java/com/loganmagnan/eventcore/listeners/StaffModeListener.java index cea5113..b8920ac 100644 --- a/src/main/java/com/loganmagnan/eventcore/listeners/StaffModeListener.java +++ b/src/main/java/com/loganmagnan/eventcore/listeners/StaffModeListener.java @@ -151,7 +151,9 @@ public class StaffModeListener implements Listener { return; } - if (itemStack.getType() == Material.BOOK) { + event.setCancelled(true); + + if (itemStack.getType() != Material.BOOK) { return; } @@ -159,7 +161,9 @@ public class StaffModeListener implements Listener { return; } - event.setCancelled(true); + Player target = (Player) event.getRightClicked(); + + player.openInventory(target.getInventory()); } @EventHandler diff --git a/src/main/java/com/loganmagnan/eventcore/menusystem/menus/ChatManagementMenu.java b/src/main/java/com/loganmagnan/eventcore/menusystem/menus/ChatManagementMenu.java index d7ee853..b4bfb2b 100644 --- a/src/main/java/com/loganmagnan/eventcore/menusystem/menus/ChatManagementMenu.java +++ b/src/main/java/com/loganmagnan/eventcore/menusystem/menus/ChatManagementMenu.java @@ -45,7 +45,9 @@ public class ChatManagementMenu extends Menu { break; case SOUL_SAND: - if (event.getClick().isLeftClick()) { + if (event.getClick().isShiftClick()) { + this.main.getChatManager().slowChat(player, this.delayAmount); + } else if (event.getClick().isLeftClick()) { this.delayAmount++; } else if (event.getClick().isRightClick()) { if (this.delayAmount <= 0) { @@ -53,8 +55,6 @@ public class ChatManagementMenu extends Menu { } this.delayAmount--; - } else if (event.getClick().isShiftClick()) { - this.main.getChatManager().slowChat(player, this.delayAmount); } break; @@ -94,7 +94,7 @@ public class ChatManagementMenu extends Menu { "&fSlowed By: &b" + (this.main.getChatManager().getSlowedBy() == null ? "None" : this.main.getServer().getOfflinePlayer(this.main.getChatManager().getSlowedBy()).getName()), "&fLast Slowed: &b" + (this.main.getChatManager().getLastSlowedTime() == 0 ? "Never" : Utils.getTimeAsAString(this.main.getChatManager().getLastSlowedTime())), "", - "&bShift click to slow the chat for &3" + (this.delayAmount + " second" + (this.delayAmount > 1 ? "s" : "")), + "&bShift click to slow the chat for &3" + (this.delayAmount + " &bsecond" + (this.delayAmount > 1 ? "s" : "")), "", "&fLeft Click: &b+1", "&fRight Click: &b-1"