CraftTweaker

CraftTweaker

151M Downloads

Null Pointer Exception when trying to add Queen Bee with large NBT to oredict

Guinaro opened this issue ยท 3 comments

commented

Issue Description:

I'm trying to Itemstages Forestry Bees with itemstages. When using a Meadows Queen Bee I got a null pointer exception. I assume the most likely issue is the very large NBT Tag. Further testing shows Itemstages is not the culprit.

What happens:

When trying to itemstage a Forestry Meadows Queen Bee I get a Null Pointer Exception.
To rule out issues with Itemstages, I simplified the script by adding the bee to an oredict entry instead. Again this resulted in a Null Pointer Exception.
For comparison my second script stages a Forestry Dark Oak Sapling with a large (but much smaller than bee) NBT Tag. Which executes without issues.

What you expected to happen:

Being able to add the Forestry Queen Bee to an Oredict Entry or to hide with Itemstages.

Scripts used + crafttweaker.log file + minecraft log file

https://gist.github.com/Guinaro/542d6038ecd2a93e1aa1692322fd1094

I outcommented the original script lines.
The strange thing is I got no error when assigning the queen bee only to a value as IIngredient as such in script

val queenbee as IIngredient = forestry:bee_queen_ge.withTag({MaxH: ... );


Affected Versions

  • Minecraft Version: 1.12.2
  • Forge: 14.23.4.2760

Mods:

  • Bookshelf-1.12.2-2.3.559
  • CraftTweaker2-1.12-4.1.9
  • forestry_1.12.2-5.8.1.341
  • GameStages-1.12.2-2.0.105
  • ItemStages-1.12.2-2.0.36
  • jei_1.12.2-4.12.0.216
  • jeibees-0.9.0.5-mc1.12.2

Using a server: No

commented

You cannot add Items with NBT to an oreDict, the ore dictionary is designed in a way that ignores nbt data, so that call might cause the NPE due to no tags being on the item later on.

Can you try to directly add the item to the gameStage and see if you get a different error then?

commented

New gist with adapted script, identical in functionality as the one staging a forestry sapling.
https://gist.github.com/Guinaro/9fe503db01f417e40d61894ef754d46c

commented

This has to be due to how Forestry stores bees, to get to where it crashes, it means that the ingredient is not null and there is nbt, so I would report to them.