fix a couple edge case crashes#24
Conversation
|
The second crash should probably be fixed by passing the I'm not sure why baritone is passing null for the world, as it's not marked as nullable in vanilla code. Adding null checks here would imply adding null checks everywhere else too, which would be a massive pain. (In addition baritone is a cheat mod, so I'm not really interested in supporting it). |
|
Upon closer inspection it looks like the way that LMP detects if block outlines are being drawn is a bit broken with other mods, so I'll need to change that to work better as well. |
Look at me not even reading the stacktrace and totally missing that baritone was causing it 🤦 Makes sense why I couldn't reproduce it and it was specific to one player on the server...
Sounds good! |
Player-visible changes: * Added hit particles and sounds. * [#24] Fixed a crash where LMP wrongly casted a BlockView to a World when it shouldn't have. Developer changes: * Added AbstractPart.getClosestBlockState(). * This is used for playing/spawning hit and break sounds/particles, and calculating the break speed of the part by default. * This defaults to dirt, however it is *highly* recommended that subclasses either override getClosestBlockState(), or all of the methods that use it by default. * Deprecated various methods that take a World argument and replace them with BlockView instead: * IBlockMultipart.getPartOutlineShape() -> getPartOutline() * IBlockMultipart.getTargetedMultipart() -> getMultipartTarget()
Player-visible changes: * Added hit particles and sounds. * [#24] Fixed a crash where LMP wrongly casted a BlockView to a World when it shouldn't have. Developer changes: * Added AbstractPart.getClosestBlockState(). * This is used for playing/spawning hit and break sounds/particles, and calculating the break speed of the part by default. * This defaults to dirt, however it is *highly* recommended that subclasses either override getClosestBlockState(), or all of the methods that use it by default. * Deprecated various methods that take a World argument and replace them with BlockView instead: * IBlockMultipart.getPartOutlineShape() -> getPartOutline() * IBlockMultipart.getTargetedMultipart() -> getMultipartTarget()
|
Ok, this should now be fixed and released in 0.4.6 |
|
...and actually usable in 0.4.7, as I messed up the 0.4.6 release. Sorry. Please comment if you find this to not be the case. |
getCollisionShape may crash when walking on multipart blocks, not sure what interaction specifically was causing it but I have attached a sample crash report.
getOutlineShape was crashing when a Staff Of Building was held near a multipart block. Adding the instance check seems to resolve it without adversely impacting hitbox behavior. I have also attached that crash report.
crash-2021-02-09_21.23.46-client.txt
crash-2021-02-10_21.15.27-client.txt