Skip to content

Commit

Permalink
Add some switch defaults to make Codacy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
addstar committed Mar 3, 2024
1 parent 023e749 commit cf22602
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Minigames/src/main/java/au/com/mineauz/minigames/Events.java
Original file line number Diff line number Diff line change
Expand Up @@ -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*/ -> {
Expand All @@ -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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down Expand Up @@ -276,6 +279,8 @@ public List<String> onTabComplete(@NotNull CommandSender sender, @Nullable Minig
} // not a number
} // not add / set
} // more than 4 arguments
default -> {
} // do nothing
} // end switch
} // args == null

Expand Down

0 comments on commit cf22602

Please sign in to comment.