Skip to content

Commit

Permalink
Removed debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
Devlrxxh committed Mar 31, 2024
1 parent 08b6734 commit 7ee2327
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public Filters getFilter() {
return Filters.valueOf(Practice.getInstance().getMenusConfig().getString("DUEL.FILTER"));
}


@Override
public Map<Integer, Button> getButtons(Player player) {
Map<Integer, Button> buttons = new HashMap<>();
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/lrxh/practice/util/InventoryUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 7ee2327

Please sign in to comment.