From 182717eacfc93361a57f2dcd2f84a1ec307acd29 Mon Sep 17 00:00:00 2001 From: Enderaoe Date: Tue, 9 Nov 2021 10:57:32 +0800 Subject: [PATCH] Fix issue #4105 Fishing shake percentage seems off. (#4649) --- .../com/gmail/nossr50/util/random/RandomChanceStatic.java | 4 ++-- .../java/com/gmail/nossr50/util/random/RandomChanceUtil.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/random/RandomChanceStatic.java b/src/main/java/com/gmail/nossr50/util/random/RandomChanceStatic.java index 3204a348d..0b09a4a3c 100644 --- a/src/main/java/com/gmail/nossr50/util/random/RandomChanceStatic.java +++ b/src/main/java/com/gmail/nossr50/util/random/RandomChanceStatic.java @@ -5,9 +5,9 @@ public class RandomChanceStatic implements RandomChanceExecution { private final double probabilityCap; private final boolean isLucky; - public RandomChanceStatic(double xPos, boolean isLucky) { + public RandomChanceStatic(double xPos, double probabilityCap, boolean isLucky) { this.xPos = xPos; - this.probabilityCap = xPos; + this.probabilityCap = probabilityCap; this.isLucky = isLucky; } diff --git a/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java b/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java index 67982ce59..0191172c1 100644 --- a/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java +++ b/src/main/java/com/gmail/nossr50/util/random/RandomChanceUtil.java @@ -282,10 +282,10 @@ public class RandomChanceUtil { } public static String @NotNull [] calculateAbilityDisplayValuesStatic(@NotNull Player player, @NotNull PrimarySkillType primarySkillType, double chance) { - RandomChanceStatic rcs = new RandomChanceStatic(chance, false); + RandomChanceStatic rcs = new RandomChanceStatic(chance, LINEAR_CURVE_VAR, false); double successChance = getRandomChanceExecutionChance(rcs); - RandomChanceStatic rcs_lucky = new RandomChanceStatic(chance, true); + RandomChanceStatic rcs_lucky = new RandomChanceStatic(chance, LINEAR_CURVE_VAR, true); double successChance_lucky = getRandomChanceExecutionChance(rcs_lucky); String[] displayValues = new String[2];