From f1275d9ae166151524e360c17cfb8d7499116c43 Mon Sep 17 00:00:00 2001 From: Ghzdude <44148655+ghzdude@users.noreply.github.com> Date: Sun, 4 Aug 2024 23:55:19 -0700 Subject: [PATCH] simplify initial rng slightly --- .../api/recipes/chance/output/ChancedOutputLogic.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/api/recipes/chance/output/ChancedOutputLogic.java b/src/main/java/gregtech/api/recipes/chance/output/ChancedOutputLogic.java index b7461ec7979..48735fca675 100644 --- a/src/main/java/gregtech/api/recipes/chance/output/ChancedOutputLogic.java +++ b/src/main/java/gregtech/api/recipes/chance/output/ChancedOutputLogic.java @@ -165,9 +165,9 @@ static int getChance(@NotNull ChancedOutput entry, @NotNull ChanceBoostFuncti */ static > boolean passesChance(int chance, T entry, @Nullable Map cache) { if (cache == null || !cache.containsKey(entry.getIngredient())) { - int initial = GTValues.RNG.nextInt(entry.getMaxChance() + 1); + int initial = GTValues.RNG.nextInt(entry.getMaxChance()); updateCachedChance(entry.getIngredient(), cache, initial); - return GTValues.RNG.nextInt(entry.getMaxChance()) <= entry.getChance(); + return initial <= entry.getChance(); } int fullChance = getCachedChance(entry, cache) + chance;