Remove check in favour of getOrDefault

This commit is contained in:
Cola
2024-03-17 00:31:39 +11:00
parent c2df9853a1
commit aeb62b048d

View File

@@ -40,9 +40,6 @@ public class SaplingHack extends SimpleHack<SaplingConfig> implements Listener {
return;
}
}
if (!this.config.getChanceMap().containsKey(brokenBlock.getType())) {
return;
}
double nextDouble = random.nextDouble();
if (nextDouble <= this.config.getChanceMap().getOrDefault(brokenBlock.getType(), 0.0D)) {
brokenBlock.getWorld().dropItemNaturally(brokenBlock.getLocation(), new ItemStack(getSaplingMaterial(brokenBlock.getType()), 1));