Zemelua Posted August 14, 2021 Share Posted August 14, 2021 I implement a custom biome in a custom dimension and it crashes when I try to enter the custom dimension with /execute in umu_arcanum: the_silence run tp 0 0 0 (Unknown biome id emitted by layers: 174). I've referred to some mods that implement custom biomes in custom dimensions, but I'm not sure why this error is occurring. Here is my code: https://github.com/Zemelua/UMU-Arcanum Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 14, 2021 Share Posted August 14, 2021 post full log please, but i think your Biome is not registered with an ID, because the vanilla Biome IDs end with 173 so 174 is a modded biome Note: if you using the vanilla biome layer system it can lead problems if two mods are register a biome with the same id Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 full log: Spoiler [19:42:17] [Worker-Main-22/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 92db45c1-d8e1-49fa-be0e-c02dfd3f4eba [19:42:17] [Worker-Main-18/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 2d8b4bae-3a4d-49b4-bfad-2b32b3765f20 [19:42:17] [Worker-Main-9/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID d7c7353e-4720-4ac3-8086-079d656b273a [19:42:17] [Worker-Main-18/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID b9e7dab1-685c-42ac-b48c-5fe63eff6517 [19:42:17] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game... [19:42:17] [Worker-Main-18/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID c881d047-5329-4c02-9cf9-7e3a81489477 [19:42:17] [Worker-Main-9/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 1d26522a-3428-4fce-b2f4-8e0e7111e77b [19:42:17] [Worker-Main-22/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID aeec4a9d-8afb-487a-8d52-0a23b9733f55 [19:42:17] [Worker-Main-18/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID a6c3ea56-cc91-43bd-9b54-84ae2c5a8779 [19:42:17] [Worker-Main-9/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID f43fccee-1c97-4127-9ac5-80633859a1e6 [19:42:17] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld [19:42:17] [Render thread/INFO] [minecraft/NewChatGui]: [CHAT] An unexpected error occurred trying to execute that command [19:42:18] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether [19:42:18] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end [19:42:18] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/umu_arcanum:the_silence [19:42:18] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception java.util.concurrent.CompletionException: net.minecraft.crash.ReportedException: Exception generating new chunk at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) ~[?:1.8.0_292] {} at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) ~[?:1.8.0_292] {} at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:975) ~[?:1.8.0_292] {} at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:940) ~[?:1.8.0_292] {} at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456) ~[?:1.8.0_292] {} at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.lambda$null$1(ChunkTaskPriorityQueueSorter.java:44) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:88) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:132) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:100) ~[forge:?] {re:classloading} at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402) ~[?:1.8.0_292] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_292] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_292] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_292] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_292] {} Caused by: net.minecraft.crash.ReportedException: Exception generating new chunk at net.minecraft.world.server.ChunkManager.lambda$null$18(ChunkManager.java:552) ~[forge:?] {re:classloading} at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-4.0.26.jar:?] {re:classloading} at net.minecraft.world.server.ChunkManager.lambda$chunkGenerate$20(ChunkManager.java:539) ~[forge:?] {re:classloading} at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:966) ~[?:1.8.0_292] {} ... 11 more Caused by: java.lang.IllegalStateException: Unknown biome id emitted by layers: 174 at net.minecraft.world.gen.layer.Layer.func_242936_a(Layer.java:26) ~[forge:?] {re:classloading} at io.github.zemelua.umu_arcanum.world.biome.SilenceBiomeProvider.getNoiseBiome(SilenceBiomeProvider.java:58) ~[?:?] {re:classloading} at net.minecraft.world.gen.ChunkGenerator.func_242707_a(ChunkGenerator.java:230) ~[forge:?] {re:classloading} at net.minecraft.world.chunk.ChunkStatus.lambda$static$2(ChunkStatus.java:41) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.chunk.ChunkStatus.doGenerationWork(ChunkStatus.java:198) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ChunkManager.lambda$null$18(ChunkManager.java:541) ~[forge:?] {re:classloading} at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-4.0.26.jar:?] {re:classloading} at net.minecraft.world.server.ChunkManager.lambda$chunkGenerate$20(ChunkManager.java:539) ~[forge:?] {re:classloading} at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:966) ~[?:1.8.0_292] {} ... 11 more [19:42:18] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 36f9fdec-1f6a-41ab-9a2b-f388ef3706de When I registered in data/modid/worldgen/biome/biome.json, I thought that I didn't need to use DeferredRegister, but I got the same error when I didn't use DeferredRegister. No other mods have been introduced. Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 14, 2021 Share Posted August 14, 2021 no not register with DeferredRegister you need to add your Biome to BiomeRegistry.TO_NAME Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 What is BiomeRegistry.TO_NAME? There are no such methods or fields in the BiomeRegistry class ... Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 14, 2021 Share Posted August 14, 2021 did you using mcp or moj mappings? Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 I'm using Intellij IDEA's Minecraft Develoment Plugin, so I'm not sure which map I'm using. Probably mcp. WorldGenRegistrys has a static field Map <ResourceLocation, Supplier<?>> REGISTRY_NAME_TO_DEFAULT, which is private access. It looks like there are no other methods to access. Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 14, 2021 Share Posted August 14, 2021 thats the wrong class and the wrong object type its: net.minecraft.world.biome.BiomeRegistry.idToKeyMap or net.minecraft.world.biome.BiomeRegistry.TO_NAME which is a Int2ObjectMap Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 I found net.minecraft.world.biome.BiomeRegistry.idToKeyMap but it's private access. There are no other methods to access. According to this , registration should be done just by putting the json file. I think I'm putting the json file in the right place, but what's wrong ... Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 14, 2021 Share Posted August 14, 2021 no the normal registration is via json or DeferredRegister but you should register an id for your biome use Refection or an Access Transformers do this in FMLCommonSetupEvent Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 understood. Will this be available in a future forge version or 1.17 without reflection? Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 public UMUArcanum() { UMUArcanumBiomes.initialize(); UMUArcanumDimensions.initialize(); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onFMLCommonSetup); } public void onFMLCommonSetup(final FMLCommonSetupEvent event) { try { Field field = BiomeRegistry.class.getDeclaredField("idToKeyMap"); Int2ObjectMap<RegistryKey<Biome>> map = (Int2ObjectMap<RegistryKey<Biome>>) field.get(null); map.put(174, UMUArcanumBiomes.DIM_FOREST); } catch (NoSuchFieldException exception) { exception.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } Well, I still get the error. What should i do? Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 14, 2021 Share Posted August 14, 2021 post the error log... Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 3 hours ago, Zemelua said: full log: Hide contents [19:42:17] [Worker-Main-22/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 92db45c1-d8e1-49fa-be0e-c02dfd3f4eba [19:42:17] [Worker-Main-18/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 2d8b4bae-3a4d-49b4-bfad-2b32b3765f20 [19:42:17] [Worker-Main-9/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID d7c7353e-4720-4ac3-8086-079d656b273a [19:42:17] [Worker-Main-18/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID b9e7dab1-685c-42ac-b48c-5fe63eff6517 [19:42:17] [Server thread/INFO] [minecraft/IntegratedServer]: Saving and pausing game... [19:42:17] [Worker-Main-18/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID c881d047-5329-4c02-9cf9-7e3a81489477 [19:42:17] [Worker-Main-9/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 1d26522a-3428-4fce-b2f4-8e0e7111e77b [19:42:17] [Worker-Main-22/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID aeec4a9d-8afb-487a-8d52-0a23b9733f55 [19:42:17] [Worker-Main-18/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID a6c3ea56-cc91-43bd-9b54-84ae2c5a8779 [19:42:17] [Worker-Main-9/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID f43fccee-1c97-4127-9ac5-80633859a1e6 [19:42:17] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld [19:42:17] [Render thread/INFO] [minecraft/NewChatGui]: [CHAT] An unexpected error occurred trying to execute that command [19:42:18] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether [19:42:18] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end [19:42:18] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[New World]'/umu_arcanum:the_silence [19:42:18] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception java.util.concurrent.CompletionException: net.minecraft.crash.ReportedException: Exception generating new chunk at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) ~[?:1.8.0_292] {} at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) ~[?:1.8.0_292] {} at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:975) ~[?:1.8.0_292] {} at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:940) ~[?:1.8.0_292] {} at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:456) ~[?:1.8.0_292] {} at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.lambda$null$1(ChunkTaskPriorityQueueSorter.java:44) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:88) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:132) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:100) ~[forge:?] {re:classloading} at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402) ~[?:1.8.0_292] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_292] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_292] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_292] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_292] {} Caused by: net.minecraft.crash.ReportedException: Exception generating new chunk at net.minecraft.world.server.ChunkManager.lambda$null$18(ChunkManager.java:552) ~[forge:?] {re:classloading} at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-4.0.26.jar:?] {re:classloading} at net.minecraft.world.server.ChunkManager.lambda$chunkGenerate$20(ChunkManager.java:539) ~[forge:?] {re:classloading} at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:966) ~[?:1.8.0_292] {} ... 11 more Caused by: java.lang.IllegalStateException: Unknown biome id emitted by layers: 174 at net.minecraft.world.gen.layer.Layer.func_242936_a(Layer.java:26) ~[forge:?] {re:classloading} at io.github.zemelua.umu_arcanum.world.biome.SilenceBiomeProvider.getNoiseBiome(SilenceBiomeProvider.java:58) ~[?:?] {re:classloading} at net.minecraft.world.gen.ChunkGenerator.func_242707_a(ChunkGenerator.java:230) ~[forge:?] {re:classloading} at net.minecraft.world.chunk.ChunkStatus.lambda$static$2(ChunkStatus.java:41) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.chunk.ChunkStatus.doGenerationWork(ChunkStatus.java:198) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ChunkManager.lambda$null$18(ChunkManager.java:541) ~[forge:?] {re:classloading} at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-4.0.26.jar:?] {re:classloading} at net.minecraft.world.server.ChunkManager.lambda$chunkGenerate$20(ChunkManager.java:539) ~[forge:?] {re:classloading} at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:966) ~[?:1.8.0_292] {} ... 11 more [19:42:18] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 36f9fdec-1f6a-41ab-9a2b-f388ef3706de same. Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 14, 2021 Share Posted August 14, 2021 (edited) you get the same error beacuse you never call setAccessible for the Field Edited August 14, 2021 by Luis_ST Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 public void onFMLCommonSetup(final FMLCommonSetupEvent event) { try { Field field = BiomeRegistry.class.getDeclaredField("idToKeyMap"); field.setAccessible(true); Int2ObjectMap<RegistryKey<Biome>> map = (Int2ObjectMap<RegistryKey<Biome>>) field.get(null); map.put(174, UMUArcanumBiomes.DIM_FOREST); } catch (NoSuchFieldException exception) { exception.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } I still get the same error. What's wrong...... Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 14, 2021 Share Posted August 14, 2021 you also need to set the field you only get the field from the class Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 public void onFMLCommonSetup(final FMLCommonSetupEvent event) { try { Field field = BiomeRegistry.class.getDeclaredField("idToKeyMap"); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.PRIVATE & ~Modifier.FINAL); Int2ObjectMap<RegistryKey<Biome>> map = (Int2ObjectMap<RegistryKey<Biome>>) field.get(null); map.put(174, UMUArcanumBiomes.DIM_FOREST); field.set(null, map); LOGGER.warn(field.get(null).toString()); } catch (NoSuchFieldException exception) { exception.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } Is it like this? I still get the error ... Quote Link to comment Share on other sites More sharing options...
Luis_ST Posted August 14, 2021 Share Posted August 14, 2021 26 minutes ago, diesieben07 said: Luis, what the F are you doing. This is not Minecraft 1.2.5 where you register things by ID. The only issue here is that you never register your Biome, because you do not register the DeferredRegister to the event bus. Once that is fixed the code in the Git repo works just fine without any reflection or ID hacks. did you know how the Biome Layer works, did you looked at the vanilla code, sounds like you don't knw much about the biome layer they still use the ids which is why i hate this system, but forge dosen't has a BiomeProvider/BiomeSource which make this easly 29 minutes ago, diesieben07 said: and just use the IDs of your biome as obtained from ForgeRegistries.BIOMES forge has biome IDs? Quote Link to comment Share on other sites More sharing options...
Zemelua Posted August 14, 2021 Author Share Posted August 14, 2021 ahhh, I was really stupid. I've used Deferred Register many times before, but forgot to register it this time. Luis, diesieben, sorry for the hassle, and thank you. Registering the Deferred Register worked perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.