Closed Igrium closed 4 years ago
Hi,
thanks for this bug report. Indeed the TypeRegistry
and ShapeRegistry
are not updated on the FacesMeshGenerator
when setting those in the BlocksConfig.
I'll create a patch and release a new version.
This is fixed in Blocks v1.6.1
At least, this is what I think is happening.
I'm adding a custom shape registry in
simpleInitApp()
after I initialize the blocks config:All that
MeshRegistry
does is override theget()
method to patch into my custom system, which is tested to work:Yet, when I try to compile the chunk mesh, I get a
NullPointerException
tracing back tocom.rvandoosselaer.blocks.FacesMeshGenerator.createNode(FacesMeshGenerator.java:59)
, which looking into the source code reveals to be:What's interesting is that it's obviously calling
shapeRegistry.get()
and getting backnull
, but my test print statement,System.out.println("Pulling from custom shape registry");
, is not firing. This leads me to conclude that theshapeRegistry
variable insideFacesMeshGenerator
is not getting updated when I callBlocksConfig.setShapeRegistry()
, and the program is attempting to use a key belonging to my custom system on the default system, which would obviously returnnull
.The full source code the project in which the issue was found is at http://scaffoldeditor.org under the
editor_rendering
branch. Here's the full traceback. I'm running the whole JME program inside a Swing window, so it's rather long:Thank you for coming to my TED talk.