diff --git a/src/main/java/baritone/Baritone.java b/src/main/java/baritone/Baritone.java index 25636ecb..e8d0b0ea 100755 --- a/src/main/java/baritone/Baritone.java +++ b/src/main/java/baritone/Baritone.java @@ -144,37 +144,37 @@ public enum Baritone implements IBaritoneProvider { } @Override - public IFollowBehavior getFollowBehavior() { + public FollowBehavior getFollowBehavior() { return followBehavior; } @Override - public ILookBehavior getLookBehavior() { + public LookBehavior getLookBehavior() { return lookBehavior; } @Override - public IMemoryBehavior getMemoryBehavior() { + public MemoryBehavior getMemoryBehavior() { return memoryBehavior; } @Override - public IMineBehavior getMineBehavior() { + public MineBehavior getMineBehavior() { return mineBehavior; } @Override - public IPathingBehavior getPathingBehavior() { + public PathingBehavior getPathingBehavior() { return pathingBehavior; } @Override - public IWorldProvider getWorldProvider() { + public WorldProvider getWorldProvider() { return WorldProvider.INSTANCE; } @Override - public IWorldScanner getWorldScanner() { + public WorldScanner getWorldScanner() { return WorldScanner.INSTANCE; } diff --git a/src/main/java/baritone/behavior/MineBehavior.java b/src/main/java/baritone/behavior/MineBehavior.java index c6683f07..d76f0dc1 100644 --- a/src/main/java/baritone/behavior/MineBehavior.java +++ b/src/main/java/baritone/behavior/MineBehavior.java @@ -82,7 +82,7 @@ public final class MineBehavior extends Behavior implements IMineBehavior, Helpe addNearby(); } updateGoal(); - ((PathingBehavior) baritone.getPathingBehavior()).revalidateGoal(); + baritone.getPathingBehavior().revalidateGoal(); } private void updateGoal() { @@ -93,7 +93,7 @@ public final class MineBehavior extends Behavior implements IMineBehavior, Helpe if (!locs.isEmpty()) { List locs2 = prune(new ArrayList<>(locs), mining, 64); // can't reassign locs, gotta make a new var locs2, because we use it in a lambda right here, and variables you use in a lambda must be effectively final - ((PathingBehavior) baritone.getPathingBehavior()).setGoalAndPath(new GoalComposite(locs2.stream().map(loc -> coalesce(loc, locs2)).toArray(Goal[]::new))); + baritone.getPathingBehavior().setGoalAndPath(new GoalComposite(locs2.stream().map(loc -> coalesce(loc, locs2)).toArray(Goal[]::new))); knownOreLocations = locs; return; } @@ -108,7 +108,7 @@ public final class MineBehavior extends Behavior implements IMineBehavior, Helpe // cool, path is over and we are at desired y branchPoint = playerFeet(); } else { - ((PathingBehavior) baritone.getPathingBehavior()).setGoalAndPath(new GoalYLevel(y)); + baritone.getPathingBehavior().setGoalAndPath(new GoalYLevel(y)); return; } } @@ -117,7 +117,7 @@ public final class MineBehavior extends Behavior implements IMineBehavior, Helpe // TODO mine 1x1 shafts to either side branchPoint = branchPoint.north(10); } - ((PathingBehavior) baritone.getPathingBehavior()).setGoalAndPath(new GoalBlock(branchPoint)); + baritone.getPathingBehavior().setGoalAndPath(new GoalBlock(branchPoint)); } private void rescan() { diff --git a/src/main/java/baritone/utils/ExampleBaritoneControl.java b/src/main/java/baritone/utils/ExampleBaritoneControl.java index e9ebab2d..659b454a 100644 --- a/src/main/java/baritone/utils/ExampleBaritoneControl.java +++ b/src/main/java/baritone/utils/ExampleBaritoneControl.java @@ -70,7 +70,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { public boolean runCommand(String msg0) { String msg = msg0.toLowerCase(Locale.US).trim(); // don't reassign the argument LOL - PathingBehavior pathingBehavior = (PathingBehavior) baritone.getPathingBehavior(); + PathingBehavior pathingBehavior = baritone.getPathingBehavior(); List> toggleable = Baritone.settings().getAllValuesByType(Boolean.class); for (Settings.Setting setting : toggleable) { if (msg.equalsIgnoreCase(setting.getName())) { @@ -372,7 +372,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper { return true; } } else { - List locs = ((MineBehavior) baritone.getMineBehavior()).searchWorld(Collections.singletonList(block), 64); + List locs = baritone.getMineBehavior().searchWorld(Collections.singletonList(block), 64); if (locs.isEmpty()) { logDirect("No locations for " + mining + " known, cancelling"); return true;