Skip to content

Commit

Permalink
Only give them the display item as a reward if prize commands are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Apr 29, 2024
1 parent 2686dfa commit 1bee7c9
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ public static void givePrize(Player player, Prize prize, Crate crate) {
}
}
} else {
if (!MiscUtils.isInventoryFull(player)) {
player.getInventory().addItem(prize.getDisplayItem(player));
} else {
player.getWorld().dropItemNaturally(player.getLocation(), prize.getDisplayItem(player));
// Only give them the display item as a reward if prize commands are empty.
if (crate.getPrizeCommands().isEmpty()) {
if (!MiscUtils.isInventoryFull(player)) {
player.getInventory().addItem(prize.getDisplayItem(player));
} else {
player.getWorld().dropItemNaturally(player.getLocation(), prize.getDisplayItem(player));
}
}
}

Expand Down

0 comments on commit 1bee7c9

Please sign in to comment.