diff --git a/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java b/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java index 3ef45bd39..e119201eb 100644 --- a/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java +++ b/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java @@ -104,7 +104,7 @@ public class GachaSystem extends BaseGameSystem { } total += weight; } - int roll = ThreadLocalRandom.current().nextInt((total < cutoff) ? total : cutoff); + int roll = ThreadLocalRandom.current().nextInt(Math.min(total, cutoff)); int subTotal = 0; for (int i = 0; i < weights.length; i++) { subTotal += weights[i]; diff --git a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomManager.java b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomManager.java index 8dfcaea69..d1f59bf99 100644 --- a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomManager.java +++ b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomManager.java @@ -118,7 +118,7 @@ public class BlossomManager { public void notifyIcon() { final int wl = getWorldLevel(); - final int worldLevel = (wl < 0) ? 0 : ((wl > 8) ? 8 : wl); + final int worldLevel = (wl < 0) ? 0 : (Math.min(wl, 8)); final var worldLevelData = GameData.getWorldLevelDataMap().get(worldLevel); final int monsterLevel = (worldLevelData != null) ? worldLevelData.getMonsterLevel() : 1; List blossoms = new ArrayList<>();