Fixed crash for custom Noise Generators (#85)
This commit is contained in:
parent
513fea6968
commit
0ed7fa9dcc
1 changed files with 5 additions and 2 deletions
|
@ -501,8 +501,11 @@ public class BiomeAPI {
|
||||||
.worldGenSettings()
|
.worldGenSettings()
|
||||||
.dimensions()
|
.dimensions()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(dim->dim.generator().getSettings()==settings)
|
.map(dim->dim.generator())
|
||||||
.map(dim->((NoiseGeneratorSettingsProvider)dim.generator()).bclib_getNoiseGeneratorSettings()).findFirst().orElse(null);;
|
.filter(gen->gen.getSettings()==settings && (gen instanceof NoiseGeneratorSettingsProvider))
|
||||||
|
.map(gen->((NoiseGeneratorSettingsProvider)gen).bclib_getNoiseGeneratorSettings())
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
// Datapacks (like Amplified Nether)will change the GeneratorSettings upon load, so we will
|
// Datapacks (like Amplified Nether)will change the GeneratorSettings upon load, so we will
|
||||||
// only use the default Setting for Nether/End if we were unable to find a settings object
|
// only use the default Setting for Nether/End if we were unable to find a settings object
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue