NPE with Mystcraft/Cauldron
becast opened this issue ยท 2 comments
We run a Server with Cauldron, if you log out in a Mystcraft world and log back in the server Crashes with an NPE while setting the difficulty in Loot.java:130
switch(difficulty){
case EASY: enchant = rand.nextInt(5) == 0; break;
case NORMAL: enchant = level == 3 || rand.nextBoolean(); break;
case HARD: enchant = true; break;
default: enchant = true;
}
Seems like in the combination of Mystcraft and Cauldron the difficulty is NULL on login in Mystcraft. A NULL check and fallback to "Normal" should be implemented to prevent the issue.
Ahh thanks, i'll put that in. for some reason i suppose i foolishly assumed null would result in default being switched to.