Zairus / HermitQuest

HermitQuest - Defeat all the hermits
0 stars 0 forks source link

Setting spawn rarity to "0" crashes server #7

Open DigitalSketch opened 7 years ago

DigitalSketch commented 7 years ago

We're getting crashes with the builder's chest when it attempts to generate in the world. We've tested with with both Sponge and without. The error log is below:

http://pastebin.com/unsQ4V3t

Jamdog commented 7 years ago

This happens when the 'rarity' is set in the config files at zero, to try to spawn the block at every opportunity.

at zairus.hermitquest.biome.decorate.WorldGenBuildersChest.doGenerate(WorldGenBuildersChest.java:27)

A simple check for (rarity==0) in several places in the code should cure this issue, but maybe a sanity check of some kind should be added anyway, for all user-configurable values:

if (!(rarity==0) && !(rand.nextInt(rarity) == 0))