possible fix to concurrentmodificationexception on path start
This commit is contained in:
parent
f51bcc8b89
commit
438392840b
@ -21,6 +21,7 @@ import baritone.api.event.GameEventHandler;
|
|||||||
import baritone.behavior.Behavior;
|
import baritone.behavior.Behavior;
|
||||||
import baritone.behavior.impl.*;
|
import baritone.behavior.impl.*;
|
||||||
import baritone.utils.InputOverrideHandler;
|
import baritone.utils.InputOverrideHandler;
|
||||||
|
import baritone.utils.ToolSet;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -81,6 +82,7 @@ public enum Baritone {
|
|||||||
registerBehavior(LocationTrackingBehavior.INSTANCE);
|
registerBehavior(LocationTrackingBehavior.INSTANCE);
|
||||||
registerBehavior(FollowBehavior.INSTANCE);
|
registerBehavior(FollowBehavior.INSTANCE);
|
||||||
registerBehavior(MineBehavior.INSTANCE);
|
registerBehavior(MineBehavior.INSTANCE);
|
||||||
|
this.gameEventHandler.registerEventListener(ToolSet.INTERNAL_EVENT_LISTENER);
|
||||||
}
|
}
|
||||||
this.dir = new File(Minecraft.getMinecraft().gameDir, "baritone");
|
this.dir = new File(Minecraft.getMinecraft().gameDir, "baritone");
|
||||||
if (!Files.exists(dir.toPath())) {
|
if (!Files.exists(dir.toPath())) {
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package baritone.utils;
|
package baritone.utils;
|
||||||
|
|
||||||
import baritone.Baritone;
|
|
||||||
import baritone.api.event.events.ItemSlotEvent;
|
import baritone.api.event.events.ItemSlotEvent;
|
||||||
import baritone.api.event.listener.AbstractGameEventListener;
|
import baritone.api.event.listener.AbstractGameEventListener;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
@ -46,11 +45,7 @@ public class ToolSet implements Helper {
|
|||||||
/**
|
/**
|
||||||
* Instance of the internal event listener used to hook into Baritone's event bus
|
* Instance of the internal event listener used to hook into Baritone's event bus
|
||||||
*/
|
*/
|
||||||
private static final InternalEventListener INTERNAL_EVENT_LISTENER = new InternalEventListener();
|
public static final InternalEventListener INTERNAL_EVENT_LISTENER = new InternalEventListener();
|
||||||
|
|
||||||
static {
|
|
||||||
Baritone.INSTANCE.getGameEventHandler().registerEventListener(INTERNAL_EVENT_LISTENER);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of tools on the hotbar that should be considered.
|
* A list of tools on the hotbar that should be considered.
|
||||||
|
Loading…
Reference in New Issue
Block a user