Skip to content

Commit 9bf890a

Browse files
authored
Merge pull request #4136 from rfresh2/1.20.2
1.20.2
2 parents e1e620a + f5d1592 commit 9bf890a

File tree

8 files changed

+21
-127
lines changed

8 files changed

+21
-127
lines changed

fabric/src/main/resources/fabric.mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
],
2626

2727
"depends": {
28-
"fabricloader": ">=0.11.0",
29-
"minecraft": ">=1.20 <=1.20.1"
28+
"fabricloader": ">=0.14.22",
29+
"minecraft": "1.20.2"
3030
}
3131
}

forge/src/main/resources/META-INF/mods.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
77
modLoader="javafml" #mandatory
88
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
9-
loaderVersion="[46,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
9+
loaderVersion="[48,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
1010
license="https://raw.githubusercontent.com/cabaletta/baritone/1.16.2/LICENSE"
1111
# A URL to refer people to when problems occur with this mod
1212
issueTrackerURL="https://github.com/cabaletta/baritone/issues" #optional
@@ -35,6 +35,6 @@ A Minecraft pathfinder bot.
3535
modId="minecraft"
3636
mandatory=true
3737
# This version range declares a minimum of the current minecraft version up to but not including the next major version
38-
versionRange="[1.20,1.20.1]"
38+
versionRange="[1.20.2]"
3939
ordering="NONE"
4040
side="BOTH"

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ org.gradle.jvmargs=-Xmx4G
22

33
available_loaders=fabric,forge,tweaker
44

5-
mod_version=1.10.1
5+
mod_version=1.10.2
66
maven_group=baritone
77
archives_base_name=baritone
88

9-
minecraft_version=1.20.1
10-
forge_version=1.20.1-47.0.1
11-
fabric_version=0.14.18
9+
minecraft_version=1.20.2
10+
forge_version=1.20.2-48.0.1
11+
fabric_version=0.14.22

src/launch/java/baritone/launch/mixins/MixinClientPlayNetHandler.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@
2727
import baritone.api.utils.Pair;
2828
import baritone.cache.CachedChunk;
2929
import net.minecraft.client.Minecraft;
30+
import net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl;
3031
import net.minecraft.client.multiplayer.ClientPacketListener;
32+
import net.minecraft.client.multiplayer.CommonListenerCookie;
3133
import net.minecraft.client.player.LocalPlayer;
3234
import net.minecraft.core.BlockPos;
35+
import net.minecraft.network.Connection;
3336
import net.minecraft.network.protocol.game.*;
3437
import net.minecraft.world.level.ChunkPos;
3538
import net.minecraft.world.level.block.state.BlockState;
36-
import org.spongepowered.asm.mixin.Final;
3739
import org.spongepowered.asm.mixin.Mixin;
38-
import org.spongepowered.asm.mixin.Shadow;
3940
import org.spongepowered.asm.mixin.injection.At;
4041
import org.spongepowered.asm.mixin.injection.Inject;
4142
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -48,7 +49,7 @@
4849
* @since 8/3/2018
4950
*/
5051
@Mixin(ClientPacketListener.class)
51-
public class MixinClientPlayNetHandler {
52+
public abstract class MixinClientPlayNetHandler extends ClientCommonPacketListenerImpl {
5253

5354
// unused lol
5455
/*@Inject(
@@ -74,9 +75,9 @@ private void preRead(SPacketChunkData packetIn, CallbackInfo ci) {
7475
}
7576
}*/
7677

77-
@Shadow
78-
@Final
79-
private Minecraft minecraft;
78+
protected MixinClientPlayNetHandler(final Minecraft arg, final Connection arg2, final CommonListenerCookie arg3) {
79+
super(arg, arg2, arg3);
80+
}
8081

8182
@Inject(
8283
method = "sendChat(Ljava/lang/String;)V",
@@ -124,7 +125,7 @@ private void preChunkUnload(ClientboundForgetLevelChunkPacket packet, CallbackIn
124125
LocalPlayer player = ibaritone.getPlayerContext().player();
125126
if (player != null && player.connection == (ClientPacketListener) (Object) this) {
126127
ibaritone.getGameEventHandler().onChunkEvent(
127-
new ChunkEvent(EventState.PRE, ChunkEvent.Type.UNLOAD, packet.getX(), packet.getZ())
128+
new ChunkEvent(EventState.PRE, ChunkEvent.Type.UNLOAD, packet.pos().x, packet.pos().z)
128129
);
129130
}
130131
}
@@ -139,7 +140,7 @@ private void postChunkUnload(ClientboundForgetLevelChunkPacket packet, CallbackI
139140
LocalPlayer player = ibaritone.getPlayerContext().player();
140141
if (player != null && player.connection == (ClientPacketListener) (Object) this) {
141142
ibaritone.getGameEventHandler().onChunkEvent(
142-
new ChunkEvent(EventState.POST, ChunkEvent.Type.UNLOAD, packet.getX(), packet.getZ())
143+
new ChunkEvent(EventState.POST, ChunkEvent.Type.UNLOAD, packet.pos().x, packet.pos().z)
143144
);
144145
}
145146
}

src/launch/java/baritone/launch/mixins/MixinNetworkManager.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
import baritone.api.event.events.type.EventState;
2424
import io.netty.channel.Channel;
2525
import io.netty.channel.ChannelHandlerContext;
26-
import io.netty.util.concurrent.Future;
27-
import io.netty.util.concurrent.GenericFutureListener;
2826
import net.minecraft.network.Connection;
2927
import net.minecraft.network.PacketSendListener;
3028
import net.minecraft.network.protocol.Packet;
@@ -54,7 +52,7 @@ public class MixinNetworkManager {
5452
method = "sendPacket",
5553
at = @At("HEAD")
5654
)
57-
private void preDispatchPacket(Packet<?> packet, PacketSendListener packetSendListener, CallbackInfo ci) {
55+
private void preDispatchPacket(Packet<?> packet, PacketSendListener packetSendListener, boolean flush, CallbackInfo ci) {
5856
if (this.receiving != PacketFlow.CLIENTBOUND) {
5957
return;
6058
}
@@ -70,7 +68,7 @@ private void preDispatchPacket(Packet<?> packet, PacketSendListener packetSendLi
7068
method = "sendPacket",
7169
at = @At("RETURN")
7270
)
73-
private void postDispatchPacket(Packet<?> packet, PacketSendListener packetSendListener, CallbackInfo ci) {
71+
private void postDispatchPacket(Packet<?> packet, PacketSendListener packetSendListener, boolean flush, CallbackInfo ci) {
7472
if (this.receiving != PacketFlow.CLIENTBOUND) {
7573
return;
7674
}

src/main/java/baritone/cache/WorldProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private Optional<Tuple<Path, Path>> getSaveDirectories(Level world) {
140140
String folderName;
141141
final ServerData serverData = ctx.minecraft().getCurrentServer();
142142
if (serverData != null) {
143-
folderName = ctx.minecraft().isConnectedToRealms() ? "realms" : serverData.ip;
143+
folderName = serverData.isRealm() ? "realms" : serverData.ip;
144144
} else {
145145
//replaymod causes null currentServer and false singleplayer.
146146
System.out.println("World seems to be a replay. Not loading Baritone cache.");

src/main/java/baritone/process/FarmProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel) {
249249
}
250250
if (state.getBlock() instanceof BonemealableBlock) {
251251
BonemealableBlock ig = (BonemealableBlock) state.getBlock();
252-
if (ig.isValidBonemealTarget(ctx.world(), pos, state, true) && ig.isBonemealSuccess(ctx.world(), ctx.world().random, pos, state)) {
252+
if (ig.isValidBonemealTarget(ctx.world(), pos, state) && ig.isBonemealSuccess(ctx.world(), ctx.world().random, pos, state)) {
253253
bonemealable.add(pos);
254254
}
255255
}

tweaker/src/main/java/baritone/launch/LaunchTesting.java

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)