From 3c79dbf8c39dc8e56d8b2e624ee3af60961b6f05 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 21 Sep 2024 10:20:06 +0200 Subject: [PATCH] I was wrong of course --- src/main/java/eu/m724/giants/Configuration.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/m724/giants/Configuration.java b/src/main/java/eu/m724/giants/Configuration.java index 11b8d40..34ea6cb 100644 --- a/src/main/java/eu/m724/giants/Configuration.java +++ b/src/main/java/eu/m724/giants/Configuration.java @@ -85,7 +85,11 @@ public class Configuration { int min = (int) dropMap.get("quantityMin"); int max = (int) dropMap.get("quantityMax"); - double chance = (double) dropMap.get("chance"); + try { + double chance = (double) dropMap.get("chance"); + } catch (ClassCastException e) { // pointlessest error ever + double chance = ((Integer) dropMap.get("chance")).doubleValue(); + } drops.add(new Drop(itemStack, min, max, chance)); } catch (IllegalArgumentException e) {