Jump to content

JaceG0326

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

JaceG0326's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm trying to create my own custom structure. I found an example structure to reference from but I'm new to Java as a whole so I'm stuck on how to fix this. Here's my code: public void commonSetup(FMLCommonSetupEvent args) { DeferredWorkQueue.runLater(() -> { Iterator<Biome> biomes = ForgeRegistries.BIOMES.iterator(); biomes.forEachRemaining((biome) -> { biome.addStructure(JUNGLE_RUIN.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG)); biome.addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, JUNGLE_RUIN.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG).withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG))); }); }); } Here's the error message I got: [18:22:01] [Render thread/ERROR] [ne.mi.fm.DeferredWorkQueue/]: Encountered exception executing deferred work java.util.concurrent.CompletionException: java.lang.NullPointerException at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) ~[?:1.8.0_201] {} at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) ~[?:1.8.0_201] {} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1629) ~[?:1.8.0_201] {} at net.minecraftforge.fml.DeferredWorkQueue.lambda$makeRunnable$6(DeferredWorkQueue.java:210) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626) ~[?:1.8.0_201] {} at net.minecraft.resources.AsyncReloader.lambda$null$3(AsyncReloader.java:66) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:140) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:110) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(ThreadTaskExecutor.java:97) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:934) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:558) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:177) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.1.0.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.1.0.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?] {} Caused by: java.lang.NullPointerException at com.jaceg.tutorialmod.TutorialMod.lambda$null$1(TutorialMod.java:131) ~[?:?] {re:classloading} at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_201] {} at com.jaceg.tutorialmod.TutorialMod.lambda$commonSetup$2(TutorialMod.java:130) ~[?:?] {re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626) ~[?:1.8.0_201] {} ... 21 more [18:22:01] [Server-Worker-1/INFO] [ne.mi.fm.DeferredWorkQueue/LOADING]: Synchronous work queue completed in 00:00:00.101 [18:22:01] [Server-Worker-1/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event SETUP, 1 errors found [18:22:01] [Server-Worker-1/FATAL] [ne.mi.ev.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted. java.lang.Exception: stacktrace at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.2.0-service.jar:?] {} at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:123) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$3(ClientModLoader.java:105) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:113) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626) [?:1.8.0_201] {} at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1618) [?:1.8.0_201] {} at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_201] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_201] {} at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_201] {} at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_201] {} I'm not sure what other parts of my code I need to show to get proper help but any advice would be appreciated. A link to some sort of explanation on how to add custom structures in 1.15.2 would be nice as well.
  2. It's working for the Pink Forest but not it's child biome. I think that's because it uses a custom grass block as it's top layer. Don't how to fix that but that's not what my issue was so as soon as I can figure out how to mark this as solved I will. Thanks for your help.
  3. My bad. I'll make sure to do that next time I changed some of the code according to the error before I saw your reply. It crashed because this was running twice: EntitySpawnPlacementRegistry.register(ModEntityTypes.PINK_SHEEP.get(), EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn); To fix this I changed my code to this: private void setup(final FMLCommonSetupEvent event) { DeferredWorkQueue.runLater(new Runnable() { @Override public void run() { EntitySpawnPlacementRegistry.register(ModEntityTypes.PINK_SHEEP.get(), EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn); BiomeInit.BIOMES.getEntries().stream().map(RegistryObject::get).filter(biome -> biome == BiomeInit.PINK_BIOME.get()).forEach(b -> { List<Biome.SpawnListEntry> creatures = b.getSpawns(EntityClassification.CREATURE); creatures.add(new Biome.SpawnListEntry(ModEntityTypes.PINK_SHEEP.get(), 20, 3, 6)); }); BiomeInit.BIOMES.getEntries().stream().map(RegistryObject::get).filter(biome -> biome == BiomeInit.PINK_CHILD_BIOME.get()).forEach(b -> { List<Biome.SpawnListEntry> creatures = b.getSpawns(EntityClassification.CREATURE); creatures.add(new Biome.SpawnListEntry(ModEntityTypes.PINK_SHEEP.get(), 20, 3, 6)); }); } }); } I'm fairly sure the two filters aren't necessary but I'm trying to keep this as close the original code as possible because I'm not sure what works and doesn't. Do you think this could work? It's loading in with no errors but I can't find the mob in either biome. I don't know if I'm just getting unlucky or if they can't spawn for whatever reason.
  4. This is my code right now: private void setup(final FMLCommonSetupEvent event) { DeferredWorkQueue.runLater(new Runnable() { @Override public void run() { BiomeInit.BIOMES.getEntries().stream().map(RegistryObject::get).forEach(b -> { List<Biome.SpawnListEntry> creatures = b.getSpawns(EntityClassification.CREATURE); creatures.add(new Biome.SpawnListEntry(ModEntityTypes.PINK_SHEEP.get(), 50, 3, 6)); EntitySpawnPlacementRegistry.register(ModEntityTypes.PINK_SHEEP.get(), EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn); }); } }); } When I run it I get this error: [10:21:49] [Render thread/ERROR] [ne.mi.fm.DeferredWorkQueue/]: Encountered exception executing deferred work java.util.concurrent.CompletionException: java.lang.IllegalStateException: Duplicate registration for type tutorialmod:pink_sheep Sorry, I'm fairly new to this still
  5. Oh you're completely right. I've completely ignored that part. I've removed the filter for now because I only have two custom biomes but if I wanted to filter out multiple vanilla biomes how would I go about that? Would just using || between each biome work?
  6. I've been following a tutorial on how to mod with 1.15.2 forge but once they got through custom mobs they never explained how to make them spawn in custom biomes or in any biome for that matter. I've been trying to figure it out and for the most part I have but I can't seem to get them to spawn in more than one biome. This is my code so far private void setup(final FMLCommonSetupEvent event) { BiomeInit.BIOMES.getEntries().stream().map(RegistryObject::get).filter(biome -> biome == BiomeInit.PINK_BIOME.get()).forEach(b -> { List<Biome.SpawnListEntry> creatures = b.getSpawns(EntityClassification.CREATURE); creatures.add(new Biome.SpawnListEntry(ModEntityTypes.PINK_SHEEP.get(), 50, 3, 6)); EntitySpawnPlacementRegistry.register(ModEntityTypes.PINK_SHEEP.get(), EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, AnimalEntity::canAnimalSpawn); }); } I've seen some posts on here mention DeferredWorkQueues and I tried that but I still couldn't figure out how to make multiple different filters or how to filter out everything but two biomes (both custom btw).
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.