diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java index 1dee05289..9fc120dcc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java @@ -80,7 +80,13 @@ public class ResourceManager { int value = resource.getDefaultSupply(world.getEnvironment(), block.getBiome()); if (value > 0) { - value += ThreadLocalRandom.current().nextInt(resource.getMaxDeviation()); + int bound = resource.getMaxDeviation(); + + if (bound <= 0) { + throw new IllegalStateException("GEO Resource \"" + resource.getKey() + "\" was misconfigured! getMaxDeviation() must return a value higher than zero!"); + } + + value += ThreadLocalRandom.current().nextInt(bound); } GEOResourceGenerationEvent event = new GEOResourceGenerationEvent(world, block.getBiome(), x, z, resource, value);