Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

Null getCollisionShape returned when standing on irregular shaped blocks

ViRb3 opened this issue ยท 6 comments

commented

Some information

Operating system: Windows 10
Java version: 1.8
Minecraft version: 1.16.3
Baritone version: 1.6.1
Forge mods (if used): https://www.curseforge.com/minecraft/modpacks/all-the-mods-6 + Baritone + ForgeHax

Correlated between

Exception, error or logs

https://paste.ubuntu.com/p/KDgYj76K9B/ - crashes PneumaticCraft here
https://pastebin.com/X5EpVU5f - crashes PneumaticCraft here
https://pastebin.com/3Nmjbn5E - crashes Immersive Engineering here

As you can notice, both mods crash on the same Forge method call.

How to reproduce

It seems like whenever the player is standing on top of a non-standard-shaped block, a Block#getCollisionShape() of null is returned and the next mod that tries to use it crashes. This happened to me on two separate mods - Immersive Engineering Conveyor Belt, and PneumaticCraft Air Pressurizer, both of which look non-standard.

commented

if Block#getCollisionShape() fails (java.lang.NullPointerException) this will treat as full block

commented

it can then try to walk ontop of blocks when that is not the case, I think it's better to add it to the blocksToAvoid list

commented

if Block#getCollisionShape() fails (java.lang.NullPointerException) this will treat as full block

really I think it should default the other way. If baritone can't get the information it should not walk over the block.

commented

yeah, but not through it either, so forcing baritone to either mine it or go around would be best and is the first half of how I solve it in #3067 but I still need to fix it so baritone actually aims at it when mining. (or just add it to the avoid breaking list as well)

commented

#3067 is now merged

commented

I've looked into this, one choice is to ignore by setting to air (or a full block) but that can cause issues:
image
if someone else wants to look into coding this... https://github.com/wagyourtail/baritone/tree/c%26bfix1.16 is the WIP