diff --git a/build.gradle b/build.gradle index 666ba25473..335f2911f2 100644 --- a/build.gradle +++ b/build.gradle @@ -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 @@ -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") diff --git a/gradle.properties b/gradle.properties index 0d58f0181c..183f686682 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 @@ -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 @@ -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 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fae08049a6..db9a6b825d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/src/main/java/meteordevelopment/meteorclient/commands/commands/ServerCommand.java b/src/main/java/meteordevelopment/meteorclient/commands/commands/ServerCommand.java index bf532fed28..ce1fb6f02c 100644 --- a/src/main/java/meteordevelopment/meteorclient/commands/commands/ServerCommand.java +++ b/src/main/java/meteordevelopment/meteorclient/commands/commands/ServerCommand.java @@ -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"); diff --git a/src/main/java/meteordevelopment/meteorclient/gui/WidgetScreen.java b/src/main/java/meteordevelopment/meteorclient/gui/WidgetScreen.java index 8ca1698fd6..1128b0b238 100644 --- a/src/main/java/meteordevelopment/meteorclient/gui/WidgetScreen.java +++ b/src/main/java/meteordevelopment/meteorclient/gui/WidgetScreen.java @@ -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 @@ -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); @@ -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(); @@ -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; diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/AbstractClientPlayerEntityMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/AbstractClientPlayerEntityMixin.java index a5945c409f..9f0d700cb3 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/AbstractClientPlayerEntityMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/AbstractClientPlayerEntityMixin.java @@ -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; @@ -20,12 +17,6 @@ @Mixin(AbstractClientPlayerEntity.class) public class AbstractClientPlayerEntityMixin { - @Inject(method = "getCapeTexture", at = @At("HEAD"), cancellable = true) - private void onGetCapeTexture(CallbackInfoReturnable 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) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java index ab937ccd9d..a1a1c95cc2 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/BookEditScreenMixin.java @@ -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(); diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/CapeFeatureRendererMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/CapeFeatureRendererMixin.java new file mode 100644 index 0000000000..b492d3cc5e --- /dev/null +++ b/src/main/java/meteordevelopment/meteorclient/mixin/CapeFeatureRendererMixin.java @@ -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); + } +} diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ChatHudMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ChatHudMixin.java index 9f194d731a..19aa45dbea 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ChatHudMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ChatHudMixin.java @@ -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; @@ -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 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); diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java index 47592eca6a..ddbf0dc837 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java @@ -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; @@ -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; @@ -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)); } @@ -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(); diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayNetworkHandlerMixin.java index 57bc791247..3016a695f9 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ClientPlayNetworkHandlerMixin.java @@ -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; @@ -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; @@ -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) { @@ -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)); } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java index e2b441b389..106d8a1d4b 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java @@ -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)); } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadC2SPacketAccessor.java b/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadC2SPacketAccessor.java deleted file mode 100644 index 6ca12566e4..0000000000 --- a/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadC2SPacketAccessor.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). - * Copyright (c) Meteor Development. - */ - -package meteordevelopment.meteorclient.mixin; - -import net.minecraft.network.PacketByteBuf; -import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket; -import net.minecraft.util.Identifier; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(CustomPayloadC2SPacket.class) -public interface CustomPayloadC2SPacketAccessor { - @Accessor("channel") - Identifier getChannel(); - - @Accessor("data") - PacketByteBuf getData(); - - @Mutable - @Accessor("data") - void setData(PacketByteBuf data); -} diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java index 553e0fe18e..01a3ff3fef 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java @@ -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 = "", 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; } } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/DefaultSkinHelperMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/DefaultSkinHelperMixin.java index 1eec65c6d7..a710fc3c87 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/DefaultSkinHelperMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/DefaultSkinHelperMixin.java @@ -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 info) { if (uuid == null) info.setReturnValue(false); } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java index 7e93545d24..3092d3f470 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java @@ -12,12 +12,11 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.TitleScreen; import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.gui.widget.GridWidget; -import net.minecraft.client.network.ServerAddress; -import net.minecraft.client.network.ServerInfo; -import net.minecraft.client.resource.language.I18n; +import net.minecraft.client.gui.widget.DirectionalLayoutWidget; import net.minecraft.text.Text; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -28,6 +27,9 @@ @Mixin(DisconnectedScreen.class) public abstract class DisconnectedScreenMixin extends Screen { + @Shadow + @Final + private DirectionalLayoutWidget grid; @Unique private ButtonWidget reconnectBtn; @Unique private double time = Modules.get().get(AutoReconnect.class).time.get() * 20; @@ -35,14 +37,15 @@ protected DisconnectedScreenMixin(Text title) { super(title); } - @Inject(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/GridWidget;refreshPositions()V", shift = At.Shift.BEFORE), locals = LocalCapture.CAPTURE_FAILHARD) - private void addButtons(CallbackInfo info, GridWidget.Adder adder) { + @Inject(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/DirectionalLayoutWidget;refreshPositions()V", shift = At.Shift.BEFORE), locals = LocalCapture.CAPTURE_FAILHARD) + private void addButtons(CallbackInfo ci, ButtonWidget buttonWidget) { AutoReconnect autoReconnect = Modules.get().get(AutoReconnect.class); if (autoReconnect.lastServerConnection != null) { - reconnectBtn = adder.add(new ButtonWidget.Builder(Text.literal(getText()), button -> tryConnecting()).build()); + reconnectBtn = new ButtonWidget.Builder(Text.literal(getText()), button -> tryConnecting()).build(); + grid.add(reconnectBtn); - adder.add( + grid.add( new ButtonWidget.Builder(Text.literal("Toggle Auto Reconnect"), button -> { autoReconnect.toggle(); reconnectBtn.setMessage(Text.literal(getText())); @@ -65,12 +68,14 @@ public void tick() { } } + @Unique private String getText() { String reconnectText = "Reconnect"; if (Modules.get().isActive(AutoReconnect.class)) reconnectText += " " + String.format("(%.1f)", time / 20); return reconnectText; } + @Unique private void tryConnecting() { var lastServer = Modules.get().get(AutoReconnect.class).lastServerConnection; ConnectScreen.connect(new TitleScreen(), mc, lastServer.left(), lastServer.right(), false); diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ElytraFeatureRendererMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ElytraFeatureRendererMixin.java new file mode 100644 index 0000000000..a96914a807 --- /dev/null +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ElytraFeatureRendererMixin.java @@ -0,0 +1,33 @@ +/* + * 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.ElytraFeatureRenderer; +import net.minecraft.client.render.entity.feature.FeatureRenderer; +import net.minecraft.client.render.entity.feature.FeatureRendererContext; +import net.minecraft.client.render.entity.model.EntityModel; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.LivingEntity; +import net.minecraft.util.Identifier; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +@Mixin(ElytraFeatureRenderer.class) +public abstract class ElytraFeatureRendererMixin> extends FeatureRenderer { + public ElytraFeatureRendererMixin(FeatureRendererContext context) { + super(context); + } + + @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, T livingEntity, float f, float g, float h, float j, float k, float l) { + if (!(livingEntity instanceof AbstractClientPlayerEntity playerEntity)) return original; + return Capes.get(playerEntity); + } +} diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/FileCacheAccessor.java b/src/main/java/meteordevelopment/meteorclient/mixin/FileCacheAccessor.java new file mode 100644 index 0000000000..3683e21f81 --- /dev/null +++ b/src/main/java/meteordevelopment/meteorclient/mixin/FileCacheAccessor.java @@ -0,0 +1,18 @@ +/* + * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). + * Copyright (c) Meteor Development. + */ + +package meteordevelopment.meteorclient.mixin; + +import net.minecraft.client.texture.PlayerSkinProvider; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import java.nio.file.Path; + +@Mixin(PlayerSkinProvider.FileCache.class) +public interface FileCacheAccessor { + @Accessor + Path getDirectory(); +} diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java index cdc94cc8fd..48ad6bacdd 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java @@ -7,20 +7,22 @@ import com.mojang.authlib.minecraft.MinecraftSessionService; import com.mojang.authlib.minecraft.UserApiService; +import com.mojang.authlib.yggdrasil.ProfileResult; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.SocialInteractionsManager; -import net.minecraft.client.report.AbuseReportContext; import net.minecraft.client.resource.ResourceReloadLogger; +import net.minecraft.client.session.ProfileKeys; +import net.minecraft.client.session.Session; +import net.minecraft.client.session.report.AbuseReportContext; import net.minecraft.client.texture.PlayerSkinProvider; -import net.minecraft.client.util.ProfileKeys; -import net.minecraft.client.util.Session; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mutable; import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.gen.Invoker; import java.net.Proxy; +import java.util.concurrent.CompletableFuture; @Mixin(MinecraftClient.class) public interface MinecraftClientAccessor { @@ -72,4 +74,8 @@ static int getFps() { @Mutable @Accessor("abuseReportContext") void setAbuseReportContext(AbuseReportContext abuseReportContext); + + @Mutable + @Accessor("gameProfileFuture") + void setGameProfileFuture(CompletableFuture future); } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientMixin.java index 02bdc0cc4b..94c0bad093 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientMixin.java @@ -141,7 +141,7 @@ private HitResult doItemUseMinecraftClientCrosshairTargetProxy(HitResult origina return MeteorClient.EVENT_BUS.post(ItemUseCrosshairTargetEvent.get(original)).target; } - @ModifyReturnValue(method = "reloadResources(Z)Ljava/util/concurrent/CompletableFuture;", at = @At("RETURN")) + @ModifyReturnValue(method = "reloadResources(ZLnet/minecraft/client/MinecraftClient$LoadingContext;)Ljava/util/concurrent/CompletableFuture;", at = @At("RETURN")) private CompletableFuture onReloadResourcesNewCompletableFuture(CompletableFuture original) { return original.thenRun(() -> MeteorClient.EVENT_BUS.post(ResourcePacksReloadedEvent.get())); } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/PacketByteBufMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/PacketByteBufMixin.java index 78401930af..aad3f17962 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/PacketByteBufMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/PacketByteBufMixin.java @@ -10,13 +10,17 @@ import net.minecraft.nbt.NbtTagSizeTracker; import net.minecraft.network.PacketByteBuf; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyArg; @Mixin(PacketByteBuf.class) public class PacketByteBufMixin { - @ModifyArg(method = "readNbt()Lnet/minecraft/nbt/NbtCompound;", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/PacketByteBuf;readNbt(Lnet/minecraft/nbt/NbtTagSizeTracker;)Lnet/minecraft/nbt/NbtCompound;")) + @Unique + private static final NbtTagSizeTracker EMPTY = new NbtTagSizeTracker(0L, 0); + + @ModifyArg(method = "readNbt()Lnet/minecraft/nbt/NbtCompound;", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/PacketByteBuf;readNbt(Lnet/minecraft/nbt/NbtTagSizeTracker;)Lnet/minecraft/nbt/NbtElement;")) private NbtTagSizeTracker xlPackets(NbtTagSizeTracker sizeTracker) { - return Modules.get().isActive(AntiPacketKick.class) ? NbtTagSizeTracker.EMPTY : sizeTracker; + return Modules.get().isActive(AntiPacketKick.class) ? EMPTY : sizeTracker; } } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerEntityRendererMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerEntityRendererMixin.java index ea35d8defe..434a79f3d7 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerEntityRendererMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerEntityRendererMixin.java @@ -30,7 +30,7 @@ private void modifyRenderLayer(Args args, MatrixStack matrices, VertexConsumerPr Chams chams = Modules.get().get(Chams.class); if (chams.isActive() && chams.hand.get()) { - Identifier texture = chams.handTexture.get() ? player.getSkinTexture() : Chams.BLANK; + Identifier texture = chams.handTexture.get() ? player.playerListEntry.getSkinTextures().texture() : Chams.BLANK; args.set(1, vertexConsumers.getBuffer(RenderLayer.getEntityTranslucent(texture))); } } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java index 7c5a0c1068..f040007d03 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java @@ -11,7 +11,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.PlayerListEntry; import net.minecraft.client.util.DefaultSkinHelper; -import net.minecraft.util.Identifier; +import net.minecraft.client.util.SkinTextures; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -23,11 +23,11 @@ public abstract class PlayerListEntryMixin { @Shadow public abstract GameProfile getProfile(); - @Inject(method = "getSkinTexture", at = @At("HEAD"), cancellable = true) - private void onGetTexture(CallbackInfoReturnable info) { + @Inject(method = "getSkinTextures", at = @At("HEAD"), cancellable = true) + private void onGetTexture(CallbackInfoReturnable info) { if (getProfile().getName().equals(MinecraftClient.getInstance().getSession().getUsername())) { if (Modules.get().get(NameProtect.class).skinProtect()) { - info.setReturnValue(DefaultSkinHelper.getTexture()); + info.setReturnValue(DefaultSkinHelper.getSkinTextures(getProfile())); } } } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerSkinProviderAccessor.java b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerSkinProviderAccessor.java index 5f2dc2f56e..88660357dd 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerSkinProviderAccessor.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerSkinProviderAccessor.java @@ -9,10 +9,8 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; -import java.io.File; - @Mixin(PlayerSkinProvider.class) public interface PlayerSkinProviderAccessor { - @Accessor("skinCacheDir") - File getSkinCacheDir(); + @Accessor("skinCache") + PlayerSkinProvider.FileCache getSkinCache(); } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ScreenMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ScreenMixin.java index b5dd66cd0d..ee67c6bdb5 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ScreenMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ScreenMixin.java @@ -21,7 +21,7 @@ @Mixin(value = Screen.class, priority = 500) // needs to be before baritone public abstract class ScreenMixin { - @Inject(method = "renderBackground(Lnet/minecraft/client/gui/DrawContext;)V", at = @At("HEAD"), cancellable = true) + @Inject(method = "renderBackground", at = @At("HEAD"), cancellable = true) private void onRenderBackground(CallbackInfo info) { if (Utils.canUpdate() && Modules.get().get(NoRender.class).noGuiBackground()) info.cancel(); diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/YggdrasilMinecraftSessionServiceAccessor.java b/src/main/java/meteordevelopment/meteorclient/mixin/YggdrasilMinecraftSessionServiceAccessor.java index 36dc719950..16ab642ec2 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/YggdrasilMinecraftSessionServiceAccessor.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/YggdrasilMinecraftSessionServiceAccessor.java @@ -6,15 +6,17 @@ package meteordevelopment.meteorclient.mixin; import com.mojang.authlib.Environment; -import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.ServicesKeySet; import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Invoker; +import java.net.Proxy; + @Mixin(YggdrasilMinecraftSessionService.class) public interface YggdrasilMinecraftSessionServiceAccessor { @Invoker("") - static YggdrasilMinecraftSessionService createYggdrasilMinecraftSessionService(final YggdrasilAuthenticationService service, final Environment env) { + static YggdrasilMinecraftSessionService createYggdrasilMinecraftSessionService(final ServicesKeySet servicesKeySet, final Proxy proxy, final Environment env) { throw new UnsupportedOperationException(); } } diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java index 96132e9d55..428a424eb9 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java @@ -10,18 +10,23 @@ import com.mojang.authlib.minecraft.UserApiService; import com.mojang.authlib.yggdrasil.ServicesKeyType; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import meteordevelopment.meteorclient.mixin.FileCacheAccessor; import meteordevelopment.meteorclient.mixin.MinecraftClientAccessor; import meteordevelopment.meteorclient.mixin.PlayerSkinProviderAccessor; import meteordevelopment.meteorclient.utils.misc.ISerializable; import meteordevelopment.meteorclient.utils.misc.NbtException; import net.minecraft.client.network.SocialInteractionsManager; -import net.minecraft.client.report.AbuseReportContext; -import net.minecraft.client.report.ReporterEnvironment; +import net.minecraft.client.session.ProfileKeys; +import net.minecraft.client.session.Session; +import net.minecraft.client.session.report.AbuseReportContext; +import net.minecraft.client.session.report.ReporterEnvironment; import net.minecraft.client.texture.PlayerSkinProvider; -import net.minecraft.client.util.ProfileKeys; -import net.minecraft.client.util.Session; import net.minecraft.nbt.NbtCompound; import net.minecraft.network.encryption.SignatureVerifier; +import net.minecraft.util.Util; + +import java.nio.file.Path; +import java.util.concurrent.CompletableFuture; import static meteordevelopment.meteorclient.MeteorClient.mc; @@ -62,7 +67,6 @@ public AccountCache getCache() { public static void setSession(Session session) { MinecraftClientAccessor mca = (MinecraftClientAccessor) mc; mca.setSession(session); - mc.getSessionProperties().clear(); UserApiService apiService; try { apiService = mca.getAuthenticationService().createUserApiService(session.getAccessToken()); @@ -73,6 +77,7 @@ public static void setSession(Session session) { mca.setSocialInteractionsManager(new SocialInteractionsManager(mc, apiService)); mca.setProfileKeys(ProfileKeys.create(apiService, session, mc.runDirectory.toPath())); mca.setAbuseReportContext(AbuseReportContext.create(ReporterEnvironment.ofIntegratedServer(), apiService)); + mca.setGameProfileFuture(CompletableFuture.supplyAsync(() -> mc.getSessionService().fetchProfile(mc.getSession().getUuidOrNull(), true), Util.getIoWorkerExecutor())); } public static void applyLoginEnvironment(YggdrasilAuthenticationService authService, MinecraftSessionService sessService) { @@ -80,7 +85,9 @@ public static void applyLoginEnvironment(YggdrasilAuthenticationService authServ mca.setAuthenticationService(authService); SignatureVerifier.create(authService.getServicesKeySet(), ServicesKeyType.PROFILE_KEY); mca.setSessionService(sessService); - mca.setSkinProvider(new PlayerSkinProvider(mc.getTextureManager(), ((PlayerSkinProviderAccessor) mc.getSkinProvider()).getSkinCacheDir(), sessService)); + PlayerSkinProvider.FileCache skinCache = ((PlayerSkinProviderAccessor) mc.getSkinProvider()).getSkinCache(); + Path skinCachePath = ((FileCacheAccessor) skinCache).getDirectory(); + mca.setSkinProvider(new PlayerSkinProvider(mc.getTextureManager(), skinCachePath, sessService, mc)); } @Override diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java index 684cf73437..8ab88f86be 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java @@ -5,7 +5,7 @@ package meteordevelopment.meteorclient.systems.accounts; -import com.mojang.util.UUIDTypeAdapter; +import com.mojang.util.UndashedUuid; import meteordevelopment.meteorclient.utils.misc.ISerializable; import meteordevelopment.meteorclient.utils.misc.NbtException; import meteordevelopment.meteorclient.utils.render.PlayerHeadTexture; @@ -23,7 +23,7 @@ public PlayerHeadTexture getHeadTexture() { public void loadHead() { if (uuid == null || uuid.isBlank()) return; - headTexture = PlayerHeadUtils.fetchHead(UUIDTypeAdapter.fromString(uuid)); + headTexture = PlayerHeadUtils.fetchHead(UndashedUuid.fromStringLenient(uuid)); } @Override diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/CrackedAccount.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/CrackedAccount.java index 447bb623b5..6087790b0d 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/CrackedAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/CrackedAccount.java @@ -7,7 +7,7 @@ import meteordevelopment.meteorclient.systems.accounts.Account; import meteordevelopment.meteorclient.systems.accounts.AccountType; -import net.minecraft.client.util.Session; +import net.minecraft.client.session.Session; import net.minecraft.util.Uuids; import java.util.Optional; @@ -28,7 +28,7 @@ public boolean login() { super.login(); cache.loadHead(); - setSession(new Session(name, Uuids.getOfflinePlayerUuid(name).toString(), "", Optional.empty(), Optional.empty(), Session.AccountType.MOJANG)); + setSession(new Session(name, Uuids.getOfflinePlayerUuid(name), "", Optional.empty(), Optional.empty(), Session.AccountType.MOJANG)); return true; } diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/EasyMCAccount.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/EasyMCAccount.java index 2731612249..e6f023df4e 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/EasyMCAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/EasyMCAccount.java @@ -7,12 +7,13 @@ import com.mojang.authlib.Environment; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.util.UndashedUuid; import meteordevelopment.meteorclient.mixin.MinecraftClientAccessor; import meteordevelopment.meteorclient.mixin.YggdrasilMinecraftSessionServiceAccessor; import meteordevelopment.meteorclient.systems.accounts.Account; import meteordevelopment.meteorclient.systems.accounts.AccountType; import meteordevelopment.meteorclient.utils.network.Http; -import net.minecraft.client.util.Session; +import net.minecraft.client.session.Session; import java.util.Optional; @@ -20,8 +21,8 @@ public class EasyMCAccount extends Account { - private static final Environment ENVIRONMENT = Environment.create("https://authserver.mojang.com", "https://api.mojang.com", "https://sessionserver.easymc.io", "https://api.minecraftservices.com", "EasyMC"); - private static final YggdrasilAuthenticationService SERVICE = new YggdrasilAuthenticationService(((MinecraftClientAccessor) mc).getProxy(), "", ENVIRONMENT); + private static final Environment ENVIRONMENT = new Environment("https://authserver.mojang.com", "https://sessionserver.easymc.io", "https://api.minecraftservices.com", "EasyMC"); + private static final YggdrasilAuthenticationService SERVICE = new YggdrasilAuthenticationService(((MinecraftClientAccessor) mc).getProxy(), ENVIRONMENT); public EasyMCAccount(String token) { super(AccountType.EasyMC, token); @@ -50,8 +51,8 @@ public boolean fetchInfo() { @Override public boolean login() { - applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE, ENVIRONMENT)); - setSession(new Session(cache.username, cache.uuid, name, Optional.empty(), Optional.empty(), Session.AccountType.MOJANG)); + applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE.getServicesKeySet(), SERVICE.getProxy(), ENVIRONMENT)); + setSession(new Session(cache.username, UndashedUuid.fromStringLenient(cache.uuid), name, Optional.empty(), Optional.empty(), Session.AccountType.MOJANG)); cache.loadHead(); return true; diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/MicrosoftAccount.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/MicrosoftAccount.java index 01404a9c09..ba0804ba71 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/MicrosoftAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/MicrosoftAccount.java @@ -5,10 +5,11 @@ package meteordevelopment.meteorclient.systems.accounts.types; +import com.mojang.util.UndashedUuid; import meteordevelopment.meteorclient.systems.accounts.Account; import meteordevelopment.meteorclient.systems.accounts.AccountType; import meteordevelopment.meteorclient.systems.accounts.MicrosoftLogin; -import net.minecraft.client.util.Session; +import net.minecraft.client.session.Session; import java.util.Optional; @@ -31,7 +32,7 @@ public boolean login() { cache.loadHead(); - setSession(new Session(cache.username, cache.uuid, token, Optional.empty(), Optional.empty(), Session.AccountType.MSA)); + setSession(new Session(cache.username, UndashedUuid.fromStringLenient(cache.uuid), token, Optional.empty(), Optional.empty(), Session.AccountType.MSA)); return true; } diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java index 2da37aeb27..b1c37466f2 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java @@ -5,25 +5,24 @@ package meteordevelopment.meteorclient.systems.accounts.types; -import com.mojang.authlib.Agent; import com.mojang.authlib.Environment; -import com.mojang.authlib.exceptions.AuthenticationException; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; -import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; +import de.florianmichael.waybackauthlib.InvalidCredentialsException; +import de.florianmichael.waybackauthlib.WaybackAuthLib; import meteordevelopment.meteorclient.MeteorClient; import meteordevelopment.meteorclient.mixin.MinecraftClientAccessor; import meteordevelopment.meteorclient.mixin.YggdrasilMinecraftSessionServiceAccessor; import meteordevelopment.meteorclient.systems.accounts.Account; import meteordevelopment.meteorclient.systems.accounts.AccountType; -import net.minecraft.client.util.Session; +import net.minecraft.client.session.Session; import java.util.Optional; import static meteordevelopment.meteorclient.MeteorClient.mc; public class TheAlteningAccount extends Account { - private static final Environment ENVIRONMENT = Environment.create("http://authserver.thealtening.com", "https://api.mojang.com", "http://sessionserver.thealtening.com", "https://api.minecraftservices.com", "The Altening"); - private static final YggdrasilAuthenticationService SERVICE = new YggdrasilAuthenticationService(((MinecraftClientAccessor) mc).getProxy(), "", ENVIRONMENT); + private static final Environment ENVIRONMENT = new Environment("http://authserver.thealtening.com", "http://sessionserver.thealtening.com", "https://api.minecraftservices.com", "The Altening"); + private static final YggdrasilAuthenticationService SERVICE = new YggdrasilAuthenticationService(((MinecraftClientAccessor) mc).getProxy(), ENVIRONMENT); public TheAlteningAccount(String token) { super(AccountType.TheAltening, token); @@ -31,42 +30,45 @@ public TheAlteningAccount(String token) { @Override public boolean fetchInfo() { - YggdrasilUserAuthentication auth = getAuth(); + WaybackAuthLib auth = getAuth(); try { auth.logIn(); - cache.username = auth.getSelectedProfile().getName(); - cache.uuid = auth.getSelectedProfile().getId().toString(); + cache.username = auth.getCurrentProfile().getName(); + cache.uuid = auth.getCurrentProfile().getId().toString(); return true; - } catch (AuthenticationException e) { + } catch (Exception e) { return false; } } @Override public boolean login() { - applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE, ENVIRONMENT)); + applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE.getServicesKeySet(), SERVICE.getProxy(), ENVIRONMENT)); - YggdrasilUserAuthentication auth = getAuth(); + WaybackAuthLib auth = getAuth(); try { auth.logIn(); - setSession(new Session(auth.getSelectedProfile().getName(), auth.getSelectedProfile().getId().toString(), auth.getAuthenticatedToken(), Optional.empty(), Optional.empty(), Session.AccountType.MOJANG)); + setSession(new Session(auth.getCurrentProfile().getName(), auth.getCurrentProfile().getId(), auth.getAccessToken(), Optional.empty(), Optional.empty(), Session.AccountType.MOJANG)); - cache.username = auth.getSelectedProfile().getName(); + cache.username = auth.getCurrentProfile().getName(); cache.loadHead(); return true; - } catch (AuthenticationException e) { + } catch (InvalidCredentialsException e) { + MeteorClient.LOG.error("Invalid TheAltening credentials."); + return false; + } catch (Exception e) { MeteorClient.LOG.error("Failed to login with TheAltening."); return false; } } - private YggdrasilUserAuthentication getAuth() { - YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) SERVICE.createUserAuthentication(Agent.MINECRAFT); + private WaybackAuthLib getAuth() { + WaybackAuthLib auth = new WaybackAuthLib(ENVIRONMENT.accountsHost()); auth.setUsername(name); auth.setPassword("Meteor on Crack!"); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java index 5b6187301f..16476b039a 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java @@ -5,7 +5,7 @@ package meteordevelopment.meteorclient.systems.friends; -import com.mojang.util.UUIDTypeAdapter; +import com.mojang.util.UndashedUuid; import meteordevelopment.meteorclient.utils.misc.ISerializable; import meteordevelopment.meteorclient.utils.network.Http; import meteordevelopment.meteorclient.utils.render.PlayerHeadTexture; @@ -50,7 +50,7 @@ public void updateInfo() { APIResponse res = Http.get("https://api.mojang.com/users/profiles/minecraft/" + name).sendJson(APIResponse.class); if (res == null || res.name == null || res.id == null) return; name = res.name; - id = UUIDTypeAdapter.fromString(res.id); + id = UndashedUuid.fromStringLenient(res.id); headTexture = PlayerHeadUtils.fetchHead(id); updating = false; } @@ -64,7 +64,7 @@ public NbtCompound toTag() { NbtCompound tag = new NbtCompound(); tag.putString("name", name); - if (id != null) tag.putString("id", UUIDTypeAdapter.fromUUID(id)); + if (id != null) tag.putString("id", UndashedUuid.toString(id)); return tag; } diff --git a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java index 8df4f22ebe..7227e58c4d 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java @@ -5,7 +5,7 @@ package meteordevelopment.meteorclient.systems.friends; -import com.mojang.util.UUIDTypeAdapter; +import com.mojang.util.UndashedUuid; import meteordevelopment.meteorclient.systems.System; import meteordevelopment.meteorclient.systems.Systems; import meteordevelopment.meteorclient.utils.misc.NbtUtils; @@ -119,7 +119,7 @@ public Friends fromTag(NbtCompound tag) { String uuid = friendTag.getString("id"); Friend friend = !uuid.isBlank() - ? new Friend(name, UUIDTypeAdapter.fromString(uuid)) + ? new Friend(name, UndashedUuid.fromStringLenient(uuid)) : new Friend(name); friends.add(friend); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/hud/Hud.java b/src/main/java/meteordevelopment/meteorclient/systems/hud/Hud.java index 04d89ec506..4e8b962de7 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/hud/Hud.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/hud/Hud.java @@ -224,7 +224,7 @@ private void onRender(Render2DEvent event) { if (Utils.isLoading()) return; if (!active || shouldHideHud()) return; - if ((mc.options.hudHidden || mc.options.debugEnabled) && !HudEditorScreen.isOpen()) return; + if ((mc.options.hudHidden || mc.inGameHud.getDebugHud().shouldShowDebugHud()) && !HudEditorScreen.isOpen()) return; HudRenderer.INSTANCE.begin(event.drawContext); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/CombatHud.java b/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/CombatHud.java index ee31b24347..000b7a65c5 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/CombatHud.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/CombatHud.java @@ -209,11 +209,15 @@ public void render(HudRenderer renderer) { // Player Model InventoryScreen.drawEntity( renderer.drawContext, + (int) x, + (int) y, (int) (x + (25 * scale.get())), (int) (y + (66 * scale.get())), (int) (30 * scale.get()), + 0, -MathHelper.wrapDegrees(playerEntity.prevYaw + (playerEntity.getYaw() - playerEntity.prevYaw) * mc.getTickDelta()), - -playerEntity.getPitch(), playerEntity + -playerEntity.getPitch(), + playerEntity ); // Moving pos to past player model @@ -254,8 +258,7 @@ public void render(HudRenderer renderer) { if (Friends.get().isFriend(playerEntity)) { friendText = "Friend"; friendColor = Config.get().friendColor.get(); - } - else { + } else { boolean naked = true; for (int position = 3; position >= 0; position--) { @@ -267,8 +270,7 @@ public void render(HudRenderer renderer) { if (naked) { friendText = "Naked"; friendColor = GREEN; - } - else { + } else { boolean threat = false; for (int position = 5; position >= 0; position--) { diff --git a/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/PlayerModelHud.java b/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/PlayerModelHud.java index 2f3aa7fd4f..f03133ce56 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/PlayerModelHud.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/PlayerModelHud.java @@ -99,7 +99,7 @@ public void render(HudRenderer renderer) { float yaw = copyYaw.get() ? MathHelper.wrapDegrees(player.prevYaw + (player.getYaw() - player.prevYaw) * mc.getTickDelta()) : (float) customYaw.get(); float pitch = copyPitch.get() ? player.getPitch() : (float) customPitch.get(); - InventoryScreen.drawEntity(renderer.drawContext, (int) (x + (25 * scale.get())), (int) (y + (66 * scale.get())), (int) (30 * scale.get()), -yaw, -pitch, player); + InventoryScreen.drawEntity(renderer.drawContext, x, y, (int) (x + (25 * scale.get())), (int) (y + (66 * scale.get())), (int) (30 * scale.get()), 0, -yaw, -pitch, player); }); if (background.get()) { diff --git a/src/main/java/meteordevelopment/meteorclient/systems/hud/screens/HudEditorScreen.java b/src/main/java/meteordevelopment/meteorclient/systems/hud/screens/HudEditorScreen.java index 5b69d1bacb..3aa991e061 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/hud/screens/HudEditorScreen.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/hud/screens/HudEditorScreen.java @@ -261,7 +261,7 @@ private void renderElement(HudElement element, Color bgColor, Color olColor) { @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(); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/AutoLog.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/AutoLog.java index e6f5349cbf..113e995ea5 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/AutoLog.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/AutoLog.java @@ -21,7 +21,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.decoration.EndCrystalEntity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket; +import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket; import net.minecraft.text.Text; public class AutoLog extends Module { diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/BetterChat.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/BetterChat.java index b260d10588..f60de694b6 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/BetterChat.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/BetterChat.java @@ -413,7 +413,7 @@ private void drawTexture(DrawContext context, IChatHudLine line, int y) { PlayerListEntry entry = mc.getNetworkHandler().getPlayerListEntry(sender.getId()); if (entry == null) return; - Identifier skin = entry.getSkinTexture(); + Identifier skin = entry.getSkinTextures().texture(); context.drawTexture(skin, 0, y, 8, 8, 8, 8, 8, 8, 64, 64); context.drawTexture(skin, 0, y, 8, 8, 40, 8, 8, 8, 64, 64); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/ServerSpoof.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/ServerSpoof.java index 8386f1600a..94edd3b9b0 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/ServerSpoof.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/ServerSpoof.java @@ -8,14 +8,14 @@ import io.netty.buffer.Unpooled; import meteordevelopment.meteorclient.MeteorClient; import meteordevelopment.meteorclient.events.packets.PacketEvent; -import meteordevelopment.meteorclient.mixin.CustomPayloadC2SPacketAccessor; import meteordevelopment.meteorclient.settings.*; import meteordevelopment.meteorclient.systems.modules.Categories; import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.orbit.EventHandler; import net.minecraft.network.PacketByteBuf; -import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket; -import net.minecraft.network.packet.s2c.play.ResourcePackSendS2CPacket; +import net.minecraft.network.packet.BrandCustomPayload; +import net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket; +import net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket; import net.minecraft.text.ClickEvent; import net.minecraft.text.HoverEvent; import net.minecraft.text.MutableText; @@ -77,11 +77,10 @@ private class Listener { private void onPacketSend(PacketEvent.Send event) { if (!isActive()) return; if (!(event.packet instanceof CustomPayloadC2SPacket)) return; - CustomPayloadC2SPacketAccessor packet = (CustomPayloadC2SPacketAccessor) event.packet; - Identifier id = packet.getChannel(); + Identifier id = ((CustomPayloadC2SPacket) event.packet).payload().id(); - if (spoofBrand.get() && id.equals(CustomPayloadC2SPacket.BRAND)) - packet.setData(new PacketByteBuf(Unpooled.buffer()).writeString(brand.get())); + if (spoofBrand.get() && id.equals(BrandCustomPayload.ID)) + event.packet.write(new PacketByteBuf(Unpooled.buffer()).writeString(brand.get())); if (blockChannels.get()) { for (String channel : channels.get()) { @@ -106,7 +105,7 @@ private void onPacketRecieve(PacketEvent.Receive event) { link.setStyle(link.getStyle() .withColor(Formatting.BLUE) .withUnderline(true) - .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, packet.getURL())) + .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, packet.getUrl())) .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal("Click to download"))) ); msg.append(link); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/ElytraBoost.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/ElytraBoost.java index a0b38e253a..4248fadda2 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/ElytraBoost.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/ElytraBoost.java @@ -95,7 +95,7 @@ private void boost() { FireworkRocketEntity entity = new FireworkRocketEntity(mc.world, itemStack, mc.player); fireworks.add(entity); if (playSound.get()) mc.world.playSoundFromEntity(mc.player, entity, SoundEvents.ENTITY_FIREWORK_ROCKET_LAUNCH, SoundCategory.AMBIENT, 3.0F, 1.0F); - mc.world.addEntity(entity.getId(), entity); + mc.world.addEntity(entity); } } diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/BetterTooltips.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/BetterTooltips.java index ba593fb806..cbf85e39ad 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/BetterTooltips.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/BetterTooltips.java @@ -236,7 +236,7 @@ private void appendTooltip(ItemStackTooltipEvent event) { NbtCompound effectTag = effects.getCompound(i); byte effectId = effectTag.getByte("EffectId"); int effectDuration = effectTag.contains("EffectDuration") ? effectTag.getInt("EffectDuration") : 160; - StatusEffect type = StatusEffect.byRawId(effectId); + StatusEffect type = Registries.STATUS_EFFECT.get(effectId); if (type != null) { StatusEffectInstance effect = new StatusEffectInstance(type, effectDuration, 0); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/BreakIndicators.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/BreakIndicators.java index c24d9942b2..ebf448ca16 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/BreakIndicators.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/BreakIndicators.java @@ -129,14 +129,14 @@ private void renderPacket(Render3DEvent event, List blocks) private void renderBlock(Render3DEvent event, Box orig, BlockPos pos, double shrinkFactor, double progress) { Box box = orig.shrink( - orig.getXLength() * shrinkFactor, - orig.getYLength() * shrinkFactor, - orig.getZLength() * shrinkFactor + orig.getLengthX() * shrinkFactor, + orig.getLengthY() * shrinkFactor, + orig.getLengthZ() * shrinkFactor ); - double xShrink = (orig.getXLength() * shrinkFactor) / 2; - double yShrink = (orig.getYLength() * shrinkFactor) / 2; - double zShrink = (orig.getZLength() * shrinkFactor) / 2; + double xShrink = (orig.getLengthX() * shrinkFactor) / 2; + double yShrink = (orig.getLengthY() * shrinkFactor) / 2; + double zShrink = (orig.getLengthZ() * shrinkFactor) / 2; double x1 = pos.getX() + box.minX + xShrink; double y1 = pos.getY() + box.minY + yShrink; diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/LogoutSpots.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/LogoutSpots.java index 4d00e47f44..a750a33afb 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/LogoutSpots.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/LogoutSpots.java @@ -212,9 +212,9 @@ public Entry(PlayerEntity entity) { y = entity.getY(); z = entity.getZ() - halfWidth; - xWidth = entity.getBoundingBox().getXLength(); - zWidth = entity.getBoundingBox().getZLength(); - height = entity.getBoundingBox().getYLength(); + xWidth = entity.getBoundingBox().getLengthX(); + zWidth = entity.getBoundingBox().getLengthZ(); + height = entity.getBoundingBox().getLengthY(); uuid = entity.getUuid(); name = entity.getEntityName(); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/world/InfinityMiner.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/world/InfinityMiner.java index 1d8eb64b1b..b1618bb819 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/world/InfinityMiner.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/world/InfinityMiner.java @@ -27,7 +27,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.item.PickaxeItem; -import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket; +import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket; import net.minecraft.text.Text; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/meteordevelopment/meteorclient/utils/Utils.java b/src/main/java/meteordevelopment/meteorclient/utils/Utils.java index c8e84ac468..3cbead6f0c 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/Utils.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/Utils.java @@ -56,7 +56,10 @@ import java.io.IOException; import java.io.InputStream; import java.net.InetSocketAddress; -import java.util.*; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Locale; +import java.util.Random; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -336,7 +339,7 @@ public static String getWorldName() { // Multiplayer if (mc.getCurrentServerEntry() != null) { - return mc.isConnectedToRealms() ? "realms" : mc.getCurrentServerEntry().address; + return mc.getCurrentServerEntry().isRealm() ? "realms" : mc.getCurrentServerEntry().address; } return ""; diff --git a/src/main/java/meteordevelopment/meteorclient/utils/entity/fakeplayer/FakePlayerEntity.java b/src/main/java/meteordevelopment/meteorclient/utils/entity/fakeplayer/FakePlayerEntity.java index 4ddc217c9e..381968a25a 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/entity/fakeplayer/FakePlayerEntity.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/entity/fakeplayer/FakePlayerEntity.java @@ -52,7 +52,7 @@ public FakePlayerEntity(PlayerEntity player, String name, float health, boolean public void spawn() { unsetRemoved(); - mc.world.addEntity(getId(), this); + mc.world.addEntity(this); } public void despawn() { diff --git a/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java b/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java index 9ecddf42e3..7f5a9e8ab3 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java @@ -5,10 +5,10 @@ package meteordevelopment.meteorclient.utils.misc; +import com.mojang.authlib.GameProfile; import meteordevelopment.meteorclient.MeteorClient; -import meteordevelopment.meteorclient.events.game.GameJoinedEvent; import meteordevelopment.meteorclient.utils.PreInit; -import meteordevelopment.orbit.EventHandler; +import net.minecraft.client.network.ClientConnectionState; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.OtherClientPlayerEntity; import net.minecraft.client.network.PlayerListEntry; @@ -18,6 +18,8 @@ import net.minecraft.network.NetworkSide; import net.minecraft.world.Difficulty; +import java.util.UUID; + import static meteordevelopment.meteorclient.MeteorClient.mc; public class FakeClientPlayer { @@ -25,7 +27,7 @@ public class FakeClientPlayer { private static PlayerEntity player; private static PlayerListEntry playerListEntry; - private static String lastId; + private static UUID lastId; private static boolean needsNewEntry; @PreInit @@ -33,19 +35,30 @@ public static void init() { MeteorClient.EVENT_BUS.subscribe(FakeClientPlayer.class); } - @EventHandler - private static void onGameJoined(GameJoinedEvent event) { - } - public static PlayerEntity getPlayer() { - String id = mc.getSession().getUuid(); + UUID id = mc.getSession().getUuidOrNull(); if (player == null || (!id.equals(lastId))) { if (world == null) { - world = new ClientWorld(new ClientPlayNetworkHandler(mc, null, new ClientConnection(NetworkSide.CLIENTBOUND), mc.getCurrentServerEntry(), mc.getSession().getProfile(), null), new ClientWorld.Properties(Difficulty.NORMAL, false, false), world.getRegistryKey(), world.getDimensionEntry(), 1, 1, mc::getProfiler, null, false, 0); + world = new ClientWorld( + new ClientPlayNetworkHandler( + mc, + new ClientConnection(NetworkSide.CLIENTBOUND), + new ClientConnectionState(new GameProfile(mc.getSession().getUuidOrNull(), mc.getSession().getUsername()), null, null, null, null, mc.getCurrentServerEntry(), null) + ), // todo test this + new ClientWorld.Properties(Difficulty.NORMAL, false, false), + world.getRegistryKey(), + world.getDimensionEntry(), + 1, + 1, + mc::getProfiler, + null, + false, + 0 + ); } - player = new OtherClientPlayerEntity(world, mc.getSession().getProfile()); + player = new OtherClientPlayerEntity(world, new GameProfile(id, mc.getSession().getUsername())); lastId = id; needsNewEntry = true; @@ -56,7 +69,7 @@ public static PlayerEntity getPlayer() { public static PlayerListEntry getPlayerListEntry() { if (playerListEntry == null || needsNewEntry) { - playerListEntry = new PlayerListEntry(mc.getSession().getProfile(), false); + playerListEntry = new PlayerListEntry(new GameProfile(lastId, mc.getSession().getUsername()), false); needsNewEntry = false; } diff --git a/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java b/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java index 6e5cbc6123..76494d2559 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java @@ -36,6 +36,8 @@ public class PacketUtils { C2S_PACKETS_R.put("ClientStatusC2SPacket", net.minecraft.network.packet.c2s.play.ClientStatusC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket.class, "PlayerInteractItemC2SPacket"); C2S_PACKETS_R.put("PlayerInteractItemC2SPacket", net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.login.EnterConfigurationC2SPacket.class, "EnterConfigurationC2SPacket"); + C2S_PACKETS_R.put("EnterConfigurationC2SPacket", net.minecraft.network.packet.c2s.login.EnterConfigurationC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.class, "PlayerActionC2SPacket"); C2S_PACKETS_R.put("PlayerActionC2SPacket", net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.SelectMerchantTradeC2SPacket.class, "SelectMerchantTradeC2SPacket"); @@ -52,14 +54,14 @@ public class PacketUtils { C2S_PACKETS_R.put("QueryBlockNbtC2SPacket", net.minecraft.network.packet.c2s.play.QueryBlockNbtC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket.class, "PlayerInteractEntityC2SPacket"); C2S_PACKETS_R.put("PlayerInteractEntityC2SPacket", net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.AcknowledgeReconfigurationC2SPacket.class, "AcknowledgeReconfigurationC2SPacket"); + C2S_PACKETS_R.put("AcknowledgeReconfigurationC2SPacket", net.minecraft.network.packet.c2s.play.AcknowledgeReconfigurationC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket.class, "RequestCommandCompletionsC2SPacket"); C2S_PACKETS_R.put("RequestCommandCompletionsC2SPacket", net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.UpdatePlayerAbilitiesC2SPacket.class, "UpdatePlayerAbilitiesC2SPacket"); C2S_PACKETS_R.put("UpdatePlayerAbilitiesC2SPacket", net.minecraft.network.packet.c2s.play.UpdatePlayerAbilitiesC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.query.QueryRequestC2SPacket.class, "QueryRequestC2SPacket"); C2S_PACKETS_R.put("QueryRequestC2SPacket", net.minecraft.network.packet.c2s.query.QueryRequestC2SPacket.class); - C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket.class, "CustomPayloadC2SPacket"); - C2S_PACKETS_R.put("CustomPayloadC2SPacket", net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.UpdateCommandBlockC2SPacket.class, "UpdateCommandBlockC2SPacket"); C2S_PACKETS_R.put("UpdateCommandBlockC2SPacket", net.minecraft.network.packet.c2s.play.UpdateCommandBlockC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.HandSwingC2SPacket.class, "HandSwingC2SPacket"); @@ -68,8 +70,8 @@ public class PacketUtils { C2S_PACKETS_R.put("ClickSlotC2SPacket", net.minecraft.network.packet.c2s.play.ClickSlotC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.AdvancementTabC2SPacket.class, "AdvancementTabC2SPacket"); C2S_PACKETS_R.put("AdvancementTabC2SPacket", net.minecraft.network.packet.c2s.play.AdvancementTabC2SPacket.class); - C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.ClientSettingsC2SPacket.class, "ClientSettingsC2SPacket"); - C2S_PACKETS_R.put("ClientSettingsC2SPacket", net.minecraft.network.packet.c2s.play.ClientSettingsC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.AcknowledgeChunksC2SPacket.class, "AcknowledgeChunksC2SPacket"); + C2S_PACKETS_R.put("AcknowledgeChunksC2SPacket", net.minecraft.network.packet.c2s.play.AcknowledgeChunksC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.SpectatorTeleportC2SPacket.class, "SpectatorTeleportC2SPacket"); C2S_PACKETS_R.put("SpectatorTeleportC2SPacket", net.minecraft.network.packet.c2s.play.SpectatorTeleportC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.UpdateDifficultyLockC2SPacket.class, "UpdateDifficultyLockC2SPacket"); @@ -84,20 +86,28 @@ public class PacketUtils { C2S_PACKETS_R.put("UpdateSelectedSlotC2SPacket", net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.RecipeCategoryOptionsC2SPacket.class, "RecipeCategoryOptionsC2SPacket"); C2S_PACKETS_R.put("RecipeCategoryOptionsC2SPacket", net.minecraft.network.packet.c2s.play.RecipeCategoryOptionsC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.common.ResourcePackStatusC2SPacket.class, "ResourcePackStatusC2SPacket"); + C2S_PACKETS_R.put("ResourcePackStatusC2SPacket", net.minecraft.network.packet.c2s.common.ResourcePackStatusC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket.class, "PlayerMoveC2SPacket"); C2S_PACKETS_R.put("PlayerMoveC2SPacket", net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.common.ClientOptionsC2SPacket.class, "ClientOptionsC2SPacket"); + C2S_PACKETS_R.put("ClientOptionsC2SPacket", net.minecraft.network.packet.c2s.common.ClientOptionsC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket.class, "CustomPayloadC2SPacket"); + C2S_PACKETS_R.put("CustomPayloadC2SPacket", net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.PickFromInventoryC2SPacket.class, "PickFromInventoryC2SPacket"); C2S_PACKETS_R.put("PickFromInventoryC2SPacket", net.minecraft.network.packet.c2s.play.PickFromInventoryC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.PlayerSessionC2SPacket.class, "PlayerSessionC2SPacket"); C2S_PACKETS_R.put("PlayerSessionC2SPacket", net.minecraft.network.packet.c2s.play.PlayerSessionC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket.class, "CloseHandledScreenC2SPacket"); C2S_PACKETS_R.put("CloseHandledScreenC2SPacket", net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.config.ReadyC2SPacket.class, "ReadyC2SPacket"); + C2S_PACKETS_R.put("ReadyC2SPacket", net.minecraft.network.packet.c2s.config.ReadyC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.BoatPaddleStateC2SPacket.class, "BoatPaddleStateC2SPacket"); C2S_PACKETS_R.put("BoatPaddleStateC2SPacket", net.minecraft.network.packet.c2s.play.BoatPaddleStateC2SPacket.class); - C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.ButtonClickC2SPacket.class, "ButtonClickC2SPacket"); - C2S_PACKETS_R.put("ButtonClickC2SPacket", net.minecraft.network.packet.c2s.play.ButtonClickC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket.class, "ChatMessageC2SPacket"); C2S_PACKETS_R.put("ChatMessageC2SPacket", net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.ButtonClickC2SPacket.class, "ButtonClickC2SPacket"); + C2S_PACKETS_R.put("ButtonClickC2SPacket", net.minecraft.network.packet.c2s.play.ButtonClickC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.UpdateBeaconC2SPacket.class, "UpdateBeaconC2SPacket"); C2S_PACKETS_R.put("UpdateBeaconC2SPacket", net.minecraft.network.packet.c2s.play.UpdateBeaconC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.TeleportConfirmC2SPacket.class, "TeleportConfirmC2SPacket"); @@ -108,8 +118,8 @@ public class PacketUtils { C2S_PACKETS_R.put("UpdateStructureBlockC2SPacket", net.minecraft.network.packet.c2s.play.UpdateStructureBlockC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.UpdateCommandBlockMinecartC2SPacket.class, "UpdateCommandBlockMinecartC2SPacket"); C2S_PACKETS_R.put("UpdateCommandBlockMinecartC2SPacket", net.minecraft.network.packet.c2s.play.UpdateCommandBlockMinecartC2SPacket.class); - C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.KeepAliveC2SPacket.class, "KeepAliveC2SPacket"); - C2S_PACKETS_R.put("KeepAliveC2SPacket", net.minecraft.network.packet.c2s.play.KeepAliveC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.common.CommonPongC2SPacket.class, "CommonPongC2SPacket"); + C2S_PACKETS_R.put("CommonPongC2SPacket", net.minecraft.network.packet.c2s.common.CommonPongC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.PlayerInputC2SPacket.class, "PlayerInputC2SPacket"); C2S_PACKETS_R.put("PlayerInputC2SPacket", net.minecraft.network.packet.c2s.play.PlayerInputC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket.class, "ClientCommandC2SPacket"); @@ -118,12 +128,10 @@ public class PacketUtils { C2S_PACKETS_R.put("UpdateJigsawC2SPacket", net.minecraft.network.packet.c2s.play.UpdateJigsawC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.query.QueryPingC2SPacket.class, "QueryPingC2SPacket"); C2S_PACKETS_R.put("QueryPingC2SPacket", net.minecraft.network.packet.c2s.query.QueryPingC2SPacket.class); - C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.ResourcePackStatusC2SPacket.class, "ResourcePackStatusC2SPacket"); - C2S_PACKETS_R.put("ResourcePackStatusC2SPacket", net.minecraft.network.packet.c2s.play.ResourcePackStatusC2SPacket.class); - C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.PlayPongC2SPacket.class, "PlayPongC2SPacket"); - C2S_PACKETS_R.put("PlayPongC2SPacket", net.minecraft.network.packet.c2s.play.PlayPongC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.MessageAcknowledgmentC2SPacket.class, "MessageAcknowledgmentC2SPacket"); C2S_PACKETS_R.put("MessageAcknowledgmentC2SPacket", net.minecraft.network.packet.c2s.play.MessageAcknowledgmentC2SPacket.class); + C2S_PACKETS.put(net.minecraft.network.packet.c2s.common.KeepAliveC2SPacket.class, "KeepAliveC2SPacket"); + C2S_PACKETS_R.put("KeepAliveC2SPacket", net.minecraft.network.packet.c2s.common.KeepAliveC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket.class, "VehicleMoveC2SPacket"); C2S_PACKETS_R.put("VehicleMoveC2SPacket", net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket.class, "CreativeInventoryActionC2SPacket"); @@ -153,10 +161,6 @@ public class PacketUtils { S2C_PACKETS_R.put("WorldBorderSizeChangedS2CPacket", net.minecraft.network.packet.s2c.play.WorldBorderSizeChangedS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.AdvancementUpdateS2CPacket.class, "AdvancementUpdateS2CPacket"); S2C_PACKETS_R.put("AdvancementUpdateS2CPacket", net.minecraft.network.packet.s2c.play.AdvancementUpdateS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket.class, "CustomPayloadS2CPacket"); - S2C_PACKETS_R.put("CustomPayloadS2CPacket", net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.FeaturesS2CPacket.class, "FeaturesS2CPacket"); - S2C_PACKETS_R.put("FeaturesS2CPacket", net.minecraft.network.packet.s2c.play.FeaturesS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.WorldBorderInterpolateSizeS2CPacket.class, "WorldBorderInterpolateSizeS2CPacket"); S2C_PACKETS_R.put("WorldBorderInterpolateSizeS2CPacket", net.minecraft.network.packet.s2c.play.WorldBorderInterpolateSizeS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ChunkLoadDistanceS2CPacket.class, "ChunkLoadDistanceS2CPacket"); @@ -173,6 +177,8 @@ public class PacketUtils { S2C_PACKETS_R.put("RemoveMessageS2CPacket", net.minecraft.network.packet.s2c.play.RemoveMessageS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.SetCameraEntityS2CPacket.class, "SetCameraEntityS2CPacket"); S2C_PACKETS_R.put("SetCameraEntityS2CPacket", net.minecraft.network.packet.s2c.play.SetCameraEntityS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket.class, "ResourcePackSendS2CPacket"); + S2C_PACKETS_R.put("ResourcePackSendS2CPacket", net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.DamageTiltS2CPacket.class, "DamageTiltS2CPacket"); S2C_PACKETS_R.put("DamageTiltS2CPacket", net.minecraft.network.packet.s2c.play.DamageTiltS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.StatisticsS2CPacket.class, "StatisticsS2CPacket"); @@ -185,14 +191,14 @@ public class PacketUtils { S2C_PACKETS_R.put("VehicleMoveS2CPacket", net.minecraft.network.packet.s2c.play.VehicleMoveS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityAttributesS2CPacket.class, "EntityAttributesS2CPacket"); S2C_PACKETS_R.put("EntityAttributesS2CPacket", net.minecraft.network.packet.s2c.play.EntityAttributesS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.StopSoundS2CPacket.class, "StopSoundS2CPacket"); - S2C_PACKETS_R.put("StopSoundS2CPacket", net.minecraft.network.packet.s2c.play.StopSoundS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ScoreboardObjectiveUpdateS2CPacket.class, "ScoreboardObjectiveUpdateS2CPacket"); S2C_PACKETS_R.put("ScoreboardObjectiveUpdateS2CPacket", net.minecraft.network.packet.s2c.play.ScoreboardObjectiveUpdateS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.StopSoundS2CPacket.class, "StopSoundS2CPacket"); + S2C_PACKETS_R.put("StopSoundS2CPacket", net.minecraft.network.packet.s2c.play.StopSoundS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.StartChunkSendS2CPacket.class, "StartChunkSendS2CPacket"); + S2C_PACKETS_R.put("StartChunkSendS2CPacket", net.minecraft.network.packet.s2c.play.StartChunkSendS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntitySetHeadYawS2CPacket.class, "EntitySetHeadYawS2CPacket"); S2C_PACKETS_R.put("EntitySetHeadYawS2CPacket", net.minecraft.network.packet.s2c.play.EntitySetHeadYawS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.KeepAliveS2CPacket.class, "KeepAliveS2CPacket"); - S2C_PACKETS_R.put("KeepAliveS2CPacket", net.minecraft.network.packet.s2c.play.KeepAliveS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.SetTradeOffersS2CPacket.class, "SetTradeOffersS2CPacket"); S2C_PACKETS_R.put("SetTradeOffersS2CPacket", net.minecraft.network.packet.s2c.play.SetTradeOffersS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.SelectAdvancementTabS2CPacket.class, "SelectAdvancementTabS2CPacket"); @@ -201,14 +207,16 @@ public class PacketUtils { S2C_PACKETS_R.put("PlaySoundS2CPacket", net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.BlockEventS2CPacket.class, "BlockEventS2CPacket"); S2C_PACKETS_R.put("BlockEventS2CPacket", net.minecraft.network.packet.s2c.play.BlockEventS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ChunkSentS2CPacket.class, "ChunkSentS2CPacket"); + S2C_PACKETS_R.put("ChunkSentS2CPacket", net.minecraft.network.packet.s2c.play.ChunkSentS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket.class, "PlayerPositionLookS2CPacket"); S2C_PACKETS_R.put("PlayerPositionLookS2CPacket", net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket.class, "HealthUpdateS2CPacket"); S2C_PACKETS_R.put("HealthUpdateS2CPacket", net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.PlayPingS2CPacket.class, "PlayPingS2CPacket"); - S2C_PACKETS_R.put("PlayPingS2CPacket", net.minecraft.network.packet.s2c.play.PlayPingS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.WorldEventS2CPacket.class, "WorldEventS2CPacket"); S2C_PACKETS_R.put("WorldEventS2CPacket", net.minecraft.network.packet.s2c.play.WorldEventS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.common.SynchronizeTagsS2CPacket.class, "SynchronizeTagsS2CPacket"); + S2C_PACKETS_R.put("SynchronizeTagsS2CPacket", net.minecraft.network.packet.s2c.common.SynchronizeTagsS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ServerMetadataS2CPacket.class, "ServerMetadataS2CPacket"); S2C_PACKETS_R.put("ServerMetadataS2CPacket", net.minecraft.network.packet.s2c.play.ServerMetadataS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.UpdateSelectedSlotS2CPacket.class, "UpdateSelectedSlotS2CPacket"); @@ -217,14 +225,14 @@ public class PacketUtils { S2C_PACKETS_R.put("ChunkDeltaUpdateS2CPacket", net.minecraft.network.packet.s2c.play.ChunkDeltaUpdateS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.query.QueryResponseS2CPacket.class, "QueryResponseS2CPacket"); S2C_PACKETS_R.put("QueryResponseS2CPacket", net.minecraft.network.packet.s2c.query.QueryResponseS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.CooldownUpdateS2CPacket.class, "CooldownUpdateS2CPacket"); - S2C_PACKETS_R.put("CooldownUpdateS2CPacket", net.minecraft.network.packet.s2c.play.CooldownUpdateS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.TeamS2CPacket.class, "TeamS2CPacket"); S2C_PACKETS_R.put("TeamS2CPacket", net.minecraft.network.packet.s2c.play.TeamS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityAnimationS2CPacket.class, "EntityAnimationS2CPacket"); - S2C_PACKETS_R.put("EntityAnimationS2CPacket", net.minecraft.network.packet.s2c.play.EntityAnimationS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.CooldownUpdateS2CPacket.class, "CooldownUpdateS2CPacket"); + S2C_PACKETS_R.put("CooldownUpdateS2CPacket", net.minecraft.network.packet.s2c.play.CooldownUpdateS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ExperienceOrbSpawnS2CPacket.class, "ExperienceOrbSpawnS2CPacket"); S2C_PACKETS_R.put("ExperienceOrbSpawnS2CPacket", net.minecraft.network.packet.s2c.play.ExperienceOrbSpawnS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityAnimationS2CPacket.class, "EntityAnimationS2CPacket"); + S2C_PACKETS_R.put("EntityAnimationS2CPacket", net.minecraft.network.packet.s2c.play.EntityAnimationS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.OpenScreenS2CPacket.class, "OpenScreenS2CPacket"); S2C_PACKETS_R.put("OpenScreenS2CPacket", net.minecraft.network.packet.s2c.play.OpenScreenS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.PlayerAbilitiesS2CPacket.class, "PlayerAbilitiesS2CPacket"); @@ -245,18 +253,18 @@ public class PacketUtils { S2C_PACKETS_R.put("OverlayMessageS2CPacket", net.minecraft.network.packet.s2c.play.OverlayMessageS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.WorldBorderCenterChangedS2CPacket.class, "WorldBorderCenterChangedS2CPacket"); S2C_PACKETS_R.put("WorldBorderCenterChangedS2CPacket", net.minecraft.network.packet.s2c.play.WorldBorderCenterChangedS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.DifficultyS2CPacket.class, "DifficultyS2CPacket"); - S2C_PACKETS_R.put("DifficultyS2CPacket", net.minecraft.network.packet.s2c.play.DifficultyS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket.class, "EntityVelocityUpdateS2CPacket"); S2C_PACKETS_R.put("EntityVelocityUpdateS2CPacket", net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.DifficultyS2CPacket.class, "DifficultyS2CPacket"); + S2C_PACKETS_R.put("DifficultyS2CPacket", net.minecraft.network.packet.s2c.play.DifficultyS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.LookAtS2CPacket.class, "LookAtS2CPacket"); S2C_PACKETS_R.put("LookAtS2CPacket", net.minecraft.network.packet.s2c.play.LookAtS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ScreenHandlerPropertyUpdateS2CPacket.class, "ScreenHandlerPropertyUpdateS2CPacket"); S2C_PACKETS_R.put("ScreenHandlerPropertyUpdateS2CPacket", net.minecraft.network.packet.s2c.play.ScreenHandlerPropertyUpdateS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.OpenHorseScreenS2CPacket.class, "OpenHorseScreenS2CPacket"); - S2C_PACKETS_R.put("OpenHorseScreenS2CPacket", net.minecraft.network.packet.s2c.play.OpenHorseScreenS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.TitleS2CPacket.class, "TitleS2CPacket"); S2C_PACKETS_R.put("TitleS2CPacket", net.minecraft.network.packet.s2c.play.TitleS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.OpenHorseScreenS2CPacket.class, "OpenHorseScreenS2CPacket"); + S2C_PACKETS_R.put("OpenHorseScreenS2CPacket", net.minecraft.network.packet.s2c.play.OpenHorseScreenS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.SimulationDistanceS2CPacket.class, "SimulationDistanceS2CPacket"); S2C_PACKETS_R.put("SimulationDistanceS2CPacket", net.minecraft.network.packet.s2c.play.SimulationDistanceS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ChatSuggestionsS2CPacket.class, "ChatSuggestionsS2CPacket"); @@ -273,8 +281,6 @@ public class PacketUtils { S2C_PACKETS_R.put("BlockEntityUpdateS2CPacket", net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket.class, "ScreenHandlerSlotUpdateS2CPacket"); S2C_PACKETS_R.put("ScreenHandlerSlotUpdateS2CPacket", net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.SynchronizeTagsS2CPacket.class, "SynchronizeTagsS2CPacket"); - S2C_PACKETS_R.put("SynchronizeTagsS2CPacket", net.minecraft.network.packet.s2c.play.SynchronizeTagsS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.PlayerSpawnPositionS2CPacket.class, "PlayerSpawnPositionS2CPacket"); S2C_PACKETS_R.put("PlayerSpawnPositionS2CPacket", net.minecraft.network.packet.s2c.play.PlayerSpawnPositionS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityStatusEffectS2CPacket.class, "EntityStatusEffectS2CPacket"); @@ -285,34 +291,36 @@ public class PacketUtils { S2C_PACKETS_R.put("CommandTreeS2CPacket", net.minecraft.network.packet.s2c.play.CommandTreeS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.login.LoginCompressionS2CPacket.class, "LoginCompressionS2CPacket"); S2C_PACKETS_R.put("LoginCompressionS2CPacket", net.minecraft.network.packet.s2c.login.LoginCompressionS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.common.CommonPingS2CPacket.class, "CommonPingS2CPacket"); + S2C_PACKETS_R.put("CommonPingS2CPacket", net.minecraft.network.packet.s2c.common.CommonPingS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.TitleFadeS2CPacket.class, "TitleFadeS2CPacket"); S2C_PACKETS_R.put("TitleFadeS2CPacket", net.minecraft.network.packet.s2c.play.TitleFadeS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.PlayerSpawnS2CPacket.class, "PlayerSpawnS2CPacket"); - S2C_PACKETS_R.put("PlayerSpawnS2CPacket", net.minecraft.network.packet.s2c.play.PlayerSpawnS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.query.PingResultS2CPacket.class, "PingResultS2CPacket"); + S2C_PACKETS_R.put("PingResultS2CPacket", net.minecraft.network.packet.s2c.query.PingResultS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.PlayerActionResponseS2CPacket.class, "PlayerActionResponseS2CPacket"); S2C_PACKETS_R.put("PlayerActionResponseS2CPacket", net.minecraft.network.packet.s2c.play.PlayerActionResponseS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.InventoryS2CPacket.class, "InventoryS2CPacket"); S2C_PACKETS_R.put("InventoryS2CPacket", net.minecraft.network.packet.s2c.play.InventoryS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ResourcePackSendS2CPacket.class, "ResourcePackSendS2CPacket"); - S2C_PACKETS_R.put("ResourcePackSendS2CPacket", net.minecraft.network.packet.s2c.play.ResourcePackSendS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ChunkBiomeDataS2CPacket.class, "ChunkBiomeDataS2CPacket"); S2C_PACKETS_R.put("ChunkBiomeDataS2CPacket", net.minecraft.network.packet.s2c.play.ChunkBiomeDataS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.WorldBorderWarningTimeChangedS2CPacket.class, "WorldBorderWarningTimeChangedS2CPacket"); S2C_PACKETS_R.put("WorldBorderWarningTimeChangedS2CPacket", net.minecraft.network.packet.s2c.play.WorldBorderWarningTimeChangedS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ScoreboardPlayerUpdateS2CPacket.class, "ScoreboardPlayerUpdateS2CPacket"); S2C_PACKETS_R.put("ScoreboardPlayerUpdateS2CPacket", net.minecraft.network.packet.s2c.play.ScoreboardPlayerUpdateS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.query.QueryPongS2CPacket.class, "QueryPongS2CPacket"); - S2C_PACKETS_R.put("QueryPongS2CPacket", net.minecraft.network.packet.s2c.query.QueryPongS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityDamageS2CPacket.class, "EntityDamageS2CPacket"); S2C_PACKETS_R.put("EntityDamageS2CPacket", net.minecraft.network.packet.s2c.play.EntityDamageS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ChatMessageS2CPacket.class, "ChatMessageS2CPacket"); S2C_PACKETS_R.put("ChatMessageS2CPacket", net.minecraft.network.packet.s2c.play.ChatMessageS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.common.KeepAliveS2CPacket.class, "KeepAliveS2CPacket"); + S2C_PACKETS_R.put("KeepAliveS2CPacket", net.minecraft.network.packet.s2c.common.KeepAliveS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket.class, "OpenWrittenBookS2CPacket"); S2C_PACKETS_R.put("OpenWrittenBookS2CPacket", net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.PlaySoundFromEntityS2CPacket.class, "PlaySoundFromEntityS2CPacket"); - S2C_PACKETS_R.put("PlaySoundFromEntityS2CPacket", net.minecraft.network.packet.s2c.play.PlaySoundFromEntityS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.WorldTimeUpdateS2CPacket.class, "WorldTimeUpdateS2CPacket"); S2C_PACKETS_R.put("WorldTimeUpdateS2CPacket", net.minecraft.network.packet.s2c.play.WorldTimeUpdateS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.PlaySoundFromEntityS2CPacket.class, "PlaySoundFromEntityS2CPacket"); + S2C_PACKETS_R.put("PlaySoundFromEntityS2CPacket", net.minecraft.network.packet.s2c.play.PlaySoundFromEntityS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.config.FeaturesS2CPacket.class, "FeaturesS2CPacket"); + S2C_PACKETS_R.put("FeaturesS2CPacket", net.minecraft.network.packet.s2c.config.FeaturesS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.SignEditorOpenS2CPacket.class, "SignEditorOpenS2CPacket"); S2C_PACKETS_R.put("SignEditorOpenS2CPacket", net.minecraft.network.packet.s2c.play.SignEditorOpenS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ExplosionS2CPacket.class, "ExplosionS2CPacket"); @@ -325,8 +333,6 @@ public class PacketUtils { S2C_PACKETS_R.put("EndCombatS2CPacket", net.minecraft.network.packet.s2c.play.EndCombatS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.PlayerListS2CPacket.class, "PlayerListS2CPacket"); S2C_PACKETS_R.put("PlayerListS2CPacket", net.minecraft.network.packet.s2c.play.PlayerListS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.DisconnectS2CPacket.class, "DisconnectS2CPacket"); - S2C_PACKETS_R.put("DisconnectS2CPacket", net.minecraft.network.packet.s2c.play.DisconnectS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ChunkRenderDistanceCenterS2CPacket.class, "ChunkRenderDistanceCenterS2CPacket"); S2C_PACKETS_R.put("ChunkRenderDistanceCenterS2CPacket", net.minecraft.network.packet.s2c.play.ChunkRenderDistanceCenterS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ExperienceBarUpdateS2CPacket.class, "ExperienceBarUpdateS2CPacket"); @@ -345,6 +351,8 @@ public class PacketUtils { S2C_PACKETS_R.put("LoginSuccessS2CPacket", net.minecraft.network.packet.s2c.login.LoginSuccessS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.BlockBreakingProgressS2CPacket.class, "BlockBreakingProgressS2CPacket"); S2C_PACKETS_R.put("BlockBreakingProgressS2CPacket", net.minecraft.network.packet.s2c.play.BlockBreakingProgressS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.common.DisconnectS2CPacket.class, "DisconnectS2CPacket"); + S2C_PACKETS_R.put("DisconnectS2CPacket", net.minecraft.network.packet.s2c.common.DisconnectS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.GameMessageS2CPacket.class, "GameMessageS2CPacket"); S2C_PACKETS_R.put("GameMessageS2CPacket", net.minecraft.network.packet.s2c.play.GameMessageS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityPassengersSetS2CPacket.class, "EntityPassengersSetS2CPacket"); @@ -361,6 +369,10 @@ public class PacketUtils { S2C_PACKETS_R.put("EntityStatusS2CPacket", net.minecraft.network.packet.s2c.play.EntityStatusS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityTrackerUpdateS2CPacket.class, "EntityTrackerUpdateS2CPacket"); S2C_PACKETS_R.put("EntityTrackerUpdateS2CPacket", net.minecraft.network.packet.s2c.play.EntityTrackerUpdateS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.config.DynamicRegistriesS2CPacket.class, "DynamicRegistriesS2CPacket"); + S2C_PACKETS_R.put("DynamicRegistriesS2CPacket", net.minecraft.network.packet.s2c.config.DynamicRegistriesS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket.class, "CustomPayloadS2CPacket"); + S2C_PACKETS_R.put("CustomPayloadS2CPacket", net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.SubtitleS2CPacket.class, "SubtitleS2CPacket"); S2C_PACKETS_R.put("SubtitleS2CPacket", net.minecraft.network.packet.s2c.play.SubtitleS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.NbtQueryResponseS2CPacket.class, "NbtQueryResponseS2CPacket"); @@ -369,10 +381,14 @@ public class PacketUtils { S2C_PACKETS_R.put("UnloadChunkS2CPacket", net.minecraft.network.packet.s2c.play.UnloadChunkS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityEquipmentUpdateS2CPacket.class, "EntityEquipmentUpdateS2CPacket"); S2C_PACKETS_R.put("EntityEquipmentUpdateS2CPacket", net.minecraft.network.packet.s2c.play.EntityEquipmentUpdateS2CPacket.class); - S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.BossBarS2CPacket.class, "BossBarS2CPacket"); - S2C_PACKETS_R.put("BossBarS2CPacket", net.minecraft.network.packet.s2c.play.BossBarS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.config.ReadyS2CPacket.class, "ReadyS2CPacket"); + S2C_PACKETS_R.put("ReadyS2CPacket", net.minecraft.network.packet.s2c.config.ReadyS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EnterReconfigurationS2CPacket.class, "EnterReconfigurationS2CPacket"); + S2C_PACKETS_R.put("EnterReconfigurationS2CPacket", net.minecraft.network.packet.s2c.play.EnterReconfigurationS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityAttachS2CPacket.class, "EntityAttachS2CPacket"); S2C_PACKETS_R.put("EntityAttachS2CPacket", net.minecraft.network.packet.s2c.play.EntityAttachS2CPacket.class); + S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.BossBarS2CPacket.class, "BossBarS2CPacket"); + S2C_PACKETS_R.put("BossBarS2CPacket", net.minecraft.network.packet.s2c.play.BossBarS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.EntityPositionS2CPacket.class, "EntityPositionS2CPacket"); S2C_PACKETS_R.put("EntityPositionS2CPacket", net.minecraft.network.packet.s2c.play.EntityPositionS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket.class, "ChunkDataS2CPacket"); diff --git a/src/main/java/meteordevelopment/meteorclient/utils/render/MeteorToast.java b/src/main/java/meteordevelopment/meteorclient/utils/render/MeteorToast.java index 1aec6d3760..731f31401d 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/render/MeteorToast.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/render/MeteorToast.java @@ -19,6 +19,7 @@ import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.text.TextColor; +import net.minecraft.util.Identifier; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -27,6 +28,7 @@ public class MeteorToast implements Toast { public static final int TITLE_COLOR = Color.fromRGBA(145, 61, 226, 255); public static final int TEXT_COLOR = Color.fromRGBA(220, 220, 220, 255); + private static final Identifier TEXTURE = new Identifier("textures/gui/sprites/toast/advancement.png"); private ItemStack icon; private Text title, text; diff --git a/src/main/java/meteordevelopment/meteorclient/utils/render/PlayerHeadUtils.java b/src/main/java/meteordevelopment/meteorclient/utils/render/PlayerHeadUtils.java index 3da0df73ab..132cf8f5ff 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/render/PlayerHeadUtils.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/render/PlayerHeadUtils.java @@ -1,7 +1,6 @@ package meteordevelopment.meteorclient.utils.render; import com.google.gson.Gson; -import com.mojang.util.UUIDTypeAdapter; import meteordevelopment.meteorclient.systems.accounts.TexturesJson; import meteordevelopment.meteorclient.systems.accounts.UuidToProfileResponse; import meteordevelopment.meteorclient.utils.PostInit; @@ -26,7 +25,7 @@ public static PlayerHeadTexture fetchHead(UUID id) { } public static String getSkinUrl(UUID id) { - UuidToProfileResponse res2 = Http.get("https://sessionserver.mojang.com/session/minecraft/profile/" + UUIDTypeAdapter.fromUUID(id)).sendJson(UuidToProfileResponse.class); + UuidToProfileResponse res2 = Http.get("https://sessionserver.mojang.com/session/minecraft/profile/" + id).sendJson(UuidToProfileResponse.class); if (res2 == null) return null; String base64Textures = res2.getPropertyValue("textures"); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 9152c8dad7..c3523f4237 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -48,8 +48,8 @@ }, "depends": { "java": ">=17", - "minecraft": [ "1.20", "1.20.1" ], - "fabricloader": ">=0.14.21" + "minecraft": "1.20.2", + "fabricloader": ">=0.14.22" }, "breaks": { "optifabric": "*", diff --git a/src/main/resources/meteor-client.accesswidener b/src/main/resources/meteor-client.accesswidener index 5632e6397b..30a856f583 100644 --- a/src/main/resources/meteor-client.accesswidener +++ b/src/main/resources/meteor-client.accesswidener @@ -1,5 +1,6 @@ accessWidener v1 named +accessible class net/minecraft/client/texture/PlayerSkinProvider$FileCache accessible class net/minecraft/client/render/RenderLayer$OutlineMode accessible class net/minecraft/client/particle/FireworksSparkParticle$Explosion accessible class net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractType diff --git a/src/main/resources/meteor-client.mixins.json b/src/main/resources/meteor-client.mixins.json index b0ad1f5301..6ea10c20d4 100644 --- a/src/main/resources/meteor-client.mixins.json +++ b/src/main/resources/meteor-client.mixins.json @@ -37,8 +37,10 @@ "BufferRendererAccessor", "CameraMixin", "CapabilityTrackerMixin", + "CapeFeatureRendererMixin", "ChatHudAccessor", "ChatHudLineMixin", + "ChatHudLineVisibleMixin", "ChatHudMixin", "ChatInputSuggestorMixin", "ChatScreenMixin", @@ -64,11 +66,11 @@ "CreativeInventoryScreenAccessor", "CreativeSlotMixin", "CrossbowItemAccessor", - "CustomPayloadC2SPacketAccessor", "CustomPayloadS2CPacketMixin", "DefaultSkinHelperMixin", "DisconnectedScreenMixin", "DrawContextMixin", + "ElytraFeatureRendererMixin", "EnchantingTableBlockEntityRendererMixin", "EndCrystalEntityRendererMixin", "EntityAccessor", @@ -80,6 +82,7 @@ "EntityVelocityUpdateS2CPacketAccessor", "ExplosionMixin", "ExplosionS2CPacketMixin", + "FileCacheAccessor", "FireworkRocketEntityMixin", "FireworksSparkParticleMixin", "FireworksSparkParticleSubMixin", @@ -111,6 +114,7 @@ "LivingEntityRendererMixin", "MapRendererAccessor", "MapRendererMixin", + "MessageHandlerMixin", "MinecraftClientAccessor", "MinecraftClientMixin", "MinecraftServerAccessor", @@ -166,9 +170,7 @@ "WorldChunkMixin", "WorldRendererAccessor", "WorldRendererMixin", - "YggdrasilMinecraftSessionServiceAccessor", - "MessageHandlerMixin", - "ChatHudLineVisibleMixin" + "YggdrasilMinecraftSessionServiceAccessor" ], "injectors": { "defaultRequire": 1