Closed ni-cky closed 3 years ago
what were the specific changes you have done? This looks like either the structure or configuredstructure isnt actually registered
I made the following change (as far as I can see9: StructureTutorialMain:
public static final String MODID = "structure_tutorial"; to public static final String MODID = "grisha";
I tried changing this back but it still does not work.
Make sure you are using the very latest version of fabric api. And after you change the modid, change the folder in the resources/data folder to your modid as well so it matches up. And then test in a brand new world. If you try and enter a world made with the old modid, it's gonna throw errors so do new worlds during these early testing
Okay, update time. For ease of testing I just used your Mod ID for now and it does load new worlds at least. Or it does so mostly. cause either while loading or as soon as you are inside the world for a few seconds the following exception gets thrown:
---- Minecraft Crash Report ----
// There are four lights!
Time: 02.08.21, 16:10
Description: Exception generating new chunk
java.lang.NullPointerException: Cannot invoke "net.minecraft.structure.pool.StructurePool.getRandomElement(java.util.Random)" because "structurePool" is null
at net.minecraft.structure.pool.StructurePoolBasedGenerator.generate(StructurePoolBasedGenerator.java:46)
at com.nicky.TestStructure.structures.RunDownHouseStructure$Start.init(RunDownHouseStructure.java:175)
at com.nicky.TestStructure.structures.RunDownHouseStructure$Start.init(RunDownHouseStructure.java:1)
at net.minecraft.world.gen.feature.StructureFeature.tryPlaceStart(StructureFeature.java:272)
at net.minecraft.world.gen.feature.ConfiguredStructureFeature.tryPlaceStart(ConfiguredStructureFeature.java:43)
at net.minecraft.world.gen.chunk.ChunkGenerator.setStructureStart(ChunkGenerator.java:297)
at net.minecraft.world.gen.chunk.ChunkGenerator.setStructureStarts(ChunkGenerator.java:285)
at net.minecraft.world.chunk.ChunkStatus.method_16556(ChunkStatus.java:182)
at net.minecraft.world.chunk.ChunkStatus.runGenerationTask(ChunkStatus.java:136)
at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_17225(ThreadedAnvilChunkStorage.java:540)
at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_17224(ThreadedAnvilChunkStorage.java:537)
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
at net.minecraft.server.world.ChunkTaskPrioritySystem.method_17634(ChunkTaskPrioritySystem.java:48)
at net.minecraft.util.thread.TaskExecutor.runNext(TaskExecutor.java:84)
at net.minecraft.util.thread.TaskExecutor.runWhile(TaskExecutor.java:139)
at net.minecraft.util.thread.TaskExecutor.run(TaskExecutor.java:92)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1434)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:295)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: Render thread
Stacktrace:
at net.minecraft.structure.pool.StructurePoolBasedGenerator.generate(StructurePoolBasedGenerator.java:46)
at com.nicky.TestStructure.structures.RunDownHouseStructure$Start.init(RunDownHouseStructure.java:175)
at com.nicky.TestStructure.structures.RunDownHouseStructure$Start.init(RunDownHouseStructure.java:1)
at net.minecraft.world.gen.feature.StructureFeature.tryPlaceStart(StructureFeature.java:272)
at net.minecraft.world.gen.feature.ConfiguredStructureFeature.tryPlaceStart(ConfiguredStructureFeature.java:43)
at net.minecraft.world.gen.chunk.ChunkGenerator.setStructureStart(ChunkGenerator.java:297)
at net.minecraft.world.gen.chunk.ChunkGenerator.setStructureStarts(ChunkGenerator.java:285)
at net.minecraft.world.chunk.ChunkStatus.method_16556(ChunkStatus.java:182)
at net.minecraft.world.chunk.ChunkStatus.runGenerationTask(ChunkStatus.java:136)
-- Chunk to be generated --
Details:
Location: 13,14
Position hash: 60129542157
Generator: net.minecraft.world.gen.chunk.NoiseChunkGenerator@7ad112ea
Stacktrace:
at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_17225(ThreadedAnvilChunkStorage.java:540)
at com.mojang.datafixers.util.Either$Left.map(Either.java:38)
at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_17224(ThreadedAnvilChunkStorage.java:537)
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
at net.minecraft.server.world.ChunkTaskPrioritySystem.method_17634(ChunkTaskPrioritySystem.java:48)
at net.minecraft.util.thread.TaskExecutor.runNext(TaskExecutor.java:84)
at net.minecraft.util.thread.TaskExecutor.runWhile(TaskExecutor.java:139)
at net.minecraft.util.thread.TaskExecutor.run(TaskExecutor.java:92)
-- Affected level --
Details:
All players: 0 total; []
Chunk stats: 529
Level dimension: minecraft:overworld
Level spawn location: World: (152,64,152), Section: (at 8,0,8 in 9,4,9; chunk contains blocks 144,0,144 to 159,255,159), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 0 game time, 0 day time
Level name: Generation Test III
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Known server brands: fabric
Level was modded: true
Level storage version: 0x04ABD - Anvil
Stacktrace:
at net.minecraft.server.MinecraftServer.createWorlds(MinecraftServer.java:422)
at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:377)
at net.minecraft.server.integrated.IntegratedServer.setupServer(IntegratedServer.java:67)
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:728)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:272)
at java.base/java.lang.Thread.run(Thread.java:831)
-- System Details --
Details:
Minecraft Version: 1.17.1
Minecraft Version ID: 1.17.1
Operating System: Windows 10 (amd64) version 10.0
Java Version: 16.0.1, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode, sharing), Oracle Corporation
Memory: 1411439936 bytes (1346 MiB) / 1986002944 bytes (1894 MiB) up to 4282384384 bytes (4084 MiB)
CPUs: 4
Processor Vendor: GenuineIntel
Processor Name: Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
Identifier: Intel64 Family 6 Model 158 Stepping 9
Microarchitecture: unknown
Frequency (GHz): 3,41
Number of physical packages: 1
Number of physical CPUs: 4
Number of logical CPUs: 4
Graphics card #0 name: NVIDIA GeForce GTX 1060 6GB
Graphics card #0 vendor: NVIDIA (0x10de)
Graphics card #0 VRAM (MB): 4095,00
Graphics card #0 deviceId: 0x1c03
Graphics card #0 versionInfo: DriverVersion=27.21.14.5671
Memory slot #0 capacity (MB): 8192,00
Memory slot #0 clockSpeed (GHz): 2,13
Memory slot #0 type: DDR4
Memory slot #1 capacity (MB): 8192,00
Memory slot #1 clockSpeed (GHz): 2,13
Memory slot #1 type: DDR4
Virtual memory max (MB): 20043,35
Virtual memory used (MB): 12785,01
Swap memory total (MB): 3712,00
Swap memory used (MB): 74,45
JVM Flags: 2 total; -XX:+ShowCodeDetailsInExceptionMessages -XX:+ShowCodeDetailsInExceptionMessages
Fabric Mods:
fabric: Fabric API 0.37.1+1.17
fabric-api-base: Fabric API Base 0.3.0+a02b446318
fabric-api-lookup-api-v1: Fabric API Lookup API (v1) 1.2.0+2b5c62d018
fabric-biome-api-v1: Fabric Biome API (v1) 3.1.11+c345aea818
fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.5+a02b446318
fabric-command-api-v1: Fabric Command API (v1) 1.1.3+5ab9934c18
fabric-commands-v0: Fabric Commands (v0) 0.2.2+92519afa18
fabric-containers-v0: Fabric Containers (v0) 0.1.12+a02b446318
fabric-content-registries-v0: Fabric Content Registries (v0) 0.2.2+a02b446318
fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.5+be9da31018
fabric-dimensions-v1: Fabric Dimensions API (v1) 2.0.11+6cefd57718
fabric-entity-events-v1: Fabric Entity Events (v1) 1.1.0+a02b446318
fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.4.9+a722d8c018
fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.1+92519afa18
fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.7+6cefd57718
fabric-item-api-v1: Fabric Item API (v1) 1.2.4+a02b446318
fabric-item-groups-v0: Fabric Item Groups (v0) 0.2.10+b7ab612118
fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.4+a02b446318
fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.2+36b77c3e18
fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 1.4.4+a02b446318
fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.0.4+a02b446318
fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.3+92519afa18
fabric-models-v0: Fabric Models (v0) 0.3.0+a02b446318
fabric-networking-api-v1: Fabric Networking API (v1) 1.0.12+6cefd57718
fabric-networking-blockentity-v0: Fabric Networking Block Entity (v0) 0.2.11+a02b446318
fabric-networking-v0: Fabric Networking (v0) 0.3.2+92519afa18
fabric-object-builder-api-v1: Fabric Object Builder API (v1) 1.10.9+b7ab612118
fabric-object-builders-v0: Fabric Object Builders (v0) 0.7.3+a02b446318
fabric-particles-v1: Fabric Particles (v1) 0.2.4+a02b446318
fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.7.10+e2961fee18
fabric-renderer-api-v1: Fabric Renderer API (v1) 0.4.4+5f02c96918
fabric-renderer-indigo: Fabric Renderer - Indigo 0.4.8+a02b446318
fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 3.2.0+a02b446318
fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.1.5+a02b446318
fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.13+a02b446318
fabric-rendering-v0: Fabric Rendering (v0) 1.1.2+92519afa18
fabric-rendering-v1: Fabric Rendering (v1) 1.6.0+a02b446318
fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.4.8+a00e834b18
fabric-screen-api-v1: Fabric Screen API (v1) 1.0.4+155f865c18
fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.1.8+a02b446318
fabric-structure-api-v1: Fabric Structure API (v1) 1.1.13+5ab9934c18
fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 1.1.4+a02b446318
fabric-textures-v0: Fabric Textures (v0) 1.0.6+a02b446318
fabric-tool-attribute-api-v1: Fabric Tool Attribute API (v1) 1.2.12+b7ab612118
fabric-transfer-api-v1: Fabric Transfer API (v1) 1.0.0+3fe3c3f518
fabricloader: Fabric Loader 0.11.6
grisha: Grisha ${2.0.0}
jankson: Jankson 3.0.1+j1.2.0
java: Java HotSpot(TM) 64-Bit Server VM 16
libgui: LibGui 4.1.5+1.17.1
libninepatch: LibNinePatch 1.1.0
minecraft: Minecraft 1.17.1
Player Count: 0 / 8; []
Data Packs: vanilla, Fabric Mods
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fabric'
java.lang.NullPointerException: Cannot invoke "net.minecraft.structure.pool.StructurePool.getRandomElement(java.util.Random)" because "structurePool" is null
that specific error is caused when the pool file is unable to be found or is empty. Make sure your pool file is in the path you gave to structureSettingsAndStartPool or change structureSettingsAndStartPool's path to your pool file. Also make sure the nbt path in the pool file itself is also correct. If the structureSettingsAndStartPool is pointing to the wrong path, this crash occurs. If the pool file has an nbt path that is incorrect, it nukes itself to become empty and causes that crash
StructurePoolFeatureConfig structureSettingsAndStartPool = new StructurePoolFeatureConfig(() -> dynamicRegistryManager.get(Registry.STRUCTURE_POOL_KEY)
.get(new Identifier(StructureTutorialMain.MODID, "run_down_house/start_pool")),
10);
It works now! Thanks a lot for the help!
Hi! I used the tutorial to become familiar with 1.17 world generation but ran into an issue.
I have mostly just inserted the Tutorial files into my own project to get a grasp onto them and down the line make changes to the code to implement my own features.
Minecraft does start, but if I open a world the following Exception gets thrown and the progress freezes at 4%, dead locking the game.
Advice and help would be appreciated! Exception:
Central classes/files from the repository with minor changes: