Refined Relocation

Refined Relocation

3M Downloads

Forge Multipart display names not working

squeek502 opened this issue ยท 0 comments

commented

As I mentioned in this commit: squeek502@6a688e0 getting the display name of a tile that is a Forge multipart is currently not happening (the BlockHelper functions will return as if there is no block there at all).

From the commit log: Multipart uses it's own extended MovingObjectPosition class, but doesn't check instanceof or null in BlockMultipart::reduceMOP, which causes exceptions/crashes/etc

I'll probably end up opening an issue at the Multipart repo, but there might be a better way to get a display name of a block/tile? The only tricky part about this is that the methods Waila use mostly rely on trace information about what you're looking at, but if you're in a Gui, that trace information doesn't exist or is too incomplete to be used.

Multipart is the only thing that really doesn't work, though. If you give block.getPickBlock() a null MovingObjectPosition, Multipart will give you a NullPointerException. If you give block.getPickBlock() a regular MovingObjectPosition, Multipart will try to blindly cast it to its own ExtendedMovingObjectPosition and fail/crash. Even if you include the ExtendedMOP class from CodeChickenLib, instantiate a ExtendedMOP, and pass that to block.getPickBlock(), Multipart will assume ExtendedMOP.getData() is a scala Tuple and fail/crash.

So, yeah.