Reputation:
I'm currently making a 1.12.2 Forge mod that involves pathfinding, so I decided to use Baritone. Can anyone help me with actually accessing the API? What I'm currently doing is manually accessing it with BaritoneAPI.getProvider()
, which crashes it.
According to the author of Baritone, "Baritone's forge jar is notch mapped, and relies on runtime remapping to searge. If you manually load the BaritoneAPI
class, or otherwise trick forge into thinking that it doesn't need to remap baritone, it will crash like this."
What's the proper way of accessing the Baritone API?
Update: I've resorted to using EntityPlayerSP#sendChatMessage(String)
and forcing the player to use a Baritone chat command for now.
Upvotes: 3
Views: 4522
Reputation: 1771
I can't try it at the moment, so I don't know if this leads to the problem you mentioned, but it looks like it should be easy enough to use the API.
From here:
BaritoneAPI.getSettings().allowSprint.value = true;
BaritoneAPI.getSettings().primaryTimeoutMS.value = 2000L;
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ(10000, 20000));
Another thing to note is that when using the API you must use a special release.
From here:
Please note that usage of anything located outside of the
baritone.api
package is not supported by the API release jar.
Which refers to the specially packaged API releases, which can be found here.
Upvotes: 1