From 7ee23271cb066185bbb30e397e6d3a2ba2bac5fe Mon Sep 17 00:00:00 2001 From: devlrxxh Date: Sun, 31 Mar 2024 23:31:43 +0200 Subject: [PATCH] Removed debug code --- .../me/lrxh/practice/commands/user/duels/DuelCommand.java | 8 ++++---- .../me/lrxh/practice/duel/menu/DuelSelectArenaMenu.java | 4 ++++ .../me/lrxh/practice/duel/menu/DuelSelectKitMenu.java | 4 +++- src/main/java/me/lrxh/practice/util/InventoryUtil.java | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/me/lrxh/practice/commands/user/duels/DuelCommand.java b/src/main/java/me/lrxh/practice/commands/user/duels/DuelCommand.java index e1c4461..1af690c 100644 --- a/src/main/java/me/lrxh/practice/commands/user/duels/DuelCommand.java +++ b/src/main/java/me/lrxh/practice/commands/user/duels/DuelCommand.java @@ -41,10 +41,10 @@ public void execute(Player sender, String targetName) { return; } -// if (sender.getUniqueId().equals(target.getUniqueId())) { -// sender.sendMessage(CC.RED + "You cannot duel yourself."); -// return; -// } + if (sender.getUniqueId().equals(target.getUniqueId())) { + sender.sendMessage(CC.RED + "You cannot duel yourself."); + return; + } Profile senderProfile = Profile.getByUuid(sender.getUniqueId()); Profile targetProfile = Profile.getByUuid(target.getUniqueId()); diff --git a/src/main/java/me/lrxh/practice/duel/menu/DuelSelectArenaMenu.java b/src/main/java/me/lrxh/practice/duel/menu/DuelSelectArenaMenu.java index d7c4188..80f9c4e 100644 --- a/src/main/java/me/lrxh/practice/duel/menu/DuelSelectArenaMenu.java +++ b/src/main/java/me/lrxh/practice/duel/menu/DuelSelectArenaMenu.java @@ -103,6 +103,10 @@ public void clicked(Player player, ClickType clickType) { // Set closed by menu Menu.currentlyOpenedMenus.get(player.getName()).setClosedByMenu(true); + // Play Sound + + Button.playSuccess(player); + // Force close inventory player.closeInventory(); } diff --git a/src/main/java/me/lrxh/practice/duel/menu/DuelSelectKitMenu.java b/src/main/java/me/lrxh/practice/duel/menu/DuelSelectKitMenu.java index e757f00..045c338 100644 --- a/src/main/java/me/lrxh/practice/duel/menu/DuelSelectKitMenu.java +++ b/src/main/java/me/lrxh/practice/duel/menu/DuelSelectKitMenu.java @@ -33,7 +33,6 @@ public Filters getFilter() { return Filters.valueOf(Practice.getInstance().getMenusConfig().getString("DUEL.FILTER")); } - @Override public Map getButtons(Player player) { Map buttons = new HashMap<>(); @@ -87,6 +86,9 @@ public void clicked(Player player, ClickType clickType) { // Force close inventory player.closeInventory(); + // Play Sound + Button.playNeutral(player); + // Open arena selection menu new DuelSelectArenaMenu().openMenu(player); } diff --git a/src/main/java/me/lrxh/practice/util/InventoryUtil.java b/src/main/java/me/lrxh/practice/util/InventoryUtil.java index c287d72..8428315 100644 --- a/src/main/java/me/lrxh/practice/util/InventoryUtil.java +++ b/src/main/java/me/lrxh/practice/util/InventoryUtil.java @@ -40,9 +40,9 @@ public static int getMenuSize(int numberOfItems, boolean filling) { int slotsPerRow = 9; int rows = (int) Math.ceil((double) numberOfItems / slotsPerRow); rows = Math.max(rows, 1); - if(filling){ + if (filling) { return rows * slotsPerRow + 18; - }else{ + } else { return rows * slotsPerRow; } }