[1.15.2] [Compat] A player is not provided for the DirectionalPlaceContext used by the LanternOfParanoia
Laikulo opened this issue ยท 3 comments
This can result in a crash whenever a mod tries to check something about the player (sneaking, creative mod, etc) and doesn't check for nulls.
While it would be nice if everyone checked for nulls, it might be a good idea to pass the player along, especially for mods that care about who is placing something.
Related issue: jaquadro/StorageDrawers#820
This function:
Reliquary/src/main/java/xreliquary/items/LanternOfParanoiaItem.java
Lines 52 to 74 in b128b38
Well, this is not an easy thing to do - either recalculate placement direction and position to a placement vector or implement a completely new class that's like DirectionalPlaceContext with player passed in. And at the same time getPlayer() of PlacementContext is defined as Nullable so mods absolutely have to be ready for it to be null, there are also implementations in vanilla that use DirectionalPlaceContext so they will return null as well. I will keep this around for a bit if I decide to add something additional in Reliquary, but at this point I am leaning towards just leaving it the way it is.
Ah, for some reason I thought DirectionalPlaceContext already had that. I've been out of the game for a bit, so I'm a bit rusty on what has what.
As far as this specific interaction, I've opened a PR against Storage Drawers to add a null check, and am currently using that modded mod. I'll look around and see if I spot an easier solution.