@author Brady @since 7/31/2018
| 54 | * @since 7/31/2018 |
| 55 | */ |
| 56 | public class Baritone implements IBaritone { |
| 57 | |
| 58 | private static final ThreadPoolExecutor threadPool; |
| 59 | |
| 60 | static { |
| 61 | threadPool = new ThreadPoolExecutor(4, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<>()); |
| 62 | } |
| 63 | |
| 64 | private final Minecraft mc; |
| 65 | private final Path directory; |
| 66 | |
| 67 | private final GameEventHandler gameEventHandler; |
| 68 | |
| 69 | private final PathingBehavior pathingBehavior; |
| 70 | private final LookBehavior lookBehavior; |
| 71 | private final InventoryBehavior inventoryBehavior; |
| 72 | private final InputOverrideHandler inputOverrideHandler; |
| 73 | |
| 74 | private final FollowProcess followProcess; |
| 75 | private final MineProcess mineProcess; |
| 76 | private final GetToBlockProcess getToBlockProcess; |
| 77 | private final CustomGoalProcess customGoalProcess; |
| 78 | private final BuilderProcess builderProcess; |
| 79 | private final ExploreProcess exploreProcess; |
| 80 | private final FarmProcess farmProcess; |
| 81 | private final InventoryPauserProcess inventoryPauserProcess; |
| 82 | private final IElytraProcess elytraProcess; |
| 83 | |
| 84 | private final PathingControlManager pathingControlManager; |
| 85 | private final SelectionManager selectionManager; |
| 86 | private final CommandManager commandManager; |
| 87 | |
| 88 | private final IPlayerContext playerContext; |
| 89 | private final WorldProvider worldProvider; |
| 90 | |
| 91 | public BlockStateInterface bsi; |
| 92 | |
| 93 | Baritone(Minecraft mc) { |
| 94 | this.mc = mc; |
| 95 | this.gameEventHandler = new GameEventHandler(this); |
| 96 | |
| 97 | this.directory = mc.gameDirectory.toPath().resolve("baritone"); |
| 98 | if (!Files.exists(this.directory)) { |
| 99 | try { |
| 100 | Files.createDirectories(this.directory); |
| 101 | } catch (IOException ignored) {} |
| 102 | } |
| 103 | |
| 104 | // Define this before behaviors try and get it, or else it will be null and the builds will fail! |
| 105 | this.playerContext = new BaritonePlayerContext(this, mc); |
| 106 | |
| 107 | { |
| 108 | this.lookBehavior = this.registerBehavior(LookBehavior::new); |
| 109 | this.pathingBehavior = this.registerBehavior(PathingBehavior::new); |
| 110 | this.inventoryBehavior = this.registerBehavior(InventoryBehavior::new); |
| 111 | this.inputOverrideHandler = this.registerBehavior(InputOverrideHandler::new); |
| 112 | this.registerBehavior(WaypointBehavior::new); |
| 113 | } |
nothing calls this directly
no outgoing calls
no test coverage detected