Skip to content

Commit

Permalink
Fix reported crash in discord.
Browse files Browse the repository at this point in the history
The crash can happen if the user has specified treasures but haven't defined the maximal amount of them.
  • Loading branch information
BONNe committed Oct 15, 2020
1 parent 71941b0 commit ed82f7c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private boolean processBlockReplacement(Block block, @Nullable GeneratorTierObje
// ask config if physics should be used
block.setType(newMaterial, this.addon.getSettings().isUsePhysics());

if (generatorTier.getTreasureChance() > 0 && !generatorTier.getTreasureChanceMap().isEmpty())
if (generatorTier.getMaxTreasureAmount() > 0 && generatorTier.getTreasureChance() > 0 && !generatorTier.getTreasureChanceMap().isEmpty())
{
// Random check on getting treasure.
if (this.random.nextDouble() <= generatorTier.getTreasureChance())
Expand Down

0 comments on commit ed82f7c

Please sign in to comment.