Remove unnecessary casts
This commit is contained in:
parent
1b1233d26a
commit
3d4a856bb2
@ -144,37 +144,37 @@ public enum Baritone implements IBaritoneProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IFollowBehavior getFollowBehavior() {
|
public FollowBehavior getFollowBehavior() {
|
||||||
return followBehavior;
|
return followBehavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ILookBehavior getLookBehavior() {
|
public LookBehavior getLookBehavior() {
|
||||||
return lookBehavior;
|
return lookBehavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IMemoryBehavior getMemoryBehavior() {
|
public MemoryBehavior getMemoryBehavior() {
|
||||||
return memoryBehavior;
|
return memoryBehavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IMineBehavior getMineBehavior() {
|
public MineBehavior getMineBehavior() {
|
||||||
return mineBehavior;
|
return mineBehavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPathingBehavior getPathingBehavior() {
|
public PathingBehavior getPathingBehavior() {
|
||||||
return pathingBehavior;
|
return pathingBehavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWorldProvider getWorldProvider() {
|
public WorldProvider getWorldProvider() {
|
||||||
return WorldProvider.INSTANCE;
|
return WorldProvider.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWorldScanner getWorldScanner() {
|
public WorldScanner getWorldScanner() {
|
||||||
return WorldScanner.INSTANCE;
|
return WorldScanner.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public final class MineBehavior extends Behavior implements IMineBehavior, Helpe
|
|||||||
addNearby();
|
addNearby();
|
||||||
}
|
}
|
||||||
updateGoal();
|
updateGoal();
|
||||||
((PathingBehavior) baritone.getPathingBehavior()).revalidateGoal();
|
baritone.getPathingBehavior().revalidateGoal();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateGoal() {
|
private void updateGoal() {
|
||||||
@ -93,7 +93,7 @@ public final class MineBehavior extends Behavior implements IMineBehavior, Helpe
|
|||||||
if (!locs.isEmpty()) {
|
if (!locs.isEmpty()) {
|
||||||
List<BlockPos> locs2 = prune(new ArrayList<>(locs), mining, 64);
|
List<BlockPos> 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
|
// 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;
|
knownOreLocations = locs;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ public final class MineBehavior extends Behavior implements IMineBehavior, Helpe
|
|||||||
// cool, path is over and we are at desired y
|
// cool, path is over and we are at desired y
|
||||||
branchPoint = playerFeet();
|
branchPoint = playerFeet();
|
||||||
} else {
|
} else {
|
||||||
((PathingBehavior) baritone.getPathingBehavior()).setGoalAndPath(new GoalYLevel(y));
|
baritone.getPathingBehavior().setGoalAndPath(new GoalYLevel(y));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ public final class MineBehavior extends Behavior implements IMineBehavior, Helpe
|
|||||||
// TODO mine 1x1 shafts to either side
|
// TODO mine 1x1 shafts to either side
|
||||||
branchPoint = branchPoint.north(10);
|
branchPoint = branchPoint.north(10);
|
||||||
}
|
}
|
||||||
((PathingBehavior) baritone.getPathingBehavior()).setGoalAndPath(new GoalBlock(branchPoint));
|
baritone.getPathingBehavior().setGoalAndPath(new GoalBlock(branchPoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void rescan() {
|
private void rescan() {
|
||||||
|
@ -70,7 +70,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
|
|||||||
|
|
||||||
public boolean runCommand(String msg0) {
|
public boolean runCommand(String msg0) {
|
||||||
String msg = msg0.toLowerCase(Locale.US).trim(); // don't reassign the argument LOL
|
String msg = msg0.toLowerCase(Locale.US).trim(); // don't reassign the argument LOL
|
||||||
PathingBehavior pathingBehavior = (PathingBehavior) baritone.getPathingBehavior();
|
PathingBehavior pathingBehavior = baritone.getPathingBehavior();
|
||||||
List<Settings.Setting<Boolean>> toggleable = Baritone.settings().getAllValuesByType(Boolean.class);
|
List<Settings.Setting<Boolean>> toggleable = Baritone.settings().getAllValuesByType(Boolean.class);
|
||||||
for (Settings.Setting<Boolean> setting : toggleable) {
|
for (Settings.Setting<Boolean> setting : toggleable) {
|
||||||
if (msg.equalsIgnoreCase(setting.getName())) {
|
if (msg.equalsIgnoreCase(setting.getName())) {
|
||||||
@ -372,7 +372,7 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<BlockPos> locs = ((MineBehavior) baritone.getMineBehavior()).searchWorld(Collections.singletonList(block), 64);
|
List<BlockPos> locs = baritone.getMineBehavior().searchWorld(Collections.singletonList(block), 64);
|
||||||
if (locs.isEmpty()) {
|
if (locs.isEmpty()) {
|
||||||
logDirect("No locations for " + mining + " known, cancelling");
|
logDirect("No locations for " + mining + " known, cancelling");
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user