aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLulonaut <lulonaut@lulonaut.tech>2023-10-20 08:59:49 +0200
committerGitHub <noreply@github.com>2023-10-20 08:59:49 +0200
commitbf7467b5808a9868877b1766aa6a3bfa16c8f605 (patch)
tree029d21dcdb5a63eca4a02f5f6d8842fcfc5899aa
parent83220de1c5867f003c915999775794bee3686b8e (diff)
downloadNotEnoughUpdates-bf7467b5808a9868877b1766aa6a3bfa16c8f605.tar.gz
NotEnoughUpdates-bf7467b5808a9868877b1766aa6a3bfa16c8f605.tar.bz2
NotEnoughUpdates-bf7467b5808a9868877b1766aa6a3bfa16c8f605.zip
Fix drop chance in mob loot (#887)
Removes the cast to int, therefore adding back the decimal point to chances that require it (e.g. 40%)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/recipes/MobLootRecipe.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/recipes/MobLootRecipe.java b/src/main/java/io/github/moulberry/notenoughupdates/recipes/MobLootRecipe.java
index 3b9daaf2..41bfe443 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/recipes/MobLootRecipe.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/recipes/MobLootRecipe.java
@@ -27,7 +27,6 @@ import io.github.moulberry.notenoughupdates.NEUManager;
import io.github.moulberry.notenoughupdates.core.util.StringUtils;
import io.github.moulberry.notenoughupdates.miscfeatures.entityviewer.EntityViewer;
import io.github.moulberry.notenoughupdates.miscgui.GuiItemRecipe;
-import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer;
import io.github.moulberry.notenoughupdates.profileviewer.Panorama;
import io.github.moulberry.notenoughupdates.util.ItemUtils;
import io.github.moulberry.notenoughupdates.util.JsonUtils;
@@ -81,9 +80,9 @@ public class MobLootRecipe implements NeuRecipe {
}
String chanceText = chance.substring(0, chance.length() - 1);
- int chanceIn;
+ double chanceIn;
try {
- chanceIn = (int) (100.0 / Double.parseDouble(chanceText));
+ chanceIn = (100.0 / Double.parseDouble(chanceText));
} catch (NumberFormatException e) {
return chance;
}