From 6fb8fbe14c8ca4a56da7787aac6aa98598bb9abc Mon Sep 17 00:00:00 2001 From: Lovecrafts-Cat Date: Mon, 4 Sep 2023 19:45:34 +0200 Subject: [PATCH 01/13] WIP 1.20.2 - mixins/accessors - packets - auth Plus other changes (this commit does NOT build successfully) --- build.gradle | 2 +- gradle.properties | 16 +++---- .../commands/commands/ServerCommand.java | 2 +- .../meteorclient/gui/WidgetScreen.java | 14 +++--- .../AbstractClientPlayerEntityMixin.java | 9 ---- .../mixin/BookEditScreenMixin.java | 2 +- .../mixin/ClientConnectionMixin.java | 6 +-- .../mixin/ClientPlayNetworkHandlerMixin.java | 15 ++++--- .../mixin/CustomPayloadC2SPacketAccessor.java | 2 +- .../mixin/CustomPayloadS2CPacketMixin.java | 2 +- .../mixin/DefaultSkinHelperMixin.java | 2 +- .../mixin/MinecraftClientAccessor.java | 6 +-- .../mixin/MinecraftClientMixin.java | 2 +- .../mixin/PlayerEntityRendererMixin.java | 2 +- .../mixin/PlayerListEntryMixin.java | 2 +- .../meteorclient/mixin/ScreenMixin.java | 2 +- .../meteorclient/mixin/SkinTexturesMixin.java | 24 ++++++++++ .../systems/accounts/Account.java | 10 ++--- .../systems/accounts/AccountCache.java | 13 +++--- .../systems/accounts/MicrosoftLogin.java | 8 ++-- .../accounts/types/CrackedAccount.java | 4 +- .../systems/accounts/types/EasyMCAccount.java | 9 ++-- .../accounts/types/MicrosoftAccount.java | 2 +- .../accounts/types/TheAlteningAccount.java | 8 ++-- .../meteorclient/systems/friends/Friend.java | 5 +-- .../meteorclient/systems/friends/Friends.java | 12 ++--- .../systems/hud/elements/CombatHud.java | 3 +- .../systems/modules/misc/AutoLog.java | 2 +- .../systems/modules/misc/BetterChat.java | 2 +- .../systems/modules/misc/ServerSpoof.java | 9 ++-- .../modules/render/BetterTooltips.java | 2 +- .../systems/modules/world/InfinityMiner.java | 2 +- .../meteorclient/utils/Utils.java | 7 ++- .../utils/misc/FakeClientPlayer.java | 13 +++--- .../utils/network/PacketUtils.java | 45 ++++++++++--------- .../utils/render/MeteorToast.java | 2 + .../utils/render/PlayerHeadUtils.java | 3 +- src/main/resources/fabric.mod.json | 4 +- src/main/resources/meteor-client.mixins.json | 7 +-- 39 files changed, 153 insertions(+), 129 deletions(-) create mode 100644 src/main/java/meteordevelopment/meteorclient/mixin/SkinTexturesMixin.java diff --git a/build.gradle b/build.gradle index 69d62e702e..32cb62f90c 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ dependencies { //modCompileOnly("io.vram:canvas-fabric-mc119:1.0.+") { transitive = false } // TODO: 1.19.3 // Baritone (https://github.com/MeteorDevelopment/baritone) - modInclude "baritone:fabric:${project.minecraft_version}-SNAPSHOT" + modInclude "baritone:fabric:1.20.1-SNAPSHOT" // Libraries library "meteordevelopment:orbit:${project.orbit_version}" diff --git a/gradle.properties b/gradle.properties index 67c205ad26..4b29b92755 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=23w35a +yarn_mappings=23w35a+build.13 +loader_version=0.14.22 +fapi_version=0.88.0+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.1-0.5.2 # Lithium (https://github.com/CaffeineMC/lithium-fabric) -lithium_version=mc1.20-0.11.2 +lithium_version=mc1.20.1-0.11.2 # Iris (https://github.com/IrisShaders/Iris) -iris_version=1.6.5+1.20.1 +iris_version=1.6.8+1.20.1 # Orbit (https://github.com/MeteorDevelopment/orbit) orbit_version=0.2.3 @@ -37,5 +37,5 @@ reflections_version=0.10.2 # Netty (https://github.com/netty/netty) netty_version=4.1.90.Final -# Mixin Extras (https://github.com/LlamaLad7/MixinExtras) +# Mixin Extras (https://github.com/LlamaLad7/MixinExtras) #TODO update mixin_extras_version=0.2.0-beta.8 diff --git a/src/main/java/meteordevelopment/meteorclient/commands/commands/ServerCommand.java b/src/main/java/meteordevelopment/meteorclient/commands/commands/ServerCommand.java index c825bb0469..2e2024c359 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/ClientConnectionMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java index 47592eca6a..ba544e8c4e 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; @@ -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/CustomPayloadC2SPacketAccessor.java b/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadC2SPacketAccessor.java index 6ca12566e4..d44f1991b3 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadC2SPacketAccessor.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadC2SPacketAccessor.java @@ -6,7 +6,7 @@ package meteordevelopment.meteorclient.mixin; import net.minecraft.network.PacketByteBuf; -import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket; +import net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket; import net.minecraft.util.Identifier; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mutable; diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java index 553e0fe18e..f4581b731b 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java @@ -7,7 +7,7 @@ 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; diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/DefaultSkinHelperMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/DefaultSkinHelperMixin.java index 1eec65c6d7..f63cbd74ad 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 = "getTexture(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/MinecraftClientAccessor.java b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java index 9a878dddef..4ac5d7e2ae 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java @@ -10,11 +10,11 @@ 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; diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientMixin.java index 46363df5e9..742607f90a 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientMixin.java @@ -119,7 +119,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/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..6b625f9ffb 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java @@ -23,7 +23,7 @@ public abstract class PlayerListEntryMixin { @Shadow public abstract GameProfile getProfile(); - @Inject(method = "getSkinTexture", at = @At("HEAD"), cancellable = true) + @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()) { 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/SkinTexturesMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/SkinTexturesMixin.java new file mode 100644 index 0000000000..e3b4755380 --- /dev/null +++ b/src/main/java/meteordevelopment/meteorclient/mixin/SkinTexturesMixin.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 meteordevelopment.meteorclient.utils.network.Capes; +import net.minecraft.client.util.SkinTextures; +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; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(SkinTextures.class) +public class SkinTexturesMixin { + @Inject(method = "capeTexture", at = @At("HEAD"), cancellable = true) + private void onGetCapeTexture(CallbackInfoReturnable info) { + Identifier id = Capes.get((PlayerEntity) (Object) this); + if (id != null) info.setReturnValue(id); + } +} diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java index 96132e9d55..dcf1677bcb 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java @@ -15,11 +15,11 @@ 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; @@ -80,7 +80,7 @@ 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)); + mca.setSkinProvider(new PlayerSkinProvider(mc.getTextureManager(), ((PlayerSkinProviderAccessor) mc.getSkinProvider()).getSkinCacheDir().toPath(), 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..a4d7620a2f 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java @@ -5,16 +5,17 @@ package meteordevelopment.meteorclient.systems.accounts; -import com.mojang.util.UUIDTypeAdapter; import meteordevelopment.meteorclient.utils.misc.ISerializable; import meteordevelopment.meteorclient.utils.misc.NbtException; import meteordevelopment.meteorclient.utils.render.PlayerHeadTexture; import meteordevelopment.meteorclient.utils.render.PlayerHeadUtils; import net.minecraft.nbt.NbtCompound; +import java.util.UUID; + public class AccountCache implements ISerializable { public String username = ""; - public String uuid = ""; + public UUID uuid = UUID.fromString(""); private PlayerHeadTexture headTexture; public PlayerHeadTexture getHeadTexture() { @@ -22,8 +23,8 @@ public PlayerHeadTexture getHeadTexture() { } public void loadHead() { - if (uuid == null || uuid.isBlank()) return; - headTexture = PlayerHeadUtils.fetchHead(UUIDTypeAdapter.fromString(uuid)); + if (uuid == null || uuid.toString().isBlank()) return; + headTexture = PlayerHeadUtils.fetchHead(uuid); } @Override @@ -31,7 +32,7 @@ public NbtCompound toTag() { NbtCompound tag = new NbtCompound(); tag.putString("username", username); - tag.putString("uuid", uuid); + tag.putString("uuid", uuid.toString()); return tag; } @@ -41,7 +42,7 @@ public AccountCache fromTag(NbtCompound tag) { if (!tag.contains("username") || !tag.contains("uuid")) throw new NbtException(); username = tag.getString("username"); - uuid = tag.getString("uuid"); + uuid = tag.getUuid("uuid"); loadHead(); return this; diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java index cc0bdf877c..616d6f9749 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java @@ -19,17 +19,19 @@ import java.net.InetSocketAddress; import java.nio.charset.StandardCharsets; import java.util.List; +import java.util.UUID; import java.util.function.Consumer; public class MicrosoftLogin { public static class LoginData { public String mcToken; public String newRefreshToken; - public String uuid, username; + public UUID uuid; + public String username; public LoginData() {} - public LoginData(String mcToken, String newRefreshToken, String uuid, String username) { + public LoginData(String mcToken, String newRefreshToken, UUID uuid, String username) { this.mcToken = mcToken; this.newRefreshToken = newRefreshToken; this.uuid = uuid; @@ -217,7 +219,7 @@ private boolean hasGameOwnership() { } private static class ProfileResponse { - public String id; + public UUID id; public String name; } } 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..a104a46633 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/EasyMCAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/EasyMCAccount.java @@ -12,16 +12,17 @@ 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; +import java.util.UUID; import static meteordevelopment.meteorclient.MeteorClient.mc; 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); @@ -59,7 +60,7 @@ public boolean login() { private static class AuthResponse { public String mcName; - public String uuid; + public UUID uuid; public String session; public String message; } 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..2282b16834 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/MicrosoftAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/MicrosoftAccount.java @@ -8,7 +8,7 @@ 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; 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..5ba1a11c2c 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,23 @@ 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 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); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java index 5b6187301f..9f45a8099f 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java @@ -5,7 +5,6 @@ package meteordevelopment.meteorclient.systems.friends; -import com.mojang.util.UUIDTypeAdapter; import meteordevelopment.meteorclient.utils.misc.ISerializable; import meteordevelopment.meteorclient.utils.network.Http; import meteordevelopment.meteorclient.utils.render.PlayerHeadTexture; @@ -50,7 +49,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 = UUID.fromString(res.id); headTexture = PlayerHeadUtils.fetchHead(id); updating = false; } @@ -64,7 +63,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.putUuid("id", 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..551b5c9440 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java @@ -5,7 +5,6 @@ package meteordevelopment.meteorclient.systems.friends; -import com.mojang.util.UUIDTypeAdapter; import meteordevelopment.meteorclient.systems.System; import meteordevelopment.meteorclient.systems.Systems; import meteordevelopment.meteorclient.utils.misc.NbtUtils; @@ -16,10 +15,7 @@ import net.minecraft.nbt.NbtElement; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; +import java.util.*; public class Friends extends System implements Iterable { private final List friends = new ArrayList<>(); @@ -117,9 +113,9 @@ public Friends fromTag(NbtCompound tag) { String name = friendTag.getString("name"); if (get(name) != null) continue; - String uuid = friendTag.getString("id"); - Friend friend = !uuid.isBlank() - ? new Friend(name, UUIDTypeAdapter.fromString(uuid)) + UUID uuid = friendTag.getUuid("id"); + Friend friend = !uuid.toString().isBlank() + ? new Friend(name, uuid) : new Friend(name); friends.add(friend); 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..ba51c410df 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/CombatHud.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/hud/elements/CombatHud.java @@ -213,7 +213,8 @@ public void render(HudRenderer renderer) { (int) (y + (66 * scale.get())), (int) (30 * scale.get()), -MathHelper.wrapDegrees(playerEntity.prevYaw + (playerEntity.getYaw() - playerEntity.prevYaw) * mc.getTickDelta()), - -playerEntity.getPitch(), playerEntity + -playerEntity.getPitch(), + playerEntity ); // Moving pos to past player model 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..d1616a0e79 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/ServerSpoof.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/ServerSpoof.java @@ -14,8 +14,9 @@ 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; @@ -80,7 +81,7 @@ private void onPacketSend(PacketEvent.Send event) { CustomPayloadC2SPacketAccessor packet = (CustomPayloadC2SPacketAccessor) event.packet; Identifier id = packet.getChannel(); - if (spoofBrand.get() && id.equals(CustomPayloadC2SPacket.BRAND)) + if (spoofBrand.get() && id.equals(BrandCustomPayload.ID)) packet.setData(new PacketByteBuf(Unpooled.buffer()).writeString(brand.get())); if (blockChannels.get()) { @@ -106,7 +107,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/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/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 df8bfa0b4e..037f2f6fee 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/misc/FakeClientPlayer.java b/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java index 9ecddf42e3..0ce3f836f3 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java @@ -5,6 +5,7 @@ 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; @@ -18,6 +19,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 +28,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 @@ -38,14 +41,14 @@ 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, null, new ClientConnection(NetworkSide.CLIENTBOUND), mc.getCurrentServerEntry(), new GameProfile(id, mc.getSession().getUsername()), null), 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 +59,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..4a3e52eff1 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java @@ -19,6 +19,7 @@ import net.minecraft.util.Identifier; import net.minecraft.util.math.random.Random; import org.jetbrains.annotations.NotNull; + import java.util.*; import java.util.stream.Stream; @@ -58,8 +59,8 @@ public class PacketUtils { 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.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.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"); @@ -108,8 +109,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.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.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,10 +119,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.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.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.MessageAcknowledgmentC2SPacket.class, "MessageAcknowledgmentC2SPacket"); C2S_PACKETS_R.put("MessageAcknowledgmentC2SPacket", net.minecraft.network.packet.c2s.play.MessageAcknowledgmentC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket.class, "VehicleMoveC2SPacket"); @@ -153,10 +154,10 @@ 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.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.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.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"); @@ -191,8 +192,8 @@ public class PacketUtils { S2C_PACKETS_R.put("ScoreboardObjectiveUpdateS2CPacket", net.minecraft.network.packet.s2c.play.ScoreboardObjectiveUpdateS2CPacket.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.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.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"); @@ -205,8 +206,8 @@ public class PacketUtils { 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.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.WorldEventS2CPacket.class, "WorldEventS2CPacket"); S2C_PACKETS_R.put("WorldEventS2CPacket", net.minecraft.network.packet.s2c.play.WorldEventS2CPacket.class); S2C_PACKETS.put(net.minecraft.network.packet.s2c.play.ServerMetadataS2CPacket.class, "ServerMetadataS2CPacket"); @@ -273,8 +274,8 @@ 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.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.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"); @@ -293,8 +294,8 @@ public class PacketUtils { 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.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.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"); @@ -325,8 +326,8 @@ 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.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.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"); 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 95d3c99762..ac95736c88 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -47,8 +47,8 @@ }, "depends": { "java": ">=17", - "minecraft": [ "1.20", "1.20.1" ], - "fabricloader": ">=0.14.21" + "minecraft": "23w35a", + "fabricloader": ">=0.14.22" }, "breaks": { "optifabric": "*", diff --git a/src/main/resources/meteor-client.mixins.json b/src/main/resources/meteor-client.mixins.json index b0ad1f5301..8987555997 100644 --- a/src/main/resources/meteor-client.mixins.json +++ b/src/main/resources/meteor-client.mixins.json @@ -39,6 +39,7 @@ "CapabilityTrackerMixin", "ChatHudAccessor", "ChatHudLineMixin", + "ChatHudLineVisibleMixin", "ChatHudMixin", "ChatInputSuggestorMixin", "ChatScreenMixin", @@ -111,6 +112,7 @@ "LivingEntityRendererMixin", "MapRendererAccessor", "MapRendererMixin", + "MessageHandlerMixin", "MinecraftClientAccessor", "MinecraftClientMixin", "MinecraftServerAccessor", @@ -145,6 +147,7 @@ "SimpleEntityLookupAccessor", "SimpleOptionMixin", "SimpleRegistryMixin", + "SkinTexturesMixin", "SlimeBlockMixin", "SlotMixin", "SoundSystemMixin", @@ -166,9 +169,7 @@ "WorldChunkMixin", "WorldRendererAccessor", "WorldRendererMixin", - "YggdrasilMinecraftSessionServiceAccessor", - "MessageHandlerMixin", - "ChatHudLineVisibleMixin" + "YggdrasilMinecraftSessionServiceAccessor" ], "injectors": { "defaultRequire": 1 From a14dbd2bd99442e1d847d3ff2f168c05bc0286cb Mon Sep 17 00:00:00 2001 From: Lovecrafts-Cat Date: Tue, 5 Sep 2023 21:10:32 +0200 Subject: [PATCH 02/13] WIP 1.20.2 (using 1.20.2-pre1) Unresolved classes: - Account, CombatHud, FakeClientPlayer, PlayerModelHud, TheAlteningAccount (extremely broken) Many Mixins to correct. Builds but does not start because of these. --- build.gradle | 2 +- gradle.properties | 6 +- .../mixin/CustomPayloadC2SPacketAccessor.java | 26 ----- .../meteorclient/mixin/FileCacheAccessor.java | 18 +++ .../mixin/PlayerSkinProviderAccessor.java | 6 +- .../systems/accounts/Account.java | 9 +- .../accounts/types/TheAlteningAccount.java | 19 ++-- .../meteorclient/systems/hud/Hud.java | 2 +- .../systems/hud/elements/CombatHud.java | 9 +- .../systems/hud/elements/PlayerModelHud.java | 2 +- .../systems/hud/screens/HudEditorScreen.java | 2 +- .../systems/modules/misc/ServerSpoof.java | 6 +- .../utils/misc/FakeClientPlayer.java | 14 ++- .../utils/network/PacketUtils.java | 103 ++++++++++-------- src/main/resources/fabric.mod.json | 2 +- .../resources/meteor-client.accesswidener | 1 + src/main/resources/meteor-client.mixins.json | 2 +- 17 files changed, 125 insertions(+), 104 deletions(-) delete mode 100644 src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadC2SPacketAccessor.java create mode 100644 src/main/java/meteordevelopment/meteorclient/mixin/FileCacheAccessor.java diff --git a/build.gradle b/build.gradle index 32cb62f90c..7f4da50379 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ dependencies { //modCompileOnly("io.vram:canvas-fabric-mc119:1.0.+") { transitive = false } // TODO: 1.19.3 // Baritone (https://github.com/MeteorDevelopment/baritone) - modInclude "baritone:fabric:1.20.1-SNAPSHOT" + modInclude "baritone:fabric:1.20.1-SNAPSHOT" // TODO: reset to automated versioning once updated // Libraries library "meteordevelopment:orbit:${project.orbit_version}" diff --git a/gradle.properties b/gradle.properties index 4b29b92755..bcaf8bd80d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ org.gradle.jvmargs=-Xmx2G # Fabric (https://fabricmc.net/develop) -minecraft_version=23w35a -yarn_mappings=23w35a+build.13 +minecraft_version=1.20.2-pre1 +yarn_mappings=1.20.2-pre1+build.3 loader_version=0.14.22 -fapi_version=0.88.0+1.20.2 +fapi_version=0.88.2+1.20.2 # Mod Properties mod_version=0.5.4 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 d44f1991b3..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.common.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/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/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/systems/accounts/Account.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java index dcf1677bcb..046d7ceffa 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java @@ -10,6 +10,7 @@ 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; @@ -23,6 +24,8 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.network.encryption.SignatureVerifier; +import java.nio.file.Path; + import static meteordevelopment.meteorclient.MeteorClient.mc; public abstract class Account> implements ISerializable { @@ -62,7 +65,7 @@ public AccountCache getCache() { public static void setSession(Session session) { MinecraftClientAccessor mca = (MinecraftClientAccessor) mc; mca.setSession(session); - mc.getSessionProperties().clear(); +// mc.getSessionProperties().clear(); UserApiService apiService; try { apiService = mca.getAuthenticationService().createUserApiService(session.getAccessToken()); @@ -80,7 +83,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().toPath(), sessService, mc)); + 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/types/TheAlteningAccount.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java index 5ba1a11c2c..7581c90466 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java @@ -6,16 +6,11 @@ package meteordevelopment.meteorclient.systems.accounts.types; import com.mojang.authlib.Environment; -import com.mojang.authlib.exceptions.AuthenticationException; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; -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.session.Session; - -import java.util.Optional; import static meteordevelopment.meteorclient.MeteorClient.mc; @@ -29,7 +24,7 @@ public TheAlteningAccount(String token) { @Override public boolean fetchInfo() { - YggdrasilUserAuthentication auth = getAuth(); + /*YggdrasilUserAuthentication auth = getAuth(); try { auth.logIn(); @@ -40,14 +35,15 @@ public boolean fetchInfo() { return true; } catch (AuthenticationException e) { return false; - } + }*/ + return true; } @Override public boolean login() { applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE, ENVIRONMENT)); - YggdrasilUserAuthentication auth = getAuth(); + /*YggdrasilUserAuthentication auth = getAuth(); try { auth.logIn(); @@ -60,15 +56,16 @@ public boolean login() { } catch (AuthenticationException e) { MeteorClient.LOG.error("Failed to login with TheAltening."); return false; - } + }*/ + return true; } - private YggdrasilUserAuthentication getAuth() { + /*private YggdrasilUserAuthentication getAuth() { YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) SERVICE.createUserAuthentication(Agent.MINECRAFT); auth.setUsername(name); auth.setPassword("Meteor on Crack!"); return auth; - } + }*/ } 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 ba51c410df..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,9 +209,12 @@ 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 @@ -255,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--) { @@ -268,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/ServerSpoof.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/ServerSpoof.java index d1616a0e79..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,7 +8,6 @@ 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; @@ -78,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(BrandCustomPayload.ID)) - packet.setData(new PacketByteBuf(Unpooled.buffer()).writeString(brand.get())); + event.packet.write(new PacketByteBuf(Unpooled.buffer()).writeString(brand.get())); if (blockChannels.get()) { for (String channel : channels.get()) { diff --git a/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java b/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java index 0ce3f836f3..a16d434897 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java @@ -10,6 +10,7 @@ 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; @@ -45,7 +46,18 @@ public static PlayerEntity getPlayer() { if (player == null || (!id.equals(lastId))) { if (world == null) { - world = new ClientWorld(new ClientPlayNetworkHandler(mc, null, new ClientConnection(NetworkSide.CLIENTBOUND), mc.getCurrentServerEntry(), new GameProfile(id, mc.getSession().getUsername()), 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(null, null, null, null, null, null, null)), + new ClientWorld.Properties(Difficulty.NORMAL, false, false), + world.getRegistryKey(), + world.getDimensionEntry(), + 1, + 1, + mc::getProfiler, + null, + false, + 0 + ); } player = new OtherClientPlayerEntity(world, new GameProfile(id, mc.getSession().getUsername())); diff --git a/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java b/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java index 4a3e52eff1..3ca0192af9 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java @@ -19,7 +19,6 @@ import net.minecraft.util.Identifier; import net.minecraft.util.math.random.Random; import org.jetbrains.annotations.NotNull; - import java.util.*; import java.util.stream.Stream; @@ -37,10 +36,12 @@ 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.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.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.SelectMerchantTradeC2SPacket.class, "SelectMerchantTradeC2SPacket"); C2S_PACKETS_R.put("SelectMerchantTradeC2SPacket", net.minecraft.network.packet.c2s.play.SelectMerchantTradeC2SPacket.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.CommandExecutionC2SPacket.class, "CommandExecutionC2SPacket"); C2S_PACKETS_R.put("CommandExecutionC2SPacket", net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.RenameItemC2SPacket.class, "RenameItemC2SPacket"); @@ -57,10 +58,10 @@ public class PacketUtils { 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.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.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.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.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"); @@ -71,6 +72,8 @@ public class PacketUtils { 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"); @@ -85,20 +88,26 @@ 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.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"); @@ -109,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.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.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"); @@ -119,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.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.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.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"); @@ -154,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.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.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.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"); @@ -174,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"); @@ -186,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.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.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"); @@ -202,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.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.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"); @@ -218,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"); @@ -246,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"); @@ -274,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.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.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"); @@ -286,34 +291,38 @@ 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.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.PlayerSpawnS2CPacket.class, "PlayerSpawnS2CPacket"); S2C_PACKETS_R.put("PlayerSpawnS2CPacket", net.minecraft.network.packet.s2c.play.PlayerSpawnS2CPacket.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.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.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"); @@ -326,8 +335,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.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.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"); @@ -346,6 +353,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"); @@ -362,6 +371,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"); @@ -370,10 +383,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/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ac95736c88..892184267c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -47,7 +47,7 @@ }, "depends": { "java": ">=17", - "minecraft": "23w35a", + "minecraft": ">=1.20.2-", "fabricloader": ">=0.14.22" }, "breaks": { 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 8987555997..1294db748e 100644 --- a/src/main/resources/meteor-client.mixins.json +++ b/src/main/resources/meteor-client.mixins.json @@ -65,7 +65,6 @@ "CreativeInventoryScreenAccessor", "CreativeSlotMixin", "CrossbowItemAccessor", - "CustomPayloadC2SPacketAccessor", "CustomPayloadS2CPacketMixin", "DefaultSkinHelperMixin", "DisconnectedScreenMixin", @@ -81,6 +80,7 @@ "EntityVelocityUpdateS2CPacketAccessor", "ExplosionMixin", "ExplosionS2CPacketMixin", + "FileCacheAccessor", "FireworkRocketEntityMixin", "FireworksSparkParticleMixin", "FireworksSparkParticleSubMixin", From ec6768f3374dbe07e6a90e5d7778ae193287a47f Mon Sep 17 00:00:00 2001 From: Lovecrafts-Cat Date: Wed, 6 Sep 2023 15:21:37 +0200 Subject: [PATCH 03/13] WIP 1.20.2 (using 1.20.2-pre1) More mixins, also updated MixinExtras to new maven --- build.gradle | 4 ++-- gradle.properties | 4 ++-- .../meteorclient/mixin/CustomPayloadS2CPacketMixin.java | 4 ++-- .../meteorclient/mixin/DisconnectedScreenMixin.java | 7 ++----- .../meteorclient/mixin/PacketByteBufMixin.java | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 7f4da50379..d52dd169d7 100644 --- a/build.gradle +++ b/build.gradle @@ -68,8 +68,8 @@ 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}" // Launch sub project shadow project(":launch") diff --git a/gradle.properties b/gradle.properties index bcaf8bd80d..510c7afa89 100644 --- a/gradle.properties +++ b/gradle.properties @@ -37,5 +37,5 @@ reflections_version=0.10.2 # Netty (https://github.com/netty/netty) netty_version=4.1.90.Final -# Mixin Extras (https://github.com/LlamaLad7/MixinExtras) #TODO update -mixin_extras_version=0.2.0-beta.8 +# Mixin Extras (https://github.com/LlamaLad7/MixinExtras) +mixin_extras_version=0.2.0-rc.2 diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java index f4581b731b..01a3ff3fef 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/CustomPayloadS2CPacketMixin.java @@ -14,8 +14,8 @@ @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/DisconnectedScreenMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java index 7e93545d24..8b415e8fef 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java @@ -13,9 +13,6 @@ 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.text.Text; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; @@ -35,8 +32,8 @@ 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, GridWidget.Adder adder) { AutoReconnect autoReconnect = Modules.get().get(AutoReconnect.class); if (autoReconnect.lastServerConnection != null) { diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/PacketByteBufMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/PacketByteBufMixin.java index 78401930af..4eee483949 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/PacketByteBufMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/PacketByteBufMixin.java @@ -15,7 +15,7 @@ @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;")) + @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; } From d8a7d3fd262fb460fc0fe29e58a5116afe1e4ac3 Mon Sep 17 00:00:00 2001 From: Lovecrafts-Cat Date: Thu, 7 Sep 2023 17:52:27 +0200 Subject: [PATCH 04/13] WIP 1.20.2 (using 1.20.2-pre2) - Bumped the MC version - Re-generated PacketUtils - `ClientWorld.addEntityPrivate() -> ClientWorld.method_53875()` --- gradle.properties | 6 +++--- .../meteorclient/mixin/ClientWorldMixin.java | 4 ++-- .../systems/modules/movement/ElytraBoost.java | 2 +- .../utils/entity/fakeplayer/FakePlayerEntity.java | 2 +- .../meteorclient/utils/network/PacketUtils.java | 14 ++++++-------- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/gradle.properties b/gradle.properties index 510c7afa89..1c6d617435 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ org.gradle.jvmargs=-Xmx2G # Fabric (https://fabricmc.net/develop) -minecraft_version=1.20.2-pre1 -yarn_mappings=1.20.2-pre1+build.3 +minecraft_version=1.20.2-pre2 +yarn_mappings=1.20.2-pre2+build.1 loader_version=0.14.22 -fapi_version=0.88.2+1.20.2 +fapi_version=0.88.3+1.20.2 # Mod Properties mod_version=0.5.4 diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java index e2b441b389..f609c1212c 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 = "method_53875", 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/systems/modules/movement/ElytraBoost.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/ElytraBoost.java index a0b38e253a..dc034c525e 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.method_53875(entity); } } 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..658d8c82e7 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.method_53875(this); } public void despawn() { diff --git a/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java b/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java index 3ca0192af9..76494d2559 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/network/PacketUtils.java @@ -38,10 +38,10 @@ public class PacketUtils { 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.SelectMerchantTradeC2SPacket.class, "SelectMerchantTradeC2SPacket"); - C2S_PACKETS_R.put("SelectMerchantTradeC2SPacket", net.minecraft.network.packet.c2s.play.SelectMerchantTradeC2SPacket.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"); + C2S_PACKETS_R.put("SelectMerchantTradeC2SPacket", net.minecraft.network.packet.c2s.play.SelectMerchantTradeC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket.class, "CommandExecutionC2SPacket"); C2S_PACKETS_R.put("CommandExecutionC2SPacket", net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket.class); C2S_PACKETS.put(net.minecraft.network.packet.c2s.play.RenameItemC2SPacket.class, "RenameItemC2SPacket"); @@ -54,12 +54,12 @@ 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.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.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.UpdateCommandBlockC2SPacket.class, "UpdateCommandBlockC2SPacket"); @@ -70,8 +70,6 @@ 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"); @@ -92,6 +90,8 @@ public class PacketUtils { 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"); @@ -297,8 +297,6 @@ public class PacketUtils { S2C_PACKETS_R.put("TitleFadeS2CPacket", net.minecraft.network.packet.s2c.play.TitleFadeS2CPacket.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.PlayerSpawnS2CPacket.class, "PlayerSpawnS2CPacket"); - S2C_PACKETS_R.put("PlayerSpawnS2CPacket", net.minecraft.network.packet.s2c.play.PlayerSpawnS2CPacket.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"); From 2d096b60192fe16063df576fbdf057775c8070c5 Mon Sep 17 00:00:00 2001 From: Lovecrafts-Cat Date: Mon, 18 Sep 2023 00:10:10 +0200 Subject: [PATCH 05/13] WIP 1.20.2 (using 1.20.2-rc1) - Bumped the MC version - `ClientWorld.method_53875() -> ClientWorld.addEntity()` --- gradle.properties | 8 ++++---- .../meteorclient/mixin/ClientWorldMixin.java | 2 +- .../meteorclient/mixin/PacketByteBufMixin.java | 6 +++++- .../systems/modules/movement/ElytraBoost.java | 2 +- .../systems/modules/render/BreakIndicators.java | 12 ++++++------ .../systems/modules/render/LogoutSpots.java | 6 +++--- .../utils/entity/fakeplayer/FakePlayerEntity.java | 2 +- 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/gradle.properties b/gradle.properties index 1c6d617435..17276a97c1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ org.gradle.jvmargs=-Xmx2G # Fabric (https://fabricmc.net/develop) -minecraft_version=1.20.2-pre2 -yarn_mappings=1.20.2-pre2+build.1 +minecraft_version=1.20.2-rc1 +yarn_mappings=1.20.2-rc1+build.3 loader_version=0.14.22 -fapi_version=0.88.3+1.20.2 +fapi_version=0.88.5+1.20.2 # Mod Properties mod_version=0.5.4 @@ -38,4 +38,4 @@ reflections_version=0.10.2 netty_version=4.1.90.Final # Mixin Extras (https://github.com/LlamaLad7/MixinExtras) -mixin_extras_version=0.2.0-rc.2 +mixin_extras_version=0.2.0-rc.3 diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java index f609c1212c..106d8a1d4b 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ClientWorldMixin.java @@ -34,7 +34,7 @@ public abstract class ClientWorldMixin { @Shadow @Nullable public abstract Entity getEntityById(int id); - @Inject(method = "method_53875", at = @At("TAIL")) + @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/PacketByteBufMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/PacketByteBufMixin.java index 4eee483949..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 { + @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/systems/modules/movement/ElytraBoost.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/movement/ElytraBoost.java index dc034c525e..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.method_53875(entity); + mc.world.addEntity(entity); } } 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/utils/entity/fakeplayer/FakePlayerEntity.java b/src/main/java/meteordevelopment/meteorclient/utils/entity/fakeplayer/FakePlayerEntity.java index 658d8c82e7..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.method_53875(this); + mc.world.addEntity(this); } public void despawn() { From 6e72c09c5a90f9aa99d550ff2f59f6b78defd350 Mon Sep 17 00:00:00 2001 From: Lovecrafts-Cat Date: Thu, 21 Sep 2023 18:20:45 +0200 Subject: [PATCH 06/13] WIP 1.20.2 (using 1.20.2) - Bumped the MC version - this builds and runs, but fails on world join (Baritone related issue, waiting for their update) This is the last commit I'll do on the branch, it's up to the others to fix the remaining mess and make a clean PR :) --- build.gradle | 2 +- gradle.properties | 10 +++++----- src/main/resources/fabric.mod.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index d52dd169d7..2f3bd3c298 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ dependencies { //modCompileOnly("io.vram:canvas-fabric-mc119:1.0.+") { transitive = false } // TODO: 1.19.3 // Baritone (https://github.com/MeteorDevelopment/baritone) - modInclude "baritone:fabric:1.20.1-SNAPSHOT" // TODO: reset to automated versioning once updated + modInclude "baritone:fabric:${project.minecraft_version}-SNAPSHOT" // Libraries library "meteordevelopment:orbit:${project.orbit_version}" diff --git a/gradle.properties b/gradle.properties index 17276a97c1..898292fa84 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ org.gradle.jvmargs=-Xmx2G # Fabric (https://fabricmc.net/develop) -minecraft_version=1.20.2-rc1 -yarn_mappings=1.20.2-rc1+build.3 +minecraft_version=1.20.2 +yarn_mappings=1.20.2+build.1 loader_version=0.14.22 -fapi_version=0.88.5+1.20.2 +fapi_version=0.89.0+1.20.2 # Mod Properties mod_version=0.5.4 @@ -14,7 +14,7 @@ archives_base_name=meteor-client # Dependency Versions # Sodium (https://github.com/CaffeineMC/sodium-fabric) -sodium_version=mc1.20.1-0.5.2 +sodium_version=mc1.20.2-0.5.3 # Lithium (https://github.com/CaffeineMC/lithium-fabric) lithium_version=mc1.20.1-0.11.2 @@ -38,4 +38,4 @@ reflections_version=0.10.2 netty_version=4.1.90.Final # Mixin Extras (https://github.com/LlamaLad7/MixinExtras) -mixin_extras_version=0.2.0-rc.3 +mixin_extras_version=0.2.0-rc.4 diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 892184267c..67aa28c250 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -47,7 +47,7 @@ }, "depends": { "java": ">=17", - "minecraft": ">=1.20.2-", + "minecraft": "1.20.2", "fabricloader": ">=0.14.22" }, "breaks": { From 8fe9f7a4907df717dbb95658ef139a7cb27e6757 Mon Sep 17 00:00:00 2001 From: Wide-Cat Date: Sat, 30 Sep 2023 21:13:45 +0100 Subject: [PATCH 07/13] assorted fixes and updates --- build.gradle | 4 +-- gradle.properties | 10 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- .../mixin/CapeFeatureRendererMixin.java | 24 ++++++++++++++ .../meteorclient/mixin/ChatHudMixin.java | 6 ++++ .../mixin/ClientConnectionMixin.java | 4 +-- .../mixin/DisconnectedScreenMixin.java | 16 ++++++--- .../mixin/ElytraFeatureRendererMixin.java | 33 +++++++++++++++++++ .../mixin/PlayerListEntryMixin.java | 6 ++-- .../meteorclient/mixin/SkinTexturesMixin.java | 24 -------------- ...drasilMinecraftSessionServiceAccessor.java | 6 ++-- .../systems/accounts/types/EasyMCAccount.java | 2 +- .../accounts/types/TheAlteningAccount.java | 2 +- src/main/resources/meteor-client.mixins.json | 3 +- 14 files changed, 96 insertions(+), 46 deletions(-) create mode 100644 src/main/java/meteordevelopment/meteorclient/mixin/CapeFeatureRendererMixin.java create mode 100644 src/main/java/meteordevelopment/meteorclient/mixin/ElytraFeatureRendererMixin.java delete mode 100644 src/main/java/meteordevelopment/meteorclient/mixin/SkinTexturesMixin.java diff --git a/build.gradle b/build.gradle index 5171289340..49c5d37fe5 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 diff --git a/gradle.properties b/gradle.properties index 03fa0f2565..2a0f929dc4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx2G minecraft_version=1.20.2 yarn_mappings=1.20.2+build.1 loader_version=0.14.22 -fapi_version=0.89.0+1.20.2 +fapi_version=0.89.2+1.20.2 # Mod Properties mod_version=0.5.4 @@ -17,10 +17,10 @@ archives_base_name=meteor-client sodium_version=mc1.20.2-0.5.3 # Lithium (https://github.com/CaffeineMC/lithium-fabric) -lithium_version=mc1.20.1-0.11.2 +lithium_version=mc1.20.2-0.12.0 # Iris (https://github.com/IrisShaders/Iris) -iris_version=1.6.8+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-rc.4 +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/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 ba544e8c4e..ddbf0dc837 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java @@ -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)); } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java index 8b415e8fef..3092d3f470 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/DisconnectedScreenMixin.java @@ -12,9 +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.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; @@ -25,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; @@ -33,13 +38,14 @@ protected DisconnectedScreenMixin(Text title) { } @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, GridWidget.Adder adder) { + 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())); @@ -62,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/PlayerListEntryMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java index 6b625f9ffb..7325eaf4e7 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; @@ -24,10 +24,10 @@ public abstract class PlayerListEntryMixin { public abstract GameProfile getProfile(); @Inject(method = "getSkinTextures", at = @At("HEAD"), cancellable = true) - private void onGetTexture(CallbackInfoReturnable info) { + 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.getTexture(getProfile())); } } } diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/SkinTexturesMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/SkinTexturesMixin.java deleted file mode 100644 index e3b4755380..0000000000 --- a/src/main/java/meteordevelopment/meteorclient/mixin/SkinTexturesMixin.java +++ /dev/null @@ -1,24 +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 meteordevelopment.meteorclient.utils.network.Capes; -import net.minecraft.client.util.SkinTextures; -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; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -@Mixin(SkinTextures.class) -public class SkinTexturesMixin { - @Inject(method = "capeTexture", at = @At("HEAD"), cancellable = true) - private void onGetCapeTexture(CallbackInfoReturnable info) { - Identifier id = Capes.get((PlayerEntity) (Object) this); - if (id != null) info.setReturnValue(id); - } -} 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/types/EasyMCAccount.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/EasyMCAccount.java index a104a46633..4ab3b2bb3d 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/EasyMCAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/EasyMCAccount.java @@ -51,7 +51,7 @@ public boolean fetchInfo() { @Override public boolean login() { - applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE, ENVIRONMENT)); + applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE.getServicesKeySet(), SERVICE.getProxy(), ENVIRONMENT)); setSession(new Session(cache.username, cache.uuid, name, Optional.empty(), Optional.empty(), Session.AccountType.MOJANG)); cache.loadHead(); 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 7581c90466..e993bc3e26 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java @@ -41,7 +41,7 @@ public boolean fetchInfo() { @Override public boolean login() { - applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE, ENVIRONMENT)); + applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE.getServicesKeySet(), SERVICE.getProxy(), ENVIRONMENT)); /*YggdrasilUserAuthentication auth = getAuth(); diff --git a/src/main/resources/meteor-client.mixins.json b/src/main/resources/meteor-client.mixins.json index 1294db748e..6ea10c20d4 100644 --- a/src/main/resources/meteor-client.mixins.json +++ b/src/main/resources/meteor-client.mixins.json @@ -37,6 +37,7 @@ "BufferRendererAccessor", "CameraMixin", "CapabilityTrackerMixin", + "CapeFeatureRendererMixin", "ChatHudAccessor", "ChatHudLineMixin", "ChatHudLineVisibleMixin", @@ -69,6 +70,7 @@ "DefaultSkinHelperMixin", "DisconnectedScreenMixin", "DrawContextMixin", + "ElytraFeatureRendererMixin", "EnchantingTableBlockEntityRendererMixin", "EndCrystalEntityRendererMixin", "EntityAccessor", @@ -147,7 +149,6 @@ "SimpleEntityLookupAccessor", "SimpleOptionMixin", "SimpleRegistryMixin", - "SkinTexturesMixin", "SlimeBlockMixin", "SlotMixin", "SoundSystemMixin", From 6d38bf75c1fa3ae2ec7458909dbe460be7db6579 Mon Sep 17 00:00:00 2001 From: Wide-Cat Date: Wed, 4 Oct 2023 15:41:16 +0100 Subject: [PATCH 08/13] fix altening and ms accounts --- build.gradle | 1 + .../systems/accounts/AccountCache.java | 6 +-- .../systems/accounts/MicrosoftLogin.java | 5 ++- .../accounts/types/TheAlteningAccount.java | 37 +++++++++++-------- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index 49c5d37fe5..335f2911f2 100644 --- a/build.gradle +++ b/build.gradle @@ -71,6 +71,7 @@ dependencies { library("io.netty:netty-codec-socks:${project.netty_version}") { transitive = false } 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/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java index a4d7620a2f..341e6fed3b 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java @@ -15,7 +15,7 @@ public class AccountCache implements ISerializable { public String username = ""; - public UUID uuid = UUID.fromString(""); + public UUID uuid = null; private PlayerHeadTexture headTexture; public PlayerHeadTexture getHeadTexture() { @@ -23,7 +23,7 @@ public PlayerHeadTexture getHeadTexture() { } public void loadHead() { - if (uuid == null || uuid.toString().isBlank()) return; + if (uuid == null) return; headTexture = PlayerHeadUtils.fetchHead(uuid); } @@ -32,7 +32,7 @@ public NbtCompound toTag() { NbtCompound tag = new NbtCompound(); tag.putString("username", username); - tag.putString("uuid", uuid.toString()); + tag.putUuid("uuid", uuid); return tag; } diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java index 616d6f9749..cc101e0bd8 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java @@ -5,6 +5,7 @@ package meteordevelopment.meteorclient.systems.accounts; +import com.mojang.util.UndashedUuid; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; @@ -102,7 +103,7 @@ public static LoginData login(String refreshToken) { if (profileRes == null) return new LoginData(); - return new LoginData(mcRes.access_token, refreshToken, profileRes.id, profileRes.name); + return new LoginData(mcRes.access_token, refreshToken, UndashedUuid.fromString(profileRes.id), profileRes.name); } private static void startServer() { @@ -219,7 +220,7 @@ private boolean hasGameOwnership() { } private static class ProfileResponse { - public UUID id; + public String id; public String name; } } 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 e993bc3e26..bfdf14e1ce 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java @@ -7,10 +7,16 @@ import com.mojang.authlib.Environment; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +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.session.Session; + +import java.util.Optional; import static meteordevelopment.meteorclient.MeteorClient.mc; @@ -24,48 +30,49 @@ 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(); return true; - } catch (AuthenticationException e) { + } catch (Exception e) { return false; - }*/ - return true; + } } @Override public boolean login() { 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; - }*/ - return true; + } } - /*private YggdrasilUserAuthentication getAuth() { - YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) SERVICE.createUserAuthentication(Agent.MINECRAFT); + private WaybackAuthLib getAuth() { + WaybackAuthLib auth = new WaybackAuthLib(ENVIRONMENT.accountsHost()); //(YggdrasilUserAuthentication) SERVICE.createUserAuthentication(Agent.MINECRAFT); auth.setUsername(name); auth.setPassword("Meteor on Crack!"); return auth; - }*/ + } } From 61d44aece5506da3b18824904a8da371c168903e Mon Sep 17 00:00:00 2001 From: Wide-Cat Date: Wed, 4 Oct 2023 21:05:33 +0100 Subject: [PATCH 09/13] revert UUID configs to use strings --- .../meteorclient/systems/accounts/AccountCache.java | 4 ++-- .../meteorclient/systems/friends/Friend.java | 2 +- .../meteorclient/systems/friends/Friends.java | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java index 341e6fed3b..c9e0ab64cf 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java @@ -32,7 +32,7 @@ public NbtCompound toTag() { NbtCompound tag = new NbtCompound(); tag.putString("username", username); - tag.putUuid("uuid", uuid); + tag.putString("uuid", uuid.toString()); return tag; } @@ -42,7 +42,7 @@ public AccountCache fromTag(NbtCompound tag) { if (!tag.contains("username") || !tag.contains("uuid")) throw new NbtException(); username = tag.getString("username"); - uuid = tag.getUuid("uuid"); + uuid = UUID.fromString(tag.getString("uuid")); loadHead(); return this; diff --git a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java index 9f45a8099f..b51b0e9c0c 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java @@ -63,7 +63,7 @@ public NbtCompound toTag() { NbtCompound tag = new NbtCompound(); tag.putString("name", name); - if (id != null) tag.putUuid("id", id); + if (id != null) tag.putString("id", id.toString()); 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 551b5c9440..44eba39c9d 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java @@ -113,9 +113,9 @@ public Friends fromTag(NbtCompound tag) { String name = friendTag.getString("name"); if (get(name) != null) continue; - UUID uuid = friendTag.getUuid("id"); - Friend friend = !uuid.toString().isBlank() - ? new Friend(name, uuid) + String uuid = friendTag.getString("id"); + Friend friend = !uuid.isBlank() + ? new Friend(name, UUID.fromString(uuid)) : new Friend(name); friends.add(friend); From 868dac92ddfb8d2ec3b63ae2bb0b11c18711142b Mon Sep 17 00:00:00 2001 From: Wide-Cat Date: Fri, 6 Oct 2023 17:38:20 +0100 Subject: [PATCH 10/13] update yarn/fapi --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2a0f929dc4..183f686682 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx2G # Fabric (https://fabricmc.net/develop) minecraft_version=1.20.2 -yarn_mappings=1.20.2+build.1 +yarn_mappings=1.20.2+build.4 loader_version=0.14.22 -fapi_version=0.89.2+1.20.2 +fapi_version=0.89.3+1.20.2 # Mod Properties mod_version=0.5.4 From 60a7d97a466c35754ec67c2e0722ff1dcc46bf3c Mon Sep 17 00:00:00 2001 From: Wide-Cat Date: Fri, 6 Oct 2023 19:00:17 +0100 Subject: [PATCH 11/13] some fixes --- .../meteorclient/mixin/DefaultSkinHelperMixin.java | 2 +- .../meteorclient/mixin/PlayerListEntryMixin.java | 2 +- .../meteorclient/systems/accounts/AccountCache.java | 3 ++- .../meteorclient/systems/accounts/MicrosoftLogin.java | 2 +- .../meteorclient/systems/friends/Friend.java | 3 ++- .../meteorclient/systems/friends/Friends.java | 8 ++++++-- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/DefaultSkinHelperMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/DefaultSkinHelperMixin.java index f63cbd74ad..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 = "getTexture(Ljava/util/UUID;)Lnet/minecraft/client/util/SkinTextures;", 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/PlayerListEntryMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java index 7325eaf4e7..f040007d03 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerListEntryMixin.java @@ -27,7 +27,7 @@ public abstract class PlayerListEntryMixin { private void onGetTexture(CallbackInfoReturnable info) { if (getProfile().getName().equals(MinecraftClient.getInstance().getSession().getUsername())) { if (Modules.get().get(NameProtect.class).skinProtect()) { - info.setReturnValue(DefaultSkinHelper.getTexture(getProfile())); + info.setReturnValue(DefaultSkinHelper.getSkinTextures(getProfile())); } } } diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java index c9e0ab64cf..a5df7d652b 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java @@ -5,6 +5,7 @@ package meteordevelopment.meteorclient.systems.accounts; +import com.mojang.util.UndashedUuid; import meteordevelopment.meteorclient.utils.misc.ISerializable; import meteordevelopment.meteorclient.utils.misc.NbtException; import meteordevelopment.meteorclient.utils.render.PlayerHeadTexture; @@ -42,7 +43,7 @@ public AccountCache fromTag(NbtCompound tag) { if (!tag.contains("username") || !tag.contains("uuid")) throw new NbtException(); username = tag.getString("username"); - uuid = UUID.fromString(tag.getString("uuid")); + uuid = UndashedUuid.fromStringLenient(tag.getString("uuid")); loadHead(); return this; diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java index cc101e0bd8..dd496ca345 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java @@ -103,7 +103,7 @@ public static LoginData login(String refreshToken) { if (profileRes == null) return new LoginData(); - return new LoginData(mcRes.access_token, refreshToken, UndashedUuid.fromString(profileRes.id), profileRes.name); + return new LoginData(mcRes.access_token, refreshToken, UndashedUuid.fromStringLenient(profileRes.id), profileRes.name); } private static void startServer() { diff --git a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java index b51b0e9c0c..5b5f68ebbc 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java @@ -5,6 +5,7 @@ package meteordevelopment.meteorclient.systems.friends; +import com.mojang.util.UndashedUuid; import meteordevelopment.meteorclient.utils.misc.ISerializable; import meteordevelopment.meteorclient.utils.network.Http; import meteordevelopment.meteorclient.utils.render.PlayerHeadTexture; @@ -49,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 = UUID.fromString(res.id); + id = UndashedUuid.fromStringLenient(res.id); headTexture = PlayerHeadUtils.fetchHead(id); updating = false; } diff --git a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java index 44eba39c9d..7227e58c4d 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friends.java @@ -5,6 +5,7 @@ package meteordevelopment.meteorclient.systems.friends; +import com.mojang.util.UndashedUuid; import meteordevelopment.meteorclient.systems.System; import meteordevelopment.meteorclient.systems.Systems; import meteordevelopment.meteorclient.utils.misc.NbtUtils; @@ -15,7 +16,10 @@ import net.minecraft.nbt.NbtElement; import org.jetbrains.annotations.NotNull; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; public class Friends extends System implements Iterable { private final List friends = new ArrayList<>(); @@ -115,7 +119,7 @@ public Friends fromTag(NbtCompound tag) { String uuid = friendTag.getString("id"); Friend friend = !uuid.isBlank() - ? new Friend(name, UUID.fromString(uuid)) + ? new Friend(name, UndashedUuid.fromStringLenient(uuid)) : new Friend(name); friends.add(friend); From fe41b3ed3cdfcb419ff406b5a36c4659c0acf192 Mon Sep 17 00:00:00 2001 From: Wide-Cat Date: Sun, 8 Oct 2023 15:54:50 +0100 Subject: [PATCH 12/13] more reverts for uuid stuff --- .../meteorclient/systems/accounts/AccountCache.java | 12 +++++------- .../systems/accounts/MicrosoftLogin.java | 9 +++------ .../systems/accounts/types/EasyMCAccount.java | 6 +++--- .../systems/accounts/types/MicrosoftAccount.java | 3 ++- .../systems/accounts/types/TheAlteningAccount.java | 4 ++-- .../meteorclient/systems/friends/Friend.java | 2 +- .../meteorclient/utils/misc/FakeClientPlayer.java | 12 +++++------- 7 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java index a5df7d652b..8ab88f86be 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/AccountCache.java @@ -12,11 +12,9 @@ import meteordevelopment.meteorclient.utils.render.PlayerHeadUtils; import net.minecraft.nbt.NbtCompound; -import java.util.UUID; - public class AccountCache implements ISerializable { public String username = ""; - public UUID uuid = null; + public String uuid = ""; private PlayerHeadTexture headTexture; public PlayerHeadTexture getHeadTexture() { @@ -24,8 +22,8 @@ public PlayerHeadTexture getHeadTexture() { } public void loadHead() { - if (uuid == null) return; - headTexture = PlayerHeadUtils.fetchHead(uuid); + if (uuid == null || uuid.isBlank()) return; + headTexture = PlayerHeadUtils.fetchHead(UndashedUuid.fromStringLenient(uuid)); } @Override @@ -33,7 +31,7 @@ public NbtCompound toTag() { NbtCompound tag = new NbtCompound(); tag.putString("username", username); - tag.putString("uuid", uuid.toString()); + tag.putString("uuid", uuid); return tag; } @@ -43,7 +41,7 @@ public AccountCache fromTag(NbtCompound tag) { if (!tag.contains("username") || !tag.contains("uuid")) throw new NbtException(); username = tag.getString("username"); - uuid = UndashedUuid.fromStringLenient(tag.getString("uuid")); + uuid = tag.getString("uuid"); loadHead(); return this; diff --git a/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java index dd496ca345..cc0bdf877c 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/MicrosoftLogin.java @@ -5,7 +5,6 @@ package meteordevelopment.meteorclient.systems.accounts; -import com.mojang.util.UndashedUuid; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; @@ -20,19 +19,17 @@ import java.net.InetSocketAddress; import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.UUID; import java.util.function.Consumer; public class MicrosoftLogin { public static class LoginData { public String mcToken; public String newRefreshToken; - public UUID uuid; - public String username; + public String uuid, username; public LoginData() {} - public LoginData(String mcToken, String newRefreshToken, UUID uuid, String username) { + public LoginData(String mcToken, String newRefreshToken, String uuid, String username) { this.mcToken = mcToken; this.newRefreshToken = newRefreshToken; this.uuid = uuid; @@ -103,7 +100,7 @@ public static LoginData login(String refreshToken) { if (profileRes == null) return new LoginData(); - return new LoginData(mcRes.access_token, refreshToken, UndashedUuid.fromStringLenient(profileRes.id), profileRes.name); + return new LoginData(mcRes.access_token, refreshToken, profileRes.id, profileRes.name); } private static void startServer() { 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 4ab3b2bb3d..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,6 +7,7 @@ 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; @@ -15,7 +16,6 @@ import net.minecraft.client.session.Session; import java.util.Optional; -import java.util.UUID; import static meteordevelopment.meteorclient.MeteorClient.mc; @@ -52,7 +52,7 @@ public boolean fetchInfo() { @Override public boolean login() { applyLoginEnvironment(SERVICE, YggdrasilMinecraftSessionServiceAccessor.createYggdrasilMinecraftSessionService(SERVICE.getServicesKeySet(), SERVICE.getProxy(), ENVIRONMENT)); - setSession(new Session(cache.username, cache.uuid, name, Optional.empty(), Optional.empty(), Session.AccountType.MOJANG)); + setSession(new Session(cache.username, UndashedUuid.fromStringLenient(cache.uuid), name, Optional.empty(), Optional.empty(), Session.AccountType.MOJANG)); cache.loadHead(); return true; @@ -60,7 +60,7 @@ public boolean login() { private static class AuthResponse { public String mcName; - public UUID uuid; + public String uuid; public String session; public String message; } 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 2282b16834..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,6 +5,7 @@ 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; @@ -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 bfdf14e1ce..b1c37466f2 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/types/TheAlteningAccount.java @@ -36,7 +36,7 @@ public boolean fetchInfo() { auth.logIn(); cache.username = auth.getCurrentProfile().getName(); - cache.uuid = auth.getCurrentProfile().getId(); + cache.uuid = auth.getCurrentProfile().getId().toString(); return true; } catch (Exception e) { @@ -68,7 +68,7 @@ public boolean login() { } private WaybackAuthLib getAuth() { - WaybackAuthLib auth = new WaybackAuthLib(ENVIRONMENT.accountsHost()); //(YggdrasilUserAuthentication) SERVICE.createUserAuthentication(Agent.MINECRAFT); + 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 5b5f68ebbc..16476b039a 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/friends/Friend.java @@ -64,7 +64,7 @@ public NbtCompound toTag() { NbtCompound tag = new NbtCompound(); tag.putString("name", name); - if (id != null) tag.putString("id", id.toString()); + if (id != null) tag.putString("id", UndashedUuid.toString(id)); return tag; } diff --git a/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java b/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java index a16d434897..7f5a9e8ab3 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/misc/FakeClientPlayer.java @@ -7,9 +7,7 @@ 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; @@ -37,17 +35,17 @@ public static void init() { MeteorClient.EVENT_BUS.subscribe(FakeClientPlayer.class); } - @EventHandler - private static void onGameJoined(GameJoinedEvent event) { - } - public static PlayerEntity getPlayer() { UUID id = mc.getSession().getUuidOrNull(); if (player == null || (!id.equals(lastId))) { if (world == null) { world = new ClientWorld( - new ClientPlayNetworkHandler(mc, new ClientConnection(NetworkSide.CLIENTBOUND), new ClientConnectionState(null, null, null, null, null, null, null)), + 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(), From 78577cd12769f9b518b53dccd4af389698b9a8ff Mon Sep 17 00:00:00 2001 From: Wide-Cat Date: Sun, 8 Oct 2023 18:03:53 +0100 Subject: [PATCH 13/13] Properly refresh game profile when changing accounts --- .../meteorclient/mixin/MinecraftClientAccessor.java | 6 ++++++ .../meteorclient/systems/accounts/Account.java | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java index 16e062329f..48ad6bacdd 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/MinecraftClientAccessor.java @@ -7,6 +7,7 @@ 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; @@ -21,6 +22,7 @@ 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/systems/accounts/Account.java b/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java index 046d7ceffa..428a424eb9 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/accounts/Account.java @@ -23,8 +23,10 @@ import net.minecraft.client.texture.PlayerSkinProvider; 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; @@ -65,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()); @@ -76,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) {