Skip to content

Commit

Permalink
use existing this.sum
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Sep 27, 2024
1 parent 880ff53 commit 5cdc111
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,7 @@ public final Prize pickPrize(@NotNull final Player player, @NotNull final Tier t
* @return {@link Prize}
*/
private Prize getPrize(@NotNull final List<Prize> prizes, @NotNull final Random random) {
double weight = 0.0;

for (Prize itemDrop : prizes) {
weight += itemDrop.getWeight();
}
double weight = this.sum;

int index = 0;

Expand Down

0 comments on commit 5cdc111

Please sign in to comment.