Skip to content
Open

26.2 #5076

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/gradle_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK 21
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
java-version: '25'
distribution: 'zulu'
cache: gradle

- name: Grant execute permission for gradlew
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:

steps:
- uses: actions/checkout@v6
- name: Set up JDK 21
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
java-version: '25'
distribution: 'zulu'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ allprojects {
version rootProject.minecraft_version

mappings {
intermediary()
mojmap()
parchment(rootProject.minecraft_version, "2025.12.20")
}
}

Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ components.java {
}

task proguard(type: ProguardTask) {
proguardVersion "7.4.2"
proguardVersion "7.9.1"
compType "fabric"
}

Expand Down
4 changes: 2 additions & 2 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"mixins.baritone.json"
],
"depends": {
"fabricloader": ">=0.14.22",
"minecraft": ["1.21.11"]
"fabricloader": ">=0.19.3",
"minecraft": ["26.2"]
},
"custom": {
"modmenu": {
Expand Down
2 changes: 1 addition & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ components.java {
}

task proguard(type: ProguardTask) {
proguardVersion "7.4.2"
proguardVersion "7.9.1"
compType "forge"
}

Expand Down
4 changes: 2 additions & 2 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[48,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
loaderVersion="[62,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
license="https://raw.githubusercontent.com/cabaletta/baritone/1.16.2/LICENSE"
# A URL to refer people to when problems occur with this mod
issueTrackerURL="https://github.com/cabaletta/baritone/issues" #optional
Expand Down Expand Up @@ -35,6 +35,6 @@ A Minecraft pathfinder bot.
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.21.11]"
versionRange="[26.2]"
ordering="NONE"
side="BOTH"
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ org.gradle.jvmargs=-Xmx4G

available_loaders=fabric,forge,neoforge,tweaker

mod_version=1.17.0
mod_version=1.18.0
maven_group=baritone
archives_base_name=baritone

java_version=21
java_version=25

minecraft_version=1.21.11
minecraft_version=26.2

forge_version=61.1.5
forge_version=65.0.3

neoforge_version=42
neoforge_version=11-beta

fabric_version=0.18.5
fabric_version=0.19.3

nether_pathfinder_version=1.6

Expand Down
2 changes: 1 addition & 1 deletion neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ components.java {
}

task proguard(type: ProguardTask) {
proguardVersion "7.4.2"
proguardVersion "7.9.1"
compType "neoforge"
}

Expand Down
2 changes: 1 addition & 1 deletion neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ A Minecraft pathfinder bot.
modId="minecraft"
type="required"
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.21.11]"
versionRange="[26.2]"
ordering="NONE"
side="BOTH"

Expand Down
4 changes: 2 additions & 2 deletions src/api/java/baritone/api/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import baritone.api.utils.SettingsUtil;
import baritone.api.utils.TypeUtils;
import baritone.api.utils.gui.BaritoneToast;
import net.minecraft.client.GuiMessageTag;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.chat.GuiMessageTag;
import net.minecraft.core.Vec3i;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
Expand Down Expand Up @@ -1281,7 +1281,7 @@ public final class Settings {
public final Setting<Consumer<Component>> logger = new Setting<>((msg) -> {
try {
final GuiMessageTag tag = useMessageTag.value ? Helper.MESSAGE_TAG : null;
Minecraft.getInstance().gui.getChat().addMessage(msg, null, tag);
Minecraft.getInstance().gui.hud.getChat().addPlayerMessage(msg, null, tag);
} catch (Throwable t) {
LOGGER.warn("Failed to log message to chat: " + msg.getString(), t);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import baritone.api.command.ICommand;
import baritone.api.command.argument.ICommandArgument;
import baritone.api.command.registry.Registry;
import net.minecraft.util.Tuple;
import baritone.api.utils.Pair;

import java.util.List;
import java.util.stream.Stream;
Expand All @@ -44,9 +44,9 @@ public interface ICommandManager {

boolean execute(String string);

boolean execute(Tuple<String, List<ICommandArgument>> expanded);
boolean execute(Pair<String, List<ICommandArgument>> expanded);

Stream<String> tabComplete(Tuple<String, List<ICommandArgument>> expanded);
Stream<String> tabComplete(Pair<String, List<ICommandArgument>> expanded);

Stream<String> tabComplete(String prefix);
}
10 changes: 5 additions & 5 deletions src/api/java/baritone/api/utils/BlockOptionalMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import net.minecraft.server.packs.resources.CloseableResourceManager;
import net.minecraft.server.packs.resources.MultiPackResourceManager;
import net.minecraft.tags.TagLoader;
import net.minecraft.world.RandomSequences;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand All @@ -57,7 +56,7 @@
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.Vec3;
import sun.misc.Unsafe;

Check warning on line 59 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / test

Unsafe is internal proprietary API and may be removed in a future release

Check warning on line 59 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / build

Unsafe is internal proprietary API and may be removed in a future release

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -259,11 +258,11 @@

public static class ServerLevelStub extends ServerLevel {
private static Minecraft client = Minecraft.getInstance();
private static Unsafe unsafe = getUnsafe();

Check warning on line 261 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / test

Unsafe is internal proprietary API and may be removed in a future release

Check warning on line 261 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / build

Unsafe is internal proprietary API and may be removed in a future release
private static CompletableFuture<RegistryAccess> registryAccess = load();

public ServerLevelStub(MinecraftServer $$0, Executor $$1, LevelStorageSource.LevelStorageAccess $$2, ServerLevelData $$3, ResourceKey<Level> $$4, LevelStem $$5, boolean $$6, long $$7, List<CustomSpawner> $$8, boolean $$9, @Nullable RandomSequences $$10) {
super($$0, $$1, $$2, $$3, $$4, $$5, $$6, $$7, $$8, $$9, $$10);
public ServerLevelStub(MinecraftServer $$0, Executor $$1, LevelStorageSource.LevelStorageAccess $$2, ServerLevelData $$3, ResourceKey<Level> $$4, LevelStem $$5, boolean $$6, long $$7, List<CustomSpawner> $$8, boolean $$9) {
super($$0, $$1, $$2, $$3, $$4, $$5, $$6, $$7, $$8, $$9);
}

@Override
Expand Down Expand Up @@ -292,11 +291,11 @@
return new ReloadableServerRegistries.Holder(registryAccess().freeze());
}

public static Unsafe getUnsafe() {

Check warning on line 294 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / test

Unsafe is internal proprietary API and may be removed in a future release

Check warning on line 294 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / build

Unsafe is internal proprietary API and may be removed in a future release
try {
Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");

Check warning on line 296 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / test

Unsafe is internal proprietary API and may be removed in a future release

Check warning on line 296 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / build

Unsafe is internal proprietary API and may be removed in a future release
theUnsafe.setAccessible(true);
return (Unsafe) theUnsafe.get(null);

Check warning on line 298 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / test

Unsafe is internal proprietary API and may be removed in a future release

Check warning on line 298 in src/api/java/baritone/api/utils/BlockOptionalMeta.java

View workflow job for this annotation

GitHub Actions / build

Unsafe is internal proprietary API and may be removed in a future release
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand All @@ -321,8 +320,9 @@
RegistryDataLoader.load(
closeableResourceManager,
worldGenRegistryLookupList,
RegistryDataLoader.WORLDGEN_REGISTRIES
)
RegistryDataLoader.WORLDGEN_REGISTRIES,
ForkJoinPool.commonPool()
).join()
);
return ReloadableServerRegistries.reload(
layeredRegistryAccess,
Expand Down
2 changes: 1 addition & 1 deletion src/api/java/baritone/api/utils/Helper.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import baritone.api.BaritoneAPI;
import baritone.api.Settings;
import net.minecraft.ChatFormatting;
import net.minecraft.client.GuiMessageTag;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.chat.GuiMessageTag;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;

Expand Down
4 changes: 2 additions & 2 deletions src/api/java/baritone/api/utils/IPlayerController.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.ClickType;
import net.minecraft.world.inventory.ContainerInput;
import net.minecraft.world.level.GameType;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.BlockHitResult;
Expand All @@ -43,7 +43,7 @@ public interface IPlayerController {

void resetBlockRemoving();

void windowClick(int windowId, int slotId, int mouseButton, ClickType type, Player player);
void windowClick(int windowId, int slotId, int mouseButton, ContainerInput type, Player player);

GameType getGameType();

Expand Down
2 changes: 1 addition & 1 deletion src/api/java/baritone/api/utils/gui/BaritoneToast.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
public class BaritoneToast {
private static final SystemToast.SystemToastId BARITONE_TOAST_ID = new SystemToast.SystemToastId(5000L);
public static void addOrUpdate(Component title, Component subtitle) {
SystemToast.addOrUpdate(Minecraft.getInstance().getToastManager(), BARITONE_TOAST_ID, title, subtitle);
SystemToast.addOrUpdate(Minecraft.getInstance().gui.toastManager(), BARITONE_TOAST_ID, title, subtitle);
}
}
4 changes: 2 additions & 2 deletions src/launch/java/baritone/launch/mixins/MixinChunkArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public void copyFrom(IChunkArray other) {
LevelChunk chunk = copyingFrom.get(k);
if (chunk != null) {
ChunkPos chunkpos = chunk.getPos();
if (inRange(chunkpos.x, chunkpos.z)) {
int index = getIndex(chunkpos.x, chunkpos.z);
if (inRange(chunkpos.x(), chunkpos.z())) {
int index = getIndex(chunkpos.x(), chunkpos.z());
if (chunks.get(index) != null) {
throw new IllegalStateException("Doing this would mutate the client's REAL loaded chunks?!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void preChunkUnload(ClientboundForgetLevelChunkPacket packet, CallbackIn
LocalPlayer player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPacketListener) (Object) this) {
ibaritone.getGameEventHandler().onChunkEvent(
new ChunkEvent(EventState.PRE, ChunkEvent.Type.UNLOAD, packet.pos().x, packet.pos().z)
new ChunkEvent(EventState.PRE, ChunkEvent.Type.UNLOAD, packet.pos().x(), packet.pos().z())
);
}
}
Expand All @@ -140,7 +140,7 @@ private void postChunkUnload(ClientboundForgetLevelChunkPacket packet, CallbackI
LocalPlayer player = ibaritone.getPlayerContext().player();
if (player != null && player.connection == (ClientPacketListener) (Object) this) {
ibaritone.getGameEventHandler().onChunkEvent(
new ChunkEvent(EventState.POST, ChunkEvent.Type.UNLOAD, packet.pos().x, packet.pos().z)
new ChunkEvent(EventState.POST, ChunkEvent.Type.UNLOAD, packet.pos().x(), packet.pos().z())
);
}
}
Expand Down Expand Up @@ -190,7 +190,7 @@ private void postHandleMultiBlockChange(ClientboundSectionBlocksUpdatePacket pac
return;
}
baritone.getGameEventHandler().onBlockChange(new BlockChangeEvent(
new ChunkPos(changes.get(0).first()),
ChunkPos.containing(changes.get(0).first()),
changes
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import baritone.utils.accessor.IFireworkRocketEntity;
import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.projectile.FireworkRocketEntity;
import net.minecraft.world.level.Level;
Expand All @@ -44,7 +44,7 @@ public abstract class MixinFireworkRocketEntity extends Entity implements IFirew
public abstract boolean isAttachedToEntity();

private MixinFireworkRocketEntity(Level level) {
super(EntityType.FIREWORK_ROCKET, level);
super(EntityTypes.FIREWORK_ROCKET, level);
}

@Override
Expand Down
9 changes: 4 additions & 5 deletions src/launch/java/baritone/launch/mixins/MixinItemStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import baritone.api.utils.accessor.IItemStack;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
Expand All @@ -31,17 +30,17 @@
@Mixin(ItemStack.class)
public abstract class MixinItemStack implements IItemStack {

@Shadow
@Final
private Item item;

@Unique
private int baritoneHash;

@Shadow
public abstract int getDamageValue();

@Shadow
public abstract Item getItem();

private void recalculateHash() {
Item item = getItem();
baritoneHash = item == null ? -1 : item.hashCode() + getDamageValue();
}

Expand Down
17 changes: 9 additions & 8 deletions src/launch/java/baritone/launch/mixins/MixinMinecraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import baritone.api.event.events.WorldEvent;
import baritone.api.event.events.type.EventState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.player.LocalPlayer;
Expand Down Expand Up @@ -67,7 +68,7 @@ private void postInit(CallbackInfo ci) {
at = @At(
value = "FIELD",
opcode = Opcodes.GETFIELD,
target = "net/minecraft/client/Minecraft.screen:Lnet/minecraft/client/gui/screens/Screen;",
target = "net/minecraft/client/Minecraft.gui:Lnet/minecraft/client/gui/Gui;",
ordinal = 0,
shift = At.Shift.BEFORE
),
Expand Down Expand Up @@ -165,27 +166,27 @@ private void postLoadWorld(final ClientLevel world, final CallbackInfo ci) {
@Redirect(
method = "tick",
at = @At(
value = "FIELD",
opcode = Opcodes.GETFIELD,
target = "Lnet/minecraft/client/Minecraft;screen:Lnet/minecraft/client/gui/screens/Screen;"
value = "INVOKE",
target = "Lnet/minecraft/client/gui/Gui;screen()Lnet/minecraft/client/gui/screens/Screen;"
),
slice = @Slice(
from = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/components/DebugScreenOverlay;showDebugScreen()Z"
value = "FIELD",
opcode = Opcodes.PUTFIELD,
target = "net/minecraft/client/Minecraft.missTime:I"
),
to = @At(
value = "CONSTANT",
args = "stringValue=Keybindings"
)
)
)
private Screen passEvents(Minecraft instance) {
private Screen passEvents(Gui gui) {
// allow user input is only the primary baritone
if (BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().isPathing() && player != null) {
return null;
}
return instance.screen;
return gui.screen();
}

// TODO
Expand Down
Loading