Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

Thermal Expansion - Won't Pathfind Because of NPE

theoparis opened this issue · 17 comments

commented

Some information

Operating system: Mac OSX High Serria
Java version: 8
Minecraft version: 1.12.2
Baritone version: v1.2.11 1.12.2
Forge mods (if used): a lot

Exception, error or logs

Please find your latest.log or debug.log in this folder and attach it to the issue
latest.log

Linux: ~/.minecraft/logs/

Windows: %appdata%/.minecraft/logs/

Mac: /Library/Application\ Support/minecraft/logs/

It spams a nullpointerexception error in the chat AND the console when i try to pathfind using the path command. In the console it says

[17:14:34] [pool-7-thread-4/INFO] [STDERR]: [baritone.hh:a:-1]: at cofh.thermalexpansion.block.BlockTEBase.func_176195_g(BlockTEBase.java:114)

I'm assuming it has to do with thermal expansion, and I haven't seen an issue on this yet.

commented

Duplicate of #3945

commented

Mods:
explorer_l6XRGEZ6AD
explorer_dedCLTgm6d

commented
commented

tbh sometimes I wonder how people even get that many mods working together in the first place
you'd think at least one of them would write shitty code and make an incompatibility

commented

Well the error in the log shows to be a problem specifically with Thermal Expansion, and it's tile entity classes.

commented

idk man
probably not gonna get fixed if it's another forge mod causing it
just putting it out there

commented

@S-B99 >posting impact faq in baritone issue tracker
🤡

commented

still applies tho

commented

false

commented

tbh sometimes I wonder how people even get that many mods working together in the first place
you'd think at least one of them would write shitty code and make an incompatibility

its called not using coremods.

commented

then fix it lol

commented

then fix it lol

what do you think the issue tracker is for.

commented

😳😳

commented

float hardness = state.getBlockHardness(null, null);

https://github.com/CoFH/ThermalExpansion/blob/50ec40e1b34eb9939abd1947e24e64fd12442241/src/main/java/cofh/thermalexpansion/block/BlockTEBase.java#L114

TLDR baritone strikes again with giving invalid data or semi-valid data like air block for some modded block and the state being wrong and the mod just assuming it would be right.

commented

So, I don't know if my code below is good, but it seems to fix the spam of NPE errors. The stairs issue in the other issue is still happening though.

float hardness = state.getBlockHardness(BaritoneAPI.getProvider().getPrimaryBaritone().getPlayerContext().world(), new BlockPos(0, 0, 0));
commented

Do you guys think my way of getting the world object will work in all cases, or should I find a better way?

commented

Ok so I was investigating this, and the world parameter seems to be easy to handle, but the position is a problem because the toolset method that is called calculateSpeedVsBlock does not contain a position parameter because the usages of this method do not have a position either, and just a state. I'm not sure what to do either here.
Actually, if I pass in the primary baritone's player world, and then can I pass in a blockpos of 0,0,0 since it looks like it is looking for a tile entity but if there isn't any tile entity there it should be fine?