Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.20.2 update #4119

Merged
merged 14 commits into from
Oct 9, 2023
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "fabric-loom" version "1.2-SNAPSHOT"
id "fabric-loom" version "1.4-SNAPSHOT"
id "maven-publish"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "com.github.johnrengelman.shadow" version "8.1.1"
}

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

// Launch sub project
shadow project(":launch")
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
org.gradle.jvmargs=-Xmx2G

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

# Mod Properties
mod_version=0.5.4
Expand All @@ -14,13 +14,13 @@ archives_base_name=meteor-client
# Dependency Versions

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

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

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

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

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

# Indium (https://github.com/comp500/Indium)
indium_version=1.0.25+mc1.20.1
indium_version=1.0.27+mc1.20.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private void basicInfo() {

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ public void mouseMoved(double mouseX, double mouseY) {
}

@Override
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
if (locked) return false;

root.mouseScrolled(amount);
root.mouseScrolled(verticalAmount);

return super.mouseScrolled(mouseX, mouseY, amount);
return super.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
}

@Override
Expand Down Expand Up @@ -197,8 +197,7 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
textBox.setCursorMax();

done.set(true);
}
else {
} else {
if (textBox.isFocused()) {
textBox.setFocused(false);
foundFocused.set(true);
Expand All @@ -220,8 +219,7 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) {

if (control && keyCode == GLFW_KEY_C && toClipboard()) {
return true;
}
else if (control && keyCode == GLFW_KEY_V && fromClipboard()) {
} else if (control && keyCode == GLFW_KEY_V && fromClipboard()) {
reload();
if (parent instanceof WidgetScreen wScreen) {
wScreen.reload();
Expand All @@ -247,7 +245,7 @@ public boolean charTyped(char chr, int keyCode) {

@Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
if (!Utils.canUpdate()) renderBackground(context);
if (!Utils.canUpdate()) renderBackground(context, mouseX, mouseY, delta);

double s = mc.getWindow().getScaleFactor();
mouseX *= s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
package meteordevelopment.meteorclient.mixin;

import meteordevelopment.meteorclient.utils.misc.FakeClientPlayer;
import meteordevelopment.meteorclient.utils.network.Capes;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -20,12 +17,6 @@

@Mixin(AbstractClientPlayerEntity.class)
public class AbstractClientPlayerEntityMixin {
@Inject(method = "getCapeTexture", at = @At("HEAD"), cancellable = true)
private void onGetCapeTexture(CallbackInfoReturnable<Identifier> info) {
Identifier id = Capes.get((PlayerEntity) (Object) this);
if (id != null) info.setReturnValue(id);
}

// Player model rendering in main menu

@Inject(method = "getPlayerListEntry", at = @At("HEAD"), cancellable = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void onInit(CallbackInfo info) {
DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes));

try {
NbtCompound tag = NbtIo.read(in);
NbtCompound tag = NbtIo.readCompressed(in);

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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
* Copyright (c) Meteor Development.
*/

package meteordevelopment.meteorclient.mixin;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import meteordevelopment.meteorclient.utils.network.Capes;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.feature.CapeFeatureRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(CapeFeatureRenderer.class)
public class CapeFeatureRendererMixin {
@ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/SkinTextures;capeTexture()Lnet/minecraft/util/Identifier;"))
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) {
return Capes.get(abstractClientPlayerEntity);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ private void onAddMessage(Text message, @Nullable MessageSignatureData signature
@ModifyExpressionValue(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;ILnet/minecraft/client/gui/hud/MessageIndicator;Z)V",
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"))
private int addMessageListSizeProxy(int size) {
if (Modules.get() == null) return size;

BetterChat betterChat = getBetterChat();
if (betterChat.isLongerChat() && betterChat.getChatLength() >= 100) return size - betterChat.getChatLength();
return size;
Expand Down Expand Up @@ -151,12 +153,16 @@ private MessageIndicator onRender_modifyIndicator(MessageIndicator indicator) {
@Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;ILnet/minecraft/client/gui/hud/MessageIndicator;Z)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;isChatFocused()Z"), locals = LocalCapture.CAPTURE_FAILSOFT)
private void onBreakChatMessageLines(Text message, MessageSignatureData signature, int ticks, MessageIndicator indicator, boolean refresh, CallbackInfo ci, int i, List<OrderedText> list) {
if (Modules.get() == null) return; // baritone calls addMessage before we initialise

getBetterChat().lines.add(0, list.size());
}

@Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;ILnet/minecraft/client/gui/hud/MessageIndicator;Z)V",
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;"))
private void onRemoveMessage(Text message, MessageSignatureData signature, int ticks, MessageIndicator indicator, boolean refresh, CallbackInfo ci) {
if (Modules.get() == null) return;

BetterChat betterChat = getBetterChat();
int size = betterChat.lines.size() - (betterChat.isLongerChat() && betterChat.getChatLength() >= 100 ? betterChat.getChatLength() : 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package meteordevelopment.meteorclient.mixin;

import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPipeline;
import io.netty.handler.proxy.Socks4ProxyHandler;
Expand All @@ -21,7 +20,8 @@
import meteordevelopment.meteorclient.systems.proxies.Proxy;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.NetworkSide;
import net.minecraft.network.PacketEncoderException;
import net.minecraft.network.handler.PacketEncoderException;
import net.minecraft.network.handler.PacketSizeLogger;
import net.minecraft.network.listener.ClientPlayPacketListener;
import net.minecraft.network.listener.PacketListener;
import net.minecraft.network.packet.Packet;
Expand Down Expand Up @@ -59,8 +59,8 @@ private void disconnect(Text disconnectReason, CallbackInfo ci) {
}
}

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

Expand All @@ -84,7 +84,7 @@ private void exceptionCaught(ChannelHandlerContext context, Throwable throwable,
}

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

Proxy proxy = Proxies.get().getEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientCommonNetworkHandler;
import net.minecraft.client.network.ClientConnectionState;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.packet.s2c.play.*;
import net.minecraft.world.chunk.WorldChunk;
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 @@ -40,10 +42,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ClientPlayNetworkHandler.class)
public abstract class ClientPlayNetworkHandlerMixin {
@Shadow
@Final
private MinecraftClient client;
public abstract class ClientPlayNetworkHandlerMixin extends ClientCommonNetworkHandler {
@Shadow
private ClientWorld world;

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

private boolean worldNotNull;

protected ClientPlayNetworkHandlerMixin(MinecraftClient client, ClientConnection connection, ClientConnectionState connectionState) {
super(client, connection, connectionState);
}

@Inject(method = "onEntitySpawn", at = @At("HEAD"), cancellable = true)
private void onEntitySpawn(EntitySpawnS2CPacket packet, CallbackInfo info) {
if (packet != null && packet.getEntityType() != null) {
Expand Down Expand Up @@ -85,7 +88,7 @@ private void onPlaySound(PlaySoundS2CPacket packet, CallbackInfo info) {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public abstract class ClientWorldMixin {

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

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

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.misc.AntiPacketKick;
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(CustomPayloadS2CPacket.class)
public class CustomPayloadS2CPacketMixin {
@ModifyConstant(method = "<init>", constant = @Constant(intValue = 1048576))
private int maxValue(int value) {
@ModifyConstant(method = "readUnknownPayload", constant = @Constant(intValue = 1048576))
private static int maxValue(int value) {
return Modules.get().isActive(AntiPacketKick.class) ? Integer.MAX_VALUE : value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@Mixin(DefaultSkinHelper.class)
public class DefaultSkinHelperMixin {
// Player model rendering in main menu
@Inject(method = "getSkin", at = @At("HEAD"), cancellable = true)
@Inject(method = "getSkinTextures(Ljava/util/UUID;)Lnet/minecraft/client/util/SkinTextures;", at = @At("HEAD"), cancellable = true)
private static void onShouldUseSlimModel(UUID uuid, CallbackInfoReturnable<Boolean> info) {
if (uuid == null) info.setReturnValue(false);
}
Expand Down
Loading