Merge pull request #3923 from ZacSharp/pr/mine/maxYLevelWhileMining

 Add maxYLevelWhileMining setting
This commit is contained in:
leijurv 2023-05-23 15:56:11 -07:00 committed by GitHub
commit a1661e94b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -853,6 +853,11 @@ public final class Settings {
*/
public final Setting<Integer> minYLevelWhileMining = new Setting<>(0);
/**
* Sets the maximum y level to mine ores at.
*/
public final Setting<Integer> maxYLevelWhileMining = new Setting<>(255); // 1.17+ defaults to maximum possible world height
/**
* This will only allow baritone to mine exposed ores, can be used to stop ore obfuscators on servers that use them.
*/

View File

@ -437,6 +437,8 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
.filter(pos -> pos.getY() >= Baritone.settings().minYLevelWhileMining.value)
.filter(pos -> pos.getY() <= Baritone.settings().maxYLevelWhileMining.value)
.filter(pos -> !blacklist.contains(pos))
.sorted(Comparator.comparingDouble(ctx.getBaritone().getPlayerContext().player()::getDistanceSq))