rutgerkok / WorldGeneratorApi

Minecraft Spigot plugin that enables other plugins to customize world generation
MIT License
95 stars 9 forks source link

getBiome method in a Decoration implementation #17

Closed romsto closed 4 years ago

romsto commented 4 years ago

Describe the bug While addind a custom world decorator, I get a NullPointerException on the DecorationArea#getBiome method. It worked well before I update to 1.16.2

How I change the world generation On the event: `WorldGenerator worldGenerator = event.getWorldGenerator();

    // Custom biome generator
    worldGenerator.setBiomeGenerator(new HGBiomeGenerator(worldGenerator.getBiomeGenerator()));

    // Remove Lakes, add Custom decorations (mushrooms)
    worldGenerator.getWorldDecorator().withoutDefaultDecorations(DecorationType.LAKES).withCustomDecoration(DecorationType.TOP_LAYER_MODIFICATION, new MushroomsPopulator());
`

Error net.minecraft.server.v1_16_R2.ReportedException: Exception generating new chunk at net.minecraft.server.v1_16_R2.MinecraftServer.initWorld(MinecraftServer.java:503) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at org.bukkit.craftbukkit.v1_16_R2.CraftServer.createWorld(CraftServer.java:1148) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at org.bukkit.Bukkit.createWorld(Bukkit.java:570) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at org.bukkit.WorldCreator.createWorld(WorldCreator.java:325) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.mystipvp.hardcoregenerator.WorldPregenerator.generateNewMap(WorldPregenerator.java:146) ~[?:?] at net.mystipvp.hardcoregenerator.WorldPregenerator.createNewMap(WorldPregenerator.java:150) ~[?:?] at net.mystipvp.hardcoregenerator.WorldPregenerator.begin(WorldPregenerator.java:49) ~[?:?] at net.mystipvp.hardcoregenerator.Generator.lambda$onEnable$0(Generator.java:36) ~[?:?] at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftTask.run(CraftTask.java:99) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at org.bukkit.craftbukkit.v1_16_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1296) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:375) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1211) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:999) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at java.lang.Thread.run(Thread.java:832) [?:?] Caused by: java.lang.NullPointerException at org.bukkit.craftbukkit.v1_16_R2.util.CraftNamespacedKey.fromMinecraft(CraftNamespacedKey.java:24) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at org.bukkit.craftbukkit.v1_16_R2.block.CraftBlock.biomeBaseToBiome(CraftBlock.java:512) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at nl.rutgerkok.worldgeneratorapi.internal.DecorationAreaImpl.getBiome(DecorationAreaImpl.java:97) ~[?:?] at net.mystipvp.hardcoregenerator.customgeneration.MushroomsPopulator.decorate(MushroomsPopulator.java:16) ~[?:?] at nl.rutgerkok.worldgeneratorapi.internal.WorldDecoratorImpl.spawnDecorations(WorldDecoratorImpl.java:195) ~[?:?] at nl.rutgerkok.worldgeneratorapi.internal.bukkitoverrides.InjectedChunkGenerator.addDecorations(InjectedChunkGenerator.java:240) ~[?:?] at net.minecraft.server.v1_16_R2.ChunkStatus.lambda$static$9(ChunkStatus.java:71) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.ChunkStatus.a(ChunkStatus.java:193) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.PlayerChunkMap.lambda$b$39(PlayerChunkMap.java:1222) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.PlayerChunkMap.lambda$b$41(PlayerChunkMap.java:1220) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146) ~[?:?] at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?] at net.minecraft.server.v1_16_R2.ChunkTaskQueueSorter.b(SourceFile:58) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.ThreadedMailbox.e(ThreadedMailbox.java:90) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.ThreadedMailbox.a(ThreadedMailbox.java:137) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at net.minecraft.server.v1_16_R2.ThreadedMailbox.run(ThreadedMailbox.java:102) ~[patched_1.16.2.jar:git-Paper-"dccaf59a0"] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?] ... 1 more

rutgerkok commented 4 years ago

Should be fixed in build 18 ( https://ci.codemc.io/job/rutgerkok/job/WorldGeneratorApi/ ).