Skip to content

Commit 1ceea3e

Browse files
authored
1.20.2 update (MeteorDevelopment#4119)
1 parent 0e0808c commit 1ceea3e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+348
-237
lines changed

build.gradle

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
2-
id "fabric-loom" version "1.2-SNAPSHOT"
2+
id "fabric-loom" version "1.4-SNAPSHOT"
33
id "maven-publish"
4-
id "com.github.johnrengelman.shadow" version "7.1.2"
4+
id "com.github.johnrengelman.shadow" version "8.1.1"
55
}
66

77
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
@@ -69,8 +69,9 @@ dependencies {
6969
library "org.reflections:reflections:${project.reflections_version}"
7070
library("io.netty:netty-handler-proxy:${project.netty_version}") { transitive = false }
7171
library("io.netty:netty-codec-socks:${project.netty_version}") { transitive = false }
72-
library "com.github.LlamaLad7.MixinExtras:mixinextras-fabric:${project.mixin_extras_version}"
73-
annotationProcessor "com.github.LlamaLad7.MixinExtras:mixinextras-fabric:${project.mixin_extras_version}"
72+
library "io.github.llamalad7:mixinextras-fabric:${project.mixin_extras_version}"
73+
annotationProcessor "io.github.llamalad7:mixinextras-fabric:${project.mixin_extras_version}"
74+
library "de.florianmichael:WaybackAuthLib:1.0.0"
7475

7576
// Launch sub project
7677
shadow project(":launch")

gradle.properties

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
org.gradle.jvmargs=-Xmx2G
22

33
# Fabric (https://fabricmc.net/develop)
4-
minecraft_version=1.20.1
5-
yarn_mappings=1.20.1+build.1
6-
loader_version=0.14.21
7-
fapi_version=0.84.0+1.20.1
4+
minecraft_version=1.20.2
5+
yarn_mappings=1.20.2+build.4
6+
loader_version=0.14.22
7+
fapi_version=0.89.3+1.20.2
88

99
# Mod Properties
1010
mod_version=0.5.5
@@ -14,13 +14,13 @@ archives_base_name=meteor-client
1414
# Dependency Versions
1515

1616
# Sodium (https://github.com/CaffeineMC/sodium-fabric)
17-
sodium_version=mc1.20.1-0.5.0
17+
sodium_version=mc1.20.2-0.5.3
1818

1919
# Lithium (https://github.com/CaffeineMC/lithium-fabric)
20-
lithium_version=mc1.20-0.11.2
20+
lithium_version=mc1.20.2-0.12.0
2121

2222
# Iris (https://github.com/IrisShaders/Iris)
23-
iris_version=1.6.5+1.20.1
23+
iris_version=1.6.9+1.20.2
2424

2525
# Orbit (https://github.com/MeteorDevelopment/orbit)
2626
orbit_version=0.2.3
@@ -38,7 +38,7 @@ reflections_version=0.10.2
3838
netty_version=4.1.90.Final
3939

4040
# Mixin Extras (https://github.com/LlamaLad7/MixinExtras)
41-
mixin_extras_version=0.2.0-beta.8
41+
mixin_extras_version=0.2.0-rc.5
4242

4343
# Indium (https://github.com/comp500/Indium)
44-
indium_version=1.0.25+mc1.20.1
44+
indium_version=1.0.27+mc1.20.1
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/meteordevelopment/meteorclient/commands/commands/ServerCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private void basicInfo() {
194194

195195
info("Port: %d", ServerAddress.parse(server.address).getPort());
196196

197-
info("Type: %s", mc.player.getServerBrand() != null ? mc.player.getServerBrand() : "unknown");
197+
info("Type: %s", mc.player.getServer().getSaveProperties().getServerBrands() != null ? mc.player.getServer().getSaveProperties().getServerBrands() : "unknown");
198198

199199
info("Motd: %s", server.label != null ? server.label.getString() : "unknown");
200200

src/main/java/meteordevelopment/meteorclient/gui/WidgetScreen.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ public void mouseMoved(double mouseX, double mouseY) {
151151
}
152152

153153
@Override
154-
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
154+
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
155155
if (locked) return false;
156156

157-
root.mouseScrolled(amount);
157+
root.mouseScrolled(verticalAmount);
158158

159-
return super.mouseScrolled(mouseX, mouseY, amount);
159+
return super.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
160160
}
161161

162162
@Override
@@ -197,8 +197,7 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
197197
textBox.setCursorMax();
198198

199199
done.set(true);
200-
}
201-
else {
200+
} else {
202201
if (textBox.isFocused()) {
203202
textBox.setFocused(false);
204203
foundFocused.set(true);
@@ -220,8 +219,7 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
220219

221220
if (control && keyCode == GLFW_KEY_C && toClipboard()) {
222221
return true;
223-
}
224-
else if (control && keyCode == GLFW_KEY_V && fromClipboard()) {
222+
} else if (control && keyCode == GLFW_KEY_V && fromClipboard()) {
225223
reload();
226224
if (parent instanceof WidgetScreen wScreen) {
227225
wScreen.reload();
@@ -247,7 +245,7 @@ public boolean charTyped(char chr, int keyCode) {
247245

248246
@Override
249247
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
250-
if (!Utils.canUpdate()) renderBackground(context);
248+
if (!Utils.canUpdate()) renderBackground(context, mouseX, mouseY, delta);
251249

252250
double s = mc.getWindow().getScaleFactor();
253251
mouseX *= s;

src/main/java/meteordevelopment/meteorclient/mixin/AbstractClientPlayerEntityMixin.java

-9
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
package meteordevelopment.meteorclient.mixin;
77

88
import meteordevelopment.meteorclient.utils.misc.FakeClientPlayer;
9-
import meteordevelopment.meteorclient.utils.network.Capes;
109
import net.minecraft.client.network.AbstractClientPlayerEntity;
1110
import net.minecraft.client.network.PlayerListEntry;
12-
import net.minecraft.entity.player.PlayerEntity;
13-
import net.minecraft.util.Identifier;
1411
import org.spongepowered.asm.mixin.Mixin;
1512
import org.spongepowered.asm.mixin.injection.At;
1613
import org.spongepowered.asm.mixin.injection.Inject;
@@ -20,12 +17,6 @@
2017

2118
@Mixin(AbstractClientPlayerEntity.class)
2219
public class AbstractClientPlayerEntityMixin {
23-
@Inject(method = "getCapeTexture", at = @At("HEAD"), cancellable = true)
24-
private void onGetCapeTexture(CallbackInfoReturnable<Identifier> info) {
25-
Identifier id = Capes.get((PlayerEntity) (Object) this);
26-
if (id != null) info.setReturnValue(id);
27-
}
28-
2920
// Player model rendering in main menu
3021

3122
@Inject(method = "getPlayerListEntry", at = @At("HEAD"), cancellable = true)

src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private void onInit(CallbackInfo info) {
8787
DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes));
8888

8989
try {
90-
NbtCompound tag = NbtIo.read(in);
90+
NbtCompound tag = NbtIo.readCompressed(in);
9191

9292
NbtList listTag = tag.getList("pages", 8).copy();
9393

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3+
* Copyright (c) Meteor Development.
4+
*/
5+
6+
package meteordevelopment.meteorclient.mixin;
7+
8+
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
9+
import meteordevelopment.meteorclient.utils.network.Capes;
10+
import net.minecraft.client.network.AbstractClientPlayerEntity;
11+
import net.minecraft.client.render.VertexConsumerProvider;
12+
import net.minecraft.client.render.entity.feature.CapeFeatureRenderer;
13+
import net.minecraft.client.util.math.MatrixStack;
14+
import net.minecraft.util.Identifier;
15+
import org.spongepowered.asm.mixin.Mixin;
16+
import org.spongepowered.asm.mixin.injection.At;
17+
18+
@Mixin(CapeFeatureRenderer.class)
19+
public class CapeFeatureRendererMixin {
20+
@ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/SkinTextures;capeTexture()Lnet/minecraft/util/Identifier;"))
21+
private Identifier modifyCapeTexture(Identifier original, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, AbstractClientPlayerEntity abstractClientPlayerEntity, float f, float g, float h, float j, float k, float l) {
22+
return Capes.get(abstractClientPlayerEntity);
23+
}
24+
}

src/main/java/meteordevelopment/meteorclient/mixin/ChatHudMixin.java

+6
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ private void onAddMessage(Text message, @Nullable MessageSignatureData signature
121121
@ModifyExpressionValue(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;ILnet/minecraft/client/gui/hud/MessageIndicator;Z)V",
122122
slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/ChatHud;visibleMessages:Ljava/util/List;")), at = @At(value = "INVOKE", target = "Ljava/util/List;size()I"))
123123
private int addMessageListSizeProxy(int size) {
124+
if (Modules.get() == null) return size;
125+
124126
BetterChat betterChat = getBetterChat();
125127
if (betterChat.isLongerChat() && betterChat.getChatLength() >= 100) return size - betterChat.getChatLength();
126128
return size;
@@ -151,12 +153,16 @@ private MessageIndicator onRender_modifyIndicator(MessageIndicator indicator) {
151153
@Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;ILnet/minecraft/client/gui/hud/MessageIndicator;Z)V",
152154
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;isChatFocused()Z"), locals = LocalCapture.CAPTURE_FAILSOFT)
153155
private void onBreakChatMessageLines(Text message, MessageSignatureData signature, int ticks, MessageIndicator indicator, boolean refresh, CallbackInfo ci, int i, List<OrderedText> list) {
156+
if (Modules.get() == null) return; // baritone calls addMessage before we initialise
157+
154158
getBetterChat().lines.add(0, list.size());
155159
}
156160

157161
@Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;ILnet/minecraft/client/gui/hud/MessageIndicator;Z)V",
158162
slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/hud/ChatHud;messages:Ljava/util/List;")), at = @At(value = "INVOKE", target = "Ljava/util/List;remove(I)Ljava/lang/Object;"))
159163
private void onRemoveMessage(Text message, MessageSignatureData signature, int ticks, MessageIndicator indicator, boolean refresh, CallbackInfo ci) {
164+
if (Modules.get() == null) return;
165+
160166
BetterChat betterChat = getBetterChat();
161167
int size = betterChat.lines.size() - (betterChat.isLongerChat() && betterChat.getChatLength() >= 100 ? betterChat.getChatLength() : 0);
162168

src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package meteordevelopment.meteorclient.mixin;
77

8-
import io.netty.channel.ChannelFuture;
98
import io.netty.channel.ChannelHandlerContext;
109
import io.netty.channel.ChannelPipeline;
1110
import io.netty.handler.proxy.Socks4ProxyHandler;
@@ -21,7 +20,8 @@
2120
import meteordevelopment.meteorclient.systems.proxies.Proxy;
2221
import net.minecraft.network.ClientConnection;
2322
import net.minecraft.network.NetworkSide;
24-
import net.minecraft.network.PacketEncoderException;
23+
import net.minecraft.network.handler.PacketEncoderException;
24+
import net.minecraft.network.handler.PacketSizeLogger;
2525
import net.minecraft.network.listener.ClientPlayPacketListener;
2626
import net.minecraft.network.listener.PacketListener;
2727
import net.minecraft.network.packet.Packet;
@@ -59,8 +59,8 @@ private void disconnect(Text disconnectReason, CallbackInfo ci) {
5959
}
6060
}
6161

62-
@Inject(method = "connect", at = @At("HEAD"))
63-
private static void onConnect(InetSocketAddress address, boolean useEpoll, CallbackInfoReturnable<?> cir) {
62+
@Inject(method = "connect(Ljava/net/InetSocketAddress;ZLnet/minecraft/network/ClientConnection;)Lio/netty/channel/ChannelFuture;", at = @At("HEAD"))
63+
private static void onConnect(InetSocketAddress address, boolean useEpoll, ClientConnection connection, CallbackInfoReturnable<?> cir) {
6464
MeteorClient.EVENT_BUS.post(ServerConnectEndEvent.get(address));
6565
}
6666

@@ -84,7 +84,7 @@ private void exceptionCaught(ChannelHandlerContext context, Throwable throwable,
8484
}
8585

8686
@Inject(method = "addHandlers", at = @At("RETURN"))
87-
private static void onAddHandlers(ChannelPipeline pipeline, NetworkSide side, CallbackInfo ci) {
87+
private static void onAddHandlers(ChannelPipeline pipeline, NetworkSide side, PacketSizeLogger packetSizeLogger, CallbackInfo ci) {
8888
if (side != NetworkSide.CLIENTBOUND) return;
8989

9090
Proxy proxy = Proxies.get().getEnabled();

src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayNetworkHandlerMixin.java

+9-6
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
2626
import meteordevelopment.meteorclient.utils.player.ChatUtils;
2727
import net.minecraft.client.MinecraftClient;
28+
import net.minecraft.client.network.ClientCommonNetworkHandler;
29+
import net.minecraft.client.network.ClientConnectionState;
2830
import net.minecraft.client.network.ClientPlayNetworkHandler;
2931
import net.minecraft.client.world.ClientWorld;
3032
import net.minecraft.entity.Entity;
3133
import net.minecraft.entity.ItemEntity;
34+
import net.minecraft.network.ClientConnection;
3235
import net.minecraft.network.packet.s2c.play.*;
3336
import net.minecraft.world.chunk.WorldChunk;
34-
import org.spongepowered.asm.mixin.Final;
3537
import org.spongepowered.asm.mixin.Mixin;
3638
import org.spongepowered.asm.mixin.Shadow;
3739
import org.spongepowered.asm.mixin.Unique;
@@ -40,10 +42,7 @@
4042
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
4143

4244
@Mixin(ClientPlayNetworkHandler.class)
43-
public abstract class ClientPlayNetworkHandlerMixin {
44-
@Shadow
45-
@Final
46-
private MinecraftClient client;
45+
public abstract class ClientPlayNetworkHandlerMixin extends ClientCommonNetworkHandler {
4746
@Shadow
4847
private ClientWorld world;
4948

@@ -55,6 +54,10 @@ public abstract class ClientPlayNetworkHandlerMixin {
5554

5655
private boolean worldNotNull;
5756

57+
protected ClientPlayNetworkHandlerMixin(MinecraftClient client, ClientConnection connection, ClientConnectionState connectionState) {
58+
super(client, connection, connectionState);
59+
}
60+
5861
@Inject(method = "onEntitySpawn", at = @At("HEAD"), cancellable = true)
5962
private void onEntitySpawn(EntitySpawnS2CPacket packet, CallbackInfo info) {
6063
if (packet != null && packet.getEntityType() != null) {
@@ -85,7 +88,7 @@ private void onPlaySound(PlaySoundS2CPacket packet, CallbackInfo info) {
8588

8689
@Inject(method = "onChunkData", at = @At("TAIL"))
8790
private void onChunkData(ChunkDataS2CPacket packet, CallbackInfo info) {
88-
WorldChunk chunk = client.world.getChunk(packet.getX(), packet.getZ());
91+
WorldChunk chunk = client.world.getChunk(packet.getChunkX(), packet.getChunkZ());
8992
MeteorClient.EVENT_BUS.post(ChunkDataEvent.get(chunk));
9093
}
9194

src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public abstract class ClientWorldMixin {
3434

3535
@Shadow @Nullable public abstract Entity getEntityById(int id);
3636

37-
@Inject(method = "addEntityPrivate", at = @At("TAIL"))
38-
private void onAddEntityPrivate(int id, Entity entity, CallbackInfo info) {
37+
@Inject(method = "addEntity", at = @At("TAIL"))
38+
private void onAddEntity(Entity entity, CallbackInfo info) {
3939
if (entity != null) MeteorClient.EVENT_BUS.post(EntityAddedEvent.get(entity));
4040
}
4141

src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadC2SPacketAccessor.java

-26
This file was deleted.

src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
import meteordevelopment.meteorclient.systems.modules.Modules;
99
import meteordevelopment.meteorclient.systems.modules.misc.AntiPacketKick;
10-
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
10+
import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket;
1111
import org.spongepowered.asm.mixin.Mixin;
1212
import org.spongepowered.asm.mixin.injection.Constant;
1313
import org.spongepowered.asm.mixin.injection.ModifyConstant;
1414

1515
@Mixin(CustomPayloadS2CPacket.class)
1616
public class CustomPayloadS2CPacketMixin {
17-
@ModifyConstant(method = "<init>", constant = @Constant(intValue = 1048576))
18-
private int maxValue(int value) {
17+
@ModifyConstant(method = "readUnknownPayload", constant = @Constant(intValue = 1048576))
18+
private static int maxValue(int value) {
1919
return Modules.get().isActive(AntiPacketKick.class) ? Integer.MAX_VALUE : value;
2020
}
2121
}

src/main/java/meteordevelopment/meteorclient/mixin/DefaultSkinHelperMixin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@Mixin(DefaultSkinHelper.class)
1717
public class DefaultSkinHelperMixin {
1818
// Player model rendering in main menu
19-
@Inject(method = "getSkin", at = @At("HEAD"), cancellable = true)
19+
@Inject(method = "getSkinTextures(Ljava/util/UUID;)Lnet/minecraft/client/util/SkinTextures;", at = @At("HEAD"), cancellable = true)
2020
private static void onShouldUseSlimModel(UUID uuid, CallbackInfoReturnable<Boolean> info) {
2121
if (uuid == null) info.setReturnValue(false);
2222
}

0 commit comments

Comments
 (0)