Skip to content
Open

26.1.x #5074

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@v4
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@v4
- name: Set up JDK 21
- name: Set up JDK 25
uses: actions/setup-java@v4
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 @@ -93,9 +93,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 @@ -78,7 +78,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.1.*"]
},
"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 @@ -95,7 +95,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.1, 26.1.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.1.2

forge_version=61.1.5
forge_version=64.0.11

neoforge_version=42
neoforge_version=78

fabric_version=0.18.5
fabric_version=0.19.3

nether_pathfinder_version=1.4.1

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.1, 26.1.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.getChat().addPlayerMessage(msg, null, tag);
} catch (Throwable t) {
LOGGER.warn("Failed to log message to chat: " + msg.getString(), t);
}
Expand Down
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 Down Expand Up @@ -262,8 +261,8 @@ public static class ServerLevelStub extends ServerLevel {
private static Unsafe unsafe = getUnsafe();
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 @@ -318,8 +317,9 @@ public static CompletableFuture<RegistryAccess> load() {
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
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
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
11 changes: 6 additions & 5 deletions src/launch/java/baritone/launch/mixins/MixinWorldRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.resource.GraphicsResourceAllocator;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Camera;
import net.minecraft.client.DeltaTracker;
import net.minecraft.client.renderer.LevelRenderer;
import org.joml.Matrix4f;
import net.minecraft.client.renderer.chunk.ChunkSectionsToRender;
import net.minecraft.client.renderer.state.level.CameraRenderState;
import org.joml.Matrix4fc;
import org.joml.Vector4f;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -44,11 +45,11 @@ public class MixinWorldRenderer {
method = "renderLevel",
at = @At("RETURN")
)
private void onStartHand(final GraphicsResourceAllocator graphicsResourceAllocator, final DeltaTracker deltaTracker, final boolean bl, final Camera camera, final Matrix4f matrix4f, final Matrix4f matrix4f2, final Matrix4f matrix4f3, final GpuBufferSlice gpuBufferSlice, final Vector4f vector4f, final boolean bl2, final CallbackInfo ci) {
private void onStartHand(final GraphicsResourceAllocator allocator, final DeltaTracker deltaTracker, final boolean outline, final CameraRenderState camera, final Matrix4fc modelViewMatrix, final GpuBufferSlice fog, final Vector4f fogColor, final boolean sky, final ChunkSectionsToRender chunkSectionsToRender, final CallbackInfo ci) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
PoseStack poseStack = new PoseStack();
poseStack.mulPose(matrix4f);
ibaritone.getGameEventHandler().onRenderPass(new RenderEvent(deltaTracker.getGameTimeDeltaPartialTick(false), poseStack, matrix4f2));
poseStack.mulPose(modelViewMatrix);
ibaritone.getGameEventHandler().onRenderPass(new RenderEvent(deltaTracker.getGameTimeDeltaPartialTick(false), poseStack, camera.projectionMatrix));
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/baritone/behavior/InventoryBehavior.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import net.minecraft.core.component.DataComponents;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.inventory.ClickType;
import net.minecraft.world.inventory.ContainerInput;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -120,7 +120,7 @@ private boolean requestSwapWithHotBar(int inInventory, int inHotbar) {
logDebug("Inventory move requested but delaying until stationary");
return false;
}
ctx.playerController().windowClick(ctx.player().inventoryMenu.containerId, inInventory < 9 ? inInventory + 36 : inInventory, inHotbar, ClickType.SWAP, ctx.player());
ctx.playerController().windowClick(ctx.player().inventoryMenu.containerId, inInventory < 9 ? inInventory + 36 : inInventory, inHotbar, ContainerInput.SWAP, ctx.player());
ticksSinceLastInventoryMove = 0;
lastTickRequestedMove = null;
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/baritone/cache/ChunkPacker.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static CachedChunk pack(LevelChunk chunk) {
}
}
// @formatter:on
return new CachedChunk(chunk.getPos().x, chunk.getPos().z, height, bitSet, blocks, specialBlocks, System.currentTimeMillis());
return new CachedChunk(chunk.getPos().x(), chunk.getPos().z(), height, bitSet, blocks, specialBlocks, System.currentTimeMillis());
}

private static PathingBlockType getPathingBlockType(BlockState state, LevelChunk chunk, int x, int y, int z) {
Expand All @@ -130,7 +130,7 @@ private static PathingBlockType getPathingBlockType(BlockState state, LevelChunk
return PathingBlockType.AVOID;
}
if (x == 0 || x == 15 || z == 0 || z == 15) {
Vec3 flow = state.getFluidState().getFlow(chunk.getLevel(), new BlockPos(x + (chunk.getPos().x << 4), y, z + (chunk.getPos().z << 4)));
Vec3 flow = state.getFluidState().getFlow(chunk.getLevel(), new BlockPos(x + (chunk.getPos().x() << 4), y, z + (chunk.getPos().z() << 4)));
if (flow.x != 0.0 || flow.z != 0.0) {
return PathingBlockType.WATER;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/baritone/cache/FasterWorldScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,16 @@ private List<BlockPos> scanChunksInternal(IPlayerContext ctx, BlockOptionalMetaL
private Stream<BlockPos> scanChunkInternal(IPlayerContext ctx, BlockOptionalMetaLookup lookup, ChunkPos pos) {
ChunkSource chunkProvider = ctx.world().getChunkSource();
// if chunk is not loaded, return empty stream
if (!chunkProvider.hasChunk(pos.x, pos.z)) {
if (!chunkProvider.hasChunk(pos.x(), pos.z())) {
return Stream.empty();
}

long chunkX = (long) pos.x << 4;
long chunkZ = (long) pos.z << 4;
long chunkX = (long) pos.x() << 4;
long chunkZ = (long) pos.z() << 4;

int playerSectionY = (ctx.playerFeet().y - ctx.world().getMinY()) >> 4;

return collectChunkSections(lookup, chunkProvider.getChunk(pos.x, pos.z, false), chunkX, chunkZ, playerSectionY).stream();
return collectChunkSections(lookup, chunkProvider.getChunk(pos.x(), pos.z(), false), chunkX, chunkZ, playerSectionY).stream();
}


Expand Down
4 changes: 2 additions & 2 deletions src/main/java/baritone/cache/WorldScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ public List<BlockPos> scanChunk(IPlayerContext ctx, BlockOptionalMetaLookup filt
}

ClientChunkCache chunkProvider = (ClientChunkCache) ctx.world().getChunkSource();
LevelChunk chunk = chunkProvider.getChunk(pos.x, pos.z, null, false);
LevelChunk chunk = chunkProvider.getChunk(pos.x(), pos.z(), null, false);
int playerY = ctx.playerFeet().getY();

if (chunk == null || chunk.isEmpty()) {
return Collections.emptyList();
}

ArrayList<BlockPos> res = new ArrayList<>();
scanChunkInto(pos.x << 4, pos.z << 4, ctx.world().dimensionType().minY(), chunk, filter, res, max, yLevelThreshold, playerY, IntStream.range(0, ctx.world().dimensionType().height() / 16).toArray());
scanChunkInto(pos.x() << 4, pos.z() << 4, ctx.world().dimensionType().minY(), chunk, filter, res, max, yLevelThreshold, playerY, IntStream.range(0, ctx.world().dimensionType().height() / 16).toArray());
return res;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/baritone/event/GameEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void onBlockChange(BlockChangeEvent event) {
baritone.getWorldProvider().ifWorldLoaded(worldData -> {
final Level world = baritone.getPlayerContext().world();
ChunkPos pos = event.getChunkPos();
worldData.getCachedWorld().queueForPacking(world.getChunk(pos.x, pos.z));
worldData.getCachedWorld().queueForPacking(world.getChunk(pos.x(), pos.z()));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static boolean canWalkThroughPosition(BlockStateInterface bsi, int x, int y, int
}

BlockState up = bsi.get0(x, y + 1, z);
if (!up.getFluidState().isEmpty() || up.getBlock() instanceof WaterlilyBlock) {
if (!up.getFluidState().isEmpty() || up.getBlock() instanceof LilyPadBlock) {
return false;
}
return fluidState.getType() instanceof WaterFluid;
Expand Down
Loading
Loading