Crash when using shaders near copycat blocks (NPE caused by not checking nullable presence)
Linguardium opened this issue ยท 3 comments
This changed in March requiring you to pin create dependency versions or do a null check.
Sorry, let me be clearer.
When getAppearance is called, queryPos is nullable.
queryPos is passed to isIgnoredConnectivitySide as the last argument (toPos in your override)
You are passing that nullable value to BlockAndTintGetter#getBlockState
BlockAndTintGetter#getBlockState does not take a nullable value but null is a valid value for queryPos (toPos).
Since you dont check it, when Copycat blocks call getAppearance with a null queryPos, and thus call isIgnoredConnectivitySide with a null value, you are using a null value where one cannot be used and it causes a Null Pointer Exception.
This is reproducible with Embeddium, Iris, Monocle, and shaders enabled. not sure the exact setup required to cause it, but folks playing Craftoria modpack are running into the issue described above due to improper handling of valid arguments (as of the change in March, though its also nullable in IBlockExtension which is where Copycat blocks inherit from which has been nullable for 2 years, so likely it was just an oversight on your part)
Thanks for the report. The API has been changed since Create 6 but it was hard to notice because the nullable annotation doesn't propagate to overrides in Intellij.
Although for future issues, please provide logs or at least stack traces. An accurate stack trace is better than a thousand words.