Skip to content

Commit

Permalink
Fix class cast exception with food default chance
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyGalbreath committed Jan 29, 2022
1 parent 6eef61b commit b2849bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/server/0261-Configurable-food-attributes.patch
Expand Up @@ -69,7 +69,7 @@ index 513343d225a71e242b0f237eefcd25147709d9d1..1f65bba67cd4fab1dee115f24b213075
}
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 93429c792513f213dcc0c18373774943c0b0d7ad..a9dcc82be19c89c3d66c1662a0273fd763507287 100644
index 0075a0f744c860c68cbfe7efa5b8aa2b4a30c5b6..df7a687114789836e5248a88a43cfbc4d3c8a5ac 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -430,4 +430,57 @@ public class PurpurConfig {
Expand Down Expand Up @@ -115,7 +115,7 @@ index 93429c792513f213dcc0c18373774943c0b0d7ad..a9dcc82be19c89c3d66c1662a0273fd7
+ return;
+ }
+ food.getEffects().removeIf(pair -> pair.getFirst().getEffect() == effect);
+ float chance = (float) effects.getDouble(effectKey + ".chance", (double) effectDefaults.get("chance"));
+ float chance = (float) effects.getDouble(effectKey + ".chance", ((Float) effectDefaults.get("chance")).doubleValue());
+ int duration = effects.getInt(effectKey + ".duration", (int) effectDefaults.get("duration"));
+ if (chance <= 0.0F || duration < 0) {
+ return;
Expand Down

0 comments on commit b2849bc

Please sign in to comment.