mirror of https://github.com/cabaletta/baritone
Merge pull request #4280 from ZacSharp/1.20.4-update
Merge 1.19.4 into 1.20.4
This commit is contained in:
commit
6d06713610
|
@ -63,11 +63,13 @@ Baritone is the pathfinding system used in [Impact](https://impactclient.net/) s
|
||||||
| [1.12.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.2.19/baritone-api-forge-1.2.19.jar) | |
|
| [1.12.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.2.19/baritone-api-forge-1.2.19.jar) | |
|
||||||
| [1.16.5 Forge](https://github.com/cabaletta/baritone/releases/download/v1.6.5/baritone-api-forge-1.6.5.jar) | [1.16.5 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.6.5/baritone-api-fabric-1.6.5.jar) |
|
| [1.16.5 Forge](https://github.com/cabaletta/baritone/releases/download/v1.6.5/baritone-api-forge-1.6.5.jar) | [1.16.5 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.6.5/baritone-api-fabric-1.6.5.jar) |
|
||||||
| [1.17.1 Forge](https://github.com/cabaletta/baritone/releases/download/v1.7.3/baritone-api-forge-1.7.3.jar) | [1.17.1 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.7.3/baritone-api-fabric-1.7.3.jar) |
|
| [1.17.1 Forge](https://github.com/cabaletta/baritone/releases/download/v1.7.3/baritone-api-forge-1.7.3.jar) | [1.17.1 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.7.3/baritone-api-fabric-1.7.3.jar) |
|
||||||
| [1.18.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.8.5/baritone-api-forge-1.8.5.jar) | [1.18.2 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.8.5/baritone-api-fabric-1.8.5.jar) |
|
| [1.18.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.8.6/baritone-api-forge-1.8.6.jar) | [1.18.2 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.8.6/baritone-api-fabric-1.8.6.jar) |
|
||||||
| [1.19.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.4/baritone-api-forge-1.9.4.jar) | [1.19.2 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.4/baritone-api-fabric-1.9.4.jar) |
|
| [1.19.2 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.4/baritone-api-forge-1.9.4.jar) | [1.19.2 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.4/baritone-api-fabric-1.9.4.jar) |
|
||||||
| [1.19.3 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.1/baritone-api-forge-1.9.1.jar) | [1.19.3 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.1/baritone-api-fabric-1.9.1.jar) |
|
| [1.19.3 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.1/baritone-api-forge-1.9.1.jar) | [1.19.3 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.1/baritone-api-fabric-1.9.1.jar) |
|
||||||
| [1.19.4 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.3/baritone-api-forge-1.9.3.jar) | [1.19.4 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.3/baritone-api-fabric-1.9.3.jar) |
|
| [1.19.4 Forge](https://github.com/cabaletta/baritone/releases/download/v1.9.3/baritone-api-forge-1.9.3.jar) | [1.19.4 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.9.3/baritone-api-fabric-1.9.3.jar) |
|
||||||
| [1.20.1 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.1/baritone-api-forge-1.10.1.jar) | [1.20.1 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.1/baritone-api-fabric-1.10.1.jar) |
|
| [1.20.1 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.1/baritone-api-forge-1.10.1.jar) | [1.20.1 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.1/baritone-api-fabric-1.10.1.jar) |
|
||||||
|
| [1.20.3 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.2/baritone-api-forge-1.10.2.jar) | [1.20.3 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.2/baritone-api-fabric-1.10.2.jar) |
|
||||||
|
| [1.20.4 Forge](https://github.com/cabaletta/baritone/releases/download/v1.10.2/baritone-api-forge-1.10.2.jar) | [1.20.4 Fabric](https://github.com/cabaletta/baritone/releases/download/v1.10.2/baritone-api-fabric-1.10.2.jar) |
|
||||||
|
|
||||||
**Message for 2b2t players looking for 1.19/1.20 Baritone** If you like, please try the beta for Baritone Elytra for 2b2t, find it in #announcements of [the Baritone discord](http://discord.gg/s6fRBAUpmr). It supports 1.19.4 and 1.20.1, Forge or Fabric. If you have to see it to believe it, watch [this YouTube video](https://youtu.be/NnSlQi-68eQ).
|
**Message for 2b2t players looking for 1.19/1.20 Baritone** If you like, please try the beta for Baritone Elytra for 2b2t, find it in #announcements of [the Baritone discord](http://discord.gg/s6fRBAUpmr). It supports 1.19.4 and 1.20.1, Forge or Fabric. If you have to see it to believe it, watch [this YouTube video](https://youtu.be/NnSlQi-68eQ).
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ allprojects {
|
||||||
// The following line declares the yarn mappings you may select this one as well.
|
// The following line declares the yarn mappings you may select this one as well.
|
||||||
// mappings "net.fabricmc:yarn:1.17.1+build.32:v2"
|
// mappings "net.fabricmc:yarn:1.17.1+build.32:v2"
|
||||||
//launchImplementation('dev.babbaj:nether-pathfinder:1.3.0')
|
//launchImplementation('dev.babbaj:nether-pathfinder:1.3.0')
|
||||||
implementation "dev.babbaj:nether-pathfinder:${nether_pathfinder_version}"
|
implementation "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
|
||||||
|
|
||||||
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ dependencies {
|
||||||
common sourceSet.output
|
common sourceSet.output
|
||||||
shadowCommon sourceSet.output
|
shadowCommon sourceSet.output
|
||||||
}
|
}
|
||||||
include "dev.babbaj:nether-pathfinder:${nether_pathfinder_version}"
|
include "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|
|
@ -56,7 +56,7 @@ dependencies {
|
||||||
common sourceSet.output
|
common sourceSet.output
|
||||||
shadowCommon sourceSet.output
|
shadowCommon sourceSet.output
|
||||||
}
|
}
|
||||||
shadowCommon "dev.babbaj:nether-pathfinder:${nether_pathfinder_version}"
|
shadowCommon "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|
|
@ -13,4 +13,4 @@ neoforge_version=0-beta
|
||||||
|
|
||||||
fabric_version=0.14.22
|
fabric_version=0.14.22
|
||||||
|
|
||||||
nether_pathfinder_version=1.4.1
|
nether_pathfinder_version=1.4.1
|
||||||
|
|
|
@ -65,7 +65,7 @@ dependencies {
|
||||||
common sourceSet.output
|
common sourceSet.output
|
||||||
shadowCommon sourceSet.output
|
shadowCommon sourceSet.output
|
||||||
}
|
}
|
||||||
shadowCommon "dev.babbaj:nether-pathfinder:${nether_pathfinder_version}"
|
shadowCommon "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|
|
@ -29,6 +29,8 @@ import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@ -50,6 +52,7 @@ import java.util.function.Consumer;
|
||||||
* @author leijurv
|
* @author leijurv
|
||||||
*/
|
*/
|
||||||
public final class Settings {
|
public final class Settings {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger("Baritone");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow Baritone to break blocks
|
* Allow Baritone to break blocks
|
||||||
|
@ -900,6 +903,13 @@ public final class Settings {
|
||||||
*/
|
*/
|
||||||
public final Setting<Integer> maxCachedWorldScanCount = new Setting<>(10);
|
public final Setting<Integer> maxCachedWorldScanCount = new Setting<>(10);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mine will not scan for or remember more than this many target locations.
|
||||||
|
* Note that the number of locations retrieved from cache is additionaly
|
||||||
|
* limited by {@link #maxCachedWorldScanCount}.
|
||||||
|
*/
|
||||||
|
public final Setting<Integer> mineMaxOreLocationsCount = new Setting<>(64);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the minimum y level whilst mining - set to 0 to turn off.
|
* Sets the minimum y level whilst mining - set to 0 to turn off.
|
||||||
* if world has negative y values, subtract the min world height to get the value to put here
|
* if world has negative y values, subtract the min world height to get the value to put here
|
||||||
|
@ -1209,8 +1219,12 @@ public final class Settings {
|
||||||
*/
|
*/
|
||||||
@JavaOnly
|
@JavaOnly
|
||||||
public final Setting<Consumer<Component>> logger = new Setting<>((msg) -> {
|
public final Setting<Consumer<Component>> logger = new Setting<>((msg) -> {
|
||||||
final GuiMessageTag tag = useMessageTag.value ? Helper.MESSAGE_TAG : null;
|
try {
|
||||||
Minecraft.getInstance().gui.getChat().addMessage(msg, null, tag);
|
final GuiMessageTag tag = useMessageTag.value ? Helper.MESSAGE_TAG : null;
|
||||||
|
Minecraft.getInstance().gui.getChat().addMessage(msg, null, tag);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
LOGGER.warn("Failed to log message to chat: " + msg.getString(), t);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class Baritone implements IBaritone {
|
||||||
private final ExploreProcess exploreProcess;
|
private final ExploreProcess exploreProcess;
|
||||||
private final FarmProcess farmProcess;
|
private final FarmProcess farmProcess;
|
||||||
private final InventoryPauserProcess inventoryPauserProcess;
|
private final InventoryPauserProcess inventoryPauserProcess;
|
||||||
private final ElytraProcess elytraProcess;
|
private final IElytraProcess elytraProcess;
|
||||||
|
|
||||||
private final PathingControlManager pathingControlManager;
|
private final PathingControlManager pathingControlManager;
|
||||||
private final SelectionManager selectionManager;
|
private final SelectionManager selectionManager;
|
||||||
|
|
|
@ -84,10 +84,10 @@ public class ElytraProcess extends BaritoneProcessHelper implements IBaritonePro
|
||||||
baritone.getGameEventHandler().registerEventListener(this);
|
baritone.getGameEventHandler().registerEventListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T extends IElytraProcess> T create(final Baritone baritone) {
|
public static IElytraProcess create(final Baritone baritone) {
|
||||||
return (T) (NetherPathfinderContext.isSupported()
|
return NetherPathfinderContext.isSupported()
|
||||||
? new ElytraProcess(baritone)
|
? new ElytraProcess(baritone)
|
||||||
: new NullElytraProcess(baritone));
|
: new NullElytraProcess(baritone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -53,8 +53,6 @@ import static baritone.api.pathing.movement.ActionCosts.COST_INF;
|
||||||
*/
|
*/
|
||||||
public final class MineProcess extends BaritoneProcessHelper implements IMineProcess {
|
public final class MineProcess extends BaritoneProcessHelper implements IMineProcess {
|
||||||
|
|
||||||
private static final int ORE_LOCATIONS_COUNT = 64;
|
|
||||||
|
|
||||||
private BlockOptionalMetaLookup filter;
|
private BlockOptionalMetaLookup filter;
|
||||||
private List<BlockPos> knownOreLocations;
|
private List<BlockPos> knownOreLocations;
|
||||||
private List<BlockPos> blacklist; // inaccessible
|
private List<BlockPos> blacklist; // inaccessible
|
||||||
|
@ -186,7 +184,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
|
||||||
List<BlockPos> locs = knownOreLocations;
|
List<BlockPos> locs = knownOreLocations;
|
||||||
if (!locs.isEmpty()) {
|
if (!locs.isEmpty()) {
|
||||||
CalculationContext context = new CalculationContext(baritone);
|
CalculationContext context = new CalculationContext(baritone);
|
||||||
List<BlockPos> locs2 = prune(context, new ArrayList<>(locs), filter, ORE_LOCATIONS_COUNT, blacklist, droppedItemsScan());
|
List<BlockPos> locs2 = prune(context, new ArrayList<>(locs), filter, Baritone.settings().mineMaxOreLocationsCount.value, blacklist, droppedItemsScan());
|
||||||
// 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
|
||||||
Goal goal = new GoalComposite(locs2.stream().map(loc -> coalesce(loc, locs2, context)).toArray(Goal[]::new));
|
Goal goal = new GoalComposite(locs2.stream().map(loc -> coalesce(loc, locs2, context)).toArray(Goal[]::new));
|
||||||
knownOreLocations = locs2;
|
knownOreLocations = locs2;
|
||||||
|
@ -235,7 +233,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<BlockPos> dropped = droppedItemsScan();
|
List<BlockPos> dropped = droppedItemsScan();
|
||||||
List<BlockPos> locs = searchWorld(context, filter, ORE_LOCATIONS_COUNT, already, blacklist, dropped);
|
List<BlockPos> locs = searchWorld(context, filter, Baritone.settings().mineMaxOreLocationsCount.value, already, blacklist, dropped);
|
||||||
locs.addAll(dropped);
|
locs.addAll(dropped);
|
||||||
if (locs.isEmpty() && !Baritone.settings().exploreForBlocks.value) {
|
if (locs.isEmpty() && !Baritone.settings().exploreForBlocks.value) {
|
||||||
logDirect("No locations for " + filter + " known, cancelling");
|
logDirect("No locations for " + filter + " known, cancelling");
|
||||||
|
@ -425,7 +423,7 @@ public final class MineProcess extends BaritoneProcessHelper implements IMinePro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
knownOreLocations = prune(new CalculationContext(baritone), knownOreLocations, filter, ORE_LOCATIONS_COUNT, blacklist, dropped);
|
knownOreLocations = prune(new CalculationContext(baritone), knownOreLocations, filter, Baritone.settings().mineMaxOreLocationsCount.value, blacklist, dropped);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue