Expose all possible Baritone instances
This commit is contained in:
@@ -95,6 +95,7 @@ public enum Baritone implements IBaritone {
|
||||
|
||||
private PathingControlManager pathingControlManager;
|
||||
|
||||
private IPlayerContext playerContext;
|
||||
private WorldProvider worldProvider;
|
||||
|
||||
Baritone() {
|
||||
@@ -124,6 +125,7 @@ public enum Baritone implements IBaritone {
|
||||
getToBlockProcess = new GetToBlockProcess(this);
|
||||
}
|
||||
|
||||
this.playerContext = LocalPlayerContext.INSTANCE;
|
||||
this.worldProvider = new WorldProvider();
|
||||
|
||||
if (BaritoneAutoTest.ENABLE_AUTO_TEST) {
|
||||
@@ -141,11 +143,6 @@ public enum Baritone implements IBaritone {
|
||||
return this.gameEventHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputOverrideHandler getInputOverrideHandler() {
|
||||
return this.inputOverrideHandler;
|
||||
}
|
||||
|
||||
public List<Behavior> getBehaviors() {
|
||||
return this.behaviors;
|
||||
}
|
||||
@@ -155,6 +152,11 @@ public enum Baritone implements IBaritone {
|
||||
this.registerEventListener(behavior);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputOverrideHandler getInputOverrideHandler() {
|
||||
return this.inputOverrideHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomGoalProcess getCustomGoalProcess() { // Iffy
|
||||
return customGoalProcess;
|
||||
@@ -167,7 +169,7 @@ public enum Baritone implements IBaritone {
|
||||
|
||||
@Override
|
||||
public IPlayerContext getPlayerContext() {
|
||||
return LocalPlayerContext.INSTANCE;
|
||||
return playerContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -200,16 +202,6 @@ public enum Baritone implements IBaritone {
|
||||
return worldProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO-yeet This shouldn't be baritone-instance specific
|
||||
*
|
||||
* @return world scanner instance
|
||||
*/
|
||||
@Override
|
||||
public WorldScanner getWorldScanner() {
|
||||
return WorldScanner.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerEventListener(IGameEventListener listener) {
|
||||
this.gameEventHandler.registerEventListener(listener);
|
||||
|
||||
@@ -19,15 +19,36 @@ package baritone;
|
||||
|
||||
import baritone.api.IBaritone;
|
||||
import baritone.api.IBaritoneProvider;
|
||||
import baritone.api.cache.IWorldScanner;
|
||||
import baritone.cache.WorldScanner;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Brady
|
||||
* @since 9/29/2018
|
||||
*/
|
||||
public final class BaritoneProvider implements IBaritoneProvider {
|
||||
|
||||
@Override
|
||||
public IBaritone getPrimaryBaritone() {
|
||||
return Baritone.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IBaritone> getAllBaritones() {
|
||||
return Collections.singletonList(Baritone.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBaritone getBaritoneForPlayer(EntityPlayerSP player) {
|
||||
return Baritone.INSTANCE; // pwnage
|
||||
return Baritone.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWorldScanner getWorldScanner() {
|
||||
return WorldScanner.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user