Compare commits

...

5 Commits

Author SHA1 Message Date
leijurv
6d5617ff62 Merge pull request #4884 from rfresh2/1.21.10
1.21.10 (+1.21.9)
2025-10-16 11:10:07 -07:00
rfresh2
6e07cb78d8 fix neo not loading mixins 2025-10-07 15:26:46 -07:00
rfresh2
72dcabd84c 1.21.10 2025-10-07 14:26:47 -07:00
rfresh2
78352721ca forge 1.21.9 2025-10-01 22:03:54 -07:00
rfresh2
69c745226a 1.21.9 fabric + neo 2025-09-30 21:31:40 -07:00
13 changed files with 36 additions and 56 deletions

View File

@@ -25,7 +25,7 @@
],
"depends": {
"fabricloader": ">=0.14.22",
"minecraft": ["1.21.6", "1.21.7", "1.21.8"]
"minecraft": ["1.21.9", "1.21.10"]
},
"custom": {
"modmenu": {

View File

@@ -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.6, 1.21.8]"
versionRange="[1.21.9, 1.21.10]"
ordering="NONE"
side="BOTH"

View File

@@ -2,19 +2,19 @@ org.gradle.jvmargs=-Xmx4G
available_loaders=fabric,neoforge,forge,tweaker
mod_version=1.15.0
mod_version=1.16.0
maven_group=baritone
archives_base_name=baritone
java_version=21
minecraft_version=1.21.8
minecraft_version=1.21.10
forge_version=58.0.0
forge_version=60.0.0
neoforge_version=2-beta
neoforge_version=1-beta
fabric_version=0.16.14
fabric_version=0.17.2
nether_pathfinder_version=1.4.1

View File

@@ -35,6 +35,9 @@ 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.6, 1.21.8]"
versionRange="[1.21.9, 1.21.10]"
ordering="NONE"
side="BOTH"
[[mixins]]
config = "mixins.baritone.json"

View File

@@ -32,7 +32,6 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.server.RegistryLayer;
import net.minecraft.server.ReloadableServerRegistries;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.progress.ChunkProgressListener;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.VanillaPackResources;
import net.minecraft.server.packs.repository.ServerPacksSource;
@@ -262,8 +261,8 @@ public final class BlockOptionalMeta {
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, ChunkProgressListener $$6, boolean $$7, long $$8, List<CustomSpawner> $$9, boolean $$10, @Nullable RandomSequences $$11) {
super($$0, $$1, $$2, $$3, $$4, $$5, $$6, $$7, $$8, $$9, $$10, $$11);
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);
}
@Override

View File

@@ -101,7 +101,7 @@ public abstract class MixinLivingEntity extends Entity {
method = "travelFallFlying",
at = @At(
value = "INVOKE",
target = "net/minecraft/world/entity/LivingEntity.move(Lnet/minecraft/world/entity/MoverType;Lnet/minecraft/world/phys/Vec3;)V",
target = "Lnet/minecraft/world/entity/LivingEntity;move(Lnet/minecraft/world/entity/MoverType;Lnet/minecraft/world/phys/Vec3;)V",
shift = At.Shift.AFTER
)
)

View File

@@ -24,7 +24,6 @@ import baritone.api.event.events.TickEvent;
import baritone.api.event.events.WorldEvent;
import baritone.api.event.events.type.EventState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.ReceivingLevelScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.player.LocalPlayer;
@@ -131,7 +130,7 @@ public class MixinMinecraft {
method = "setLevel",
at = @At("HEAD")
)
private void preLoadWorld(ClientLevel world, ReceivingLevelScreen.Reason arg2, CallbackInfo ci) {
private void preLoadWorld(final ClientLevel world, final CallbackInfo ci) {
// If we're unloading the world but one doesn't exist, ignore it
if (this.level == null && world == null) {
return;
@@ -151,7 +150,7 @@ public class MixinMinecraft {
method = "setLevel",
at = @At("RETURN")
)
private void postLoadWorld(ClientLevel world, ReceivingLevelScreen.Reason arg2, CallbackInfo ci) {
private void postLoadWorld(final ClientLevel world, final CallbackInfo ci) {
// still fire event for both null, as that means we've just finished exiting a world
// mc.world changing is only the primary baritone

View File

@@ -44,7 +44,7 @@ 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 GpuBufferSlice gpuBufferSlice, final Vector4f vector4f, final boolean bl2, final CallbackInfo ci) {
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) {
for (IBaritone ibaritone : BaritoneAPI.getProvider().getAllBaritones()) {
PoseStack poseStack = new PoseStack();
poseStack.mulPose(matrix4f);

View File

@@ -26,19 +26,12 @@ import baritone.api.utils.IPlayerContext;
import baritone.utils.accessor.IPalettedContainer;
import io.netty.buffer.Unpooled;
import net.minecraft.core.BlockPos;
import net.minecraft.core.IdMapper;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.util.BitStorage;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.GlobalPalette;
import net.minecraft.world.level.chunk.ChunkSource;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.LevelChunkSection;
import net.minecraft.world.level.chunk.Palette;
import net.minecraft.world.level.chunk.PalettedContainer;
import net.minecraft.world.level.chunk.SingleValuePalette;
import net.minecraft.world.level.chunk.*;
import java.util.ArrayList;
import java.util.List;
@@ -289,7 +282,7 @@ public enum FasterWorldScanner implements IWorldScanner {
return PALETTE_REGISTRY_SENTINEL;
} else {
FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
palette.write(buf);
palette.write(buf, Block.BLOCK_STATE_REGISTRY);
int size = buf.readVarInt();
BlockState[] states = new BlockState[size];
for (int i = 0; i < size; i++) {

View File

@@ -30,6 +30,7 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.LevelChunkSection;
import net.minecraft.world.level.chunk.PaletteResize;
import net.minecraft.world.level.chunk.PalettedContainer;
import net.minecraft.world.phys.Vec3;
@@ -195,7 +196,7 @@ public final class NetherPathfinderContext {
continue;
}
final PalettedContainer<BlockState> bsc = extendedblockstorage.getStates();
final int airId = ((IPalettedContainer<BlockState>) bsc).getPalette().idFor(AIR_BLOCK_STATE);
final int airId = ((IPalettedContainer<BlockState>) bsc).getPalette().idFor(AIR_BLOCK_STATE, PaletteResize.noResizeExpected());
// pasted from FasterWorldScanner
final BitStorage array = ((IPalettedContainer<BlockState>) bsc).getStorage();
if (array == null) continue;

View File

@@ -29,6 +29,7 @@ import com.mojang.blaze3d.vertex.MeshData;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import org.joml.Vector3f;
import org.joml.Vector4f;
import java.util.OptionalDouble;
@@ -56,6 +57,11 @@ public class BaritoneRenderType extends RenderType {
return this.renderPipeline.getVertexFormatMode();
}
@Override
public RenderPipeline pipeline() {
return this.renderPipeline;
}
@Override
public void draw(final MeshData meshData) {
this.setupRenderState();
@@ -84,7 +90,7 @@ public class BaritoneRenderType extends RenderType {
.writeTransform(
RenderSystem.getModelViewMatrix(),
new Vector4f(1.0F, 1.0F, 1.0F, 1.0F),
RenderSystem.getModelOffset(),
new Vector3f(),
RenderSystem.getTextureMatrix(),
RenderSystem.getShaderLineWidth()
);

View File

@@ -27,6 +27,7 @@ import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.input.MouseButtonEvent;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.ClickEvent;
@@ -84,9 +85,9 @@ public class GuiClick extends Screen implements Helper {
}
@Override
public boolean mouseReleased(double mouseX, double mouseY, int mouseButton) {
public boolean mouseReleased(MouseButtonEvent event) {
if (currentMouseOver != null) { //Catch this, or else a click into void will result in a crash
if (mouseButton == 0) {
if (event.button() == 0) {
if (clickStart != null && !clickStart.equals(currentMouseOver)) {
BaritoneAPI.getProvider().getPrimaryBaritone().getSelectionManager().removeAllSelections();
BaritoneAPI.getProvider().getPrimaryBaritone().getSelectionManager().addSelection(BetterBlockPos.from(clickStart), BetterBlockPos.from(currentMouseOver));
@@ -101,18 +102,18 @@ public class GuiClick extends Screen implements Helper {
} else {
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalBlock(currentMouseOver));
}
} else if (mouseButton == 1) {
} else if (event.button() == 1) {
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalBlock(currentMouseOver.above()));
}
}
clickStart = null;
return super.mouseReleased(mouseX, mouseY, mouseButton);
return super.mouseReleased(event);
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
public boolean mouseClicked(MouseButtonEvent event, boolean doubleClick) {
clickStart = currentMouseOver;
return super.mouseClicked(mouseX, mouseY, mouseButton);
return super.mouseClicked(event, doubleClick);
}
public void onRender(PoseStack modelViewStack, Matrix4f projectionMatrix) {

View File

@@ -27,7 +27,6 @@ import baritone.behavior.PathingBehavior;
import baritone.pathing.path.PathExecutor;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.blockentity.BeaconRenderer;
import net.minecraft.core.BlockPos;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
@@ -267,28 +266,7 @@ public final class PathRenderer implements IRenderer {
// inject hook into LevelRenderer#renderBlockEntities where the matrices have already been set up correctly
// copy out and modify the vanilla beacon render code
// also another issue on 1.21.5 is we don't have a simple method call for editing the beacon's depth test
stack.pushPose(); // push
stack.translate(goalPos.getX() - renderPosX, -renderPosY, goalPos.getZ() - renderPosZ); // translate
BeaconRenderer.renderBeaconBeam(
stack,
ctx.minecraft().renderBuffers().bufferSource(),
BeaconRenderer.BEAM_LOCATION,
settings.renderGoalAnimated.value ? partialTicks : 0,
1.0F,
settings.renderGoalAnimated.value ? ctx.world().getGameTime() : 0,
(int) minY,
(int) maxY,
color.getRGB(),
// Arguments filled by the private method lol
0.2F,
0.25F
);
stack.popPose(); // pop
return;
// return;
}
minX = goalPos.getX() + 0.002 - renderPosX;