Skip to content

Datagen provider crashing in a NeoForge context #348

@no-name-provided

Description

@no-name-provided

Describe the bug
When attempting to use your entity datagen provider in a Java-only, 1.21.1 NeoForge context, my run consistently crashed with the following error:

Caused by: java.lang.NullPointerException: Cannot invoke "com.mojang.serialization.Codec.optionalFieldOf(String, Object)" because "dev.lambdaurora.lambdynlights.api.entity.luminance.EntityLuminance.LIST_CODEC" is null

This happens even when the body of the generate method is empty. When manually created, the necessary JSON appears to work correctly.

To Reproduce
Steps to reproduce the behavior:

  1. Intercept the GatherDataEvent
  2. Attempt to add the provider

Expected behavior
A no-op, when #generate is empty, and this JSON when it isn't:

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Linux]
  • Minecraft [e.g. 1.16.4]
  • Fabric Loader version [e.g. 0.10.6+build.214]
  • Mods [e.g. fabric-api v0.25.1+build.416-1.16, lambdynamiclights v1.3.2, modmenu v1.14.6+build.31]
  • Version [e.g. 1.3.2]
  • Branch [e.g. mc1.16]

Additional context

Compiling against your api, version 4.8.7+1.21.1 using NeoForge version 21.1.202. JSON appears to work when manually created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions