LittleTiles

LittleTiles

12M Downloads

Crash when previewing multi-structure recipes

QBFreak opened this issue ยท 2 comments

commented

Description

When changing the structure type of a sub-structure in a Recipe to None, and then causing the game to attempt to render it (such as a preview before placing) the game will crash with a Null Pointer Exception.

Steps to reproduce

(I suspect a few of the steps towards the end are superfluous, but this works)

  • Create two structures, single or multi-tile, doesn't matter
  • Place each structure in a separate Advanced Recipe
    • Set the Structure Type to Fixed and give it a name, click Save
  • Place each structure
  • Place an additional tile or tiles nearby
  • Create a new Structure on a new Advanced Recipe from the two Structures and the Tile(s)
  • Set the Structure Type to Fixed and give it a name, click Save
  • Close the Recipe

NOTE: If you intend to reuse this world, you should probably stop and back it up at this point. You're likely to spawn after the crash with the offending Recipe still in your hand, and trigger it again. And again. And again.

  • Open the Recipe
  • Change the Structure selection to one of the sub-structures
  • Change the Structure Type to None, Click Save
  • Attempt to preview the newly modified Recipe, either by opening it again or by targeting a nearby block
  • Minecraft crashes

I didn't notice until just now that the error is different depending on whether it was attempting to draw the preview for placement, or in the Recipe GUI. The logs provided below were from attempting to preview for placement.

Expected Behavior

Fewer null pointers ๐Ÿ˜‰

Logs

Here are the crash report and latest.log: https://gist.github.com/QBFreak/af00dc231da1e4fe308744a5318b29f8

Details

Versions
Minecraft: 1.12.2
Forge: 14.23.5.2768
LittleTiles: 1.5.0-pre150
CreativeCore: 1.9.54
Other mods: No, reproducible with just LittleTiles
commented

Yeah as explained in discord you are not supposed to change a child structure to none. I added some code to prevent it from happening again. It will be part of the upcoming pre-release. Thank you very much for your help! I really appreciate your detailed description :D

commented

Now version is out!