From cf2260286744961d1b415a59bccdfcc432cf8c1b Mon Sep 17 00:00:00 2001 From: addstar Date: Sun, 3 Mar 2024 21:25:13 +1100 Subject: [PATCH] Add some switch defaults to make Codacy happy --- Minigames/src/main/java/au/com/mineauz/minigames/Events.java | 4 ++-- .../java/au/com/mineauz/minigames/commands/ScoreCommand.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Minigames/src/main/java/au/com/mineauz/minigames/Events.java b/Minigames/src/main/java/au/com/mineauz/minigames/Events.java index 048106043..cc63a3a78 100644 --- a/Minigames/src/main/java/au/com/mineauz/minigames/Events.java +++ b/Minigames/src/main/java/au/com/mineauz/minigames/Events.java @@ -664,8 +664,6 @@ private void clickMenu(InventoryClickEvent event) { } else if (!mgPlayer.getMenu().getAllowModify()) { Inventory topInv = event.getView().getTopInventory(); switch (event.getAction()) { - case NOTHING, DROP_ALL_CURSOR, DROP_ONE_CURSOR, UNKNOWN -> { - } // nothing case PICKUP_ALL, PICKUP_SOME, PICKUP_HALF, PICKUP_ONE, DROP_ALL_SLOT, DROP_ONE_SLOT, HOTBAR_MOVE_AND_READD, // may take PLACE_ALL, PLACE_SOME, PLACE_ONE, /*may place*/ SWAP_WITH_CURSOR, HOTBAR_SWAP /*may give and take*/ -> { @@ -681,6 +679,8 @@ private void clickMenu(InventoryClickEvent event) { case MOVE_TO_OTHER_INVENTORY -> { event.setCancelled(true); } // definitely one or the other + default -> { + } // do nothing for any other action } } diff --git a/Minigames/src/main/java/au/com/mineauz/minigames/commands/ScoreCommand.java b/Minigames/src/main/java/au/com/mineauz/minigames/commands/ScoreCommand.java index bca014fa8..b15db076f 100644 --- a/Minigames/src/main/java/au/com/mineauz/minigames/commands/ScoreCommand.java +++ b/Minigames/src/main/java/au/com/mineauz/minigames/commands/ScoreCommand.java @@ -230,6 +230,9 @@ public boolean onCommand(@NotNull CommandSender sender, @Nullable Minigame minig return true; } // end case + default -> { + sender.sendMessage(ChatColor.RED + "Invalid argument!"); + } } // end switch } else { sender.sendMessage(ChatColor.RED + "Not enough arguments!"); @@ -276,6 +279,8 @@ public List onTabComplete(@NotNull CommandSender sender, @Nullable Minig } // not a number } // not add / set } // more than 4 arguments + default -> { + } // do nothing } // end switch } // args == null