Jump to content

Recommended Posts

Posted

Hi all,

I recently updated my MDK from 1.18.1 to 1.18.2 whilst adding Parchment mappings, but when I clicked Singleplayer to create a new world, the game crashes:

https://gist.github.com/QuantumBlink1337/d88d50e0e846d2036517c1546813cfc4

 

I did attempt to add some ore generation code as I'm still new to Forge and want to practice, but I can't imagine it's related based on the stacktrace. I had this same crash with the recommended 40.1.0 Forge version.

Here's the repo for my mod:

https://github.com/QuantumBlink1337/Obsinite-Mod

Posted

That's a horrible error message.

First, the "mouseClicked event handler" is misleading. That's the thread name because it is running in response to you clicking something.

Its actually just a NullPointerException with no message.

Quote

java.lang.NullPointerException: mouseClicked event handler

at java.util.Objects.requireNonNull(Objects.java:208) ~[?:?] {}

at java.util.ImmutableCollections.listFromArray(ImmutableCollections.java:190) ~[?:?] {}

at java.util.List.of(List.java:1047) ~[?:?] {}

at java.util.ImmutableCollections.listCopy(ImmutableCollections.java:172) ~[?:?] {}

at java.util.List.copyOf(List.java:1068) ~[?:?] {}

at net.minecraft.core.HolderSet.direct(HolderSet.java:38) ~[forge-1.18.2-40.1.0_mapped_parchment_2022.06.26-1.18.2-recomp.jar%2376!/:?] {re:classloading}

at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?] {}

at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[?:?] {}

at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] {}

at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}

at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?] {}

at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}

at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?] {}

at net.minecraft.world.level.biome.BiomeGenerationSettings$Builder.build(BiomeGenerationSettings.java:111) ~[forge-1.18.2-40.1.0_mapped_parchment_2022.06.26-1.18.2-recomp.jar%2376!/:?] {re:classloading,pl:accesstransformer:B}

You can see it is actually a problem in the biome generator. In fact it is in the feature part.

Somewhere along the way there is a null value and the error comes from it trying to insert it into an immutable list, which doesn't allow nulls

 

I think this NPE is caused by you not registering your configured feature. You just create one and then use Holder.direct() on it.

I posted a link to how botania does this in this thread: https://forums.minecraftforge.net/topic/113121-how-do-i-spawn-my-feature-in-the-world-1165/

but was told off because it uses a RegistryEvent<Feature> to do this instead of a DeferredRegistry. 🙂

I don't know of a good example using DeferredRegistrys given how features/placements get configured/registered and both methods ultimately do the same thing. Its just one is more declarative.

 

I am tempted to raise that error message as a bug in forge 🙂

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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