From 20dcbf0f34040bdf757be6ee41c270b09a204993 Mon Sep 17 00:00:00 2001 From: Pyrofab Date: Sat, 30 Jul 2022 12:15:38 +0200 Subject: [PATCH] Update to 1.19.1 --- gradle.properties | 10 +++++----- gradle/libs.versions.toml | 2 +- .../impl/mixin/ServerPlayNetworkHandlerMixin.java | 4 ++-- .../ladysnake/impersonatest/ImpersonateTestSuite.java | 3 ++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/gradle.properties b/gradle.properties index ecab246..842e85a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx2G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.19 -yarn_mappings=1.19+build.4 +minecraft_version=1.19.1 +yarn_mappings=1.19.1+build.1 loader_version=0.14.8 -fabric_version=0.57.0+1.19 +fabric_version=0.58.5+1.19.1 # Other Dependencies jb_annotations_version = 23.0.0 apiguardian_version = 1.1.2 # Mod Properties -mod_version = 2.6.1 +mod_version = 2.7.0 maven_group = io.github.ladysnake archives_base_name = impersonate @@ -24,7 +24,7 @@ license_header = LGPL gpl_version = 3 modrinth_id = xBZuWXoj curseforge_id = 360333 -curseforge_versions = 1.19 +curseforge_versions = 1.19.1 cf_requirements = fabric-api cf_embeddeds = cardinal-components release_type = release diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0eed590..fe6ac97 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] cca = "5.0.1" fpa = "0.1-SNAPSHOT" -elmendorf = "0.6.0" +elmendorf = "0.7.0" [libraries] cca-base = { module = "dev.onyxstudios.cardinal-components-api:cardinal-components-base", version.ref = "cca" } diff --git a/src/main/java/io/github/ladysnake/impersonate/impl/mixin/ServerPlayNetworkHandlerMixin.java b/src/main/java/io/github/ladysnake/impersonate/impl/mixin/ServerPlayNetworkHandlerMixin.java index 636661e..f6df5dc 100644 --- a/src/main/java/io/github/ladysnake/impersonate/impl/mixin/ServerPlayNetworkHandlerMixin.java +++ b/src/main/java/io/github/ladysnake/impersonate/impl/mixin/ServerPlayNetworkHandlerMixin.java @@ -37,12 +37,12 @@ public abstract class ServerPlayNetworkHandlerMixin { @Shadow public ServerPlayerEntity player; - @ModifyArg(method = "sendPacket(Lnet/minecraft/network/Packet;Lio/netty/util/concurrent/GenericFutureListener;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;send(Lnet/minecraft/network/Packet;Lio/netty/util/concurrent/GenericFutureListener;)V")) + @ModifyArg(method = "sendPacket(Lnet/minecraft/network/Packet;Lnet/minecraft/class_7648;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;send(Lnet/minecraft/network/Packet;Lnet/minecraft/class_7648;)V")) private Packet resolveFakeTextsInPackets(Packet packet) { if (packet instanceof GameMessageS2CPacket gamePacket) { if (this.existsImpersonator()) { Text resolvedText = ((RecipientAwareText) gamePacket.content()).impersonateResolveAll(player); - return new GameMessageS2CPacket(resolvedText, gamePacket.typeId()); + return new GameMessageS2CPacket(resolvedText, gamePacket.overlay()); } } else if (packet instanceof PlayerListS2CPacket listPacket) { if (this.existsImpersonator()) { diff --git a/src/testmod/java/io/github/ladysnake/impersonatest/ImpersonateTestSuite.java b/src/testmod/java/io/github/ladysnake/impersonatest/ImpersonateTestSuite.java index bcea168..1151365 100644 --- a/src/testmod/java/io/github/ladysnake/impersonatest/ImpersonateTestSuite.java +++ b/src/testmod/java/io/github/ladysnake/impersonatest/ImpersonateTestSuite.java @@ -18,6 +18,7 @@ package io.github.ladysnake.impersonatest; import com.mojang.authlib.GameProfile; +import io.github.ladysnake.elmendorf.ElmendorfTestContext; import io.github.ladysnake.elmendorf.GameTestUtil; import io.github.ladysnake.impersonate.Impersonate; import io.github.ladysnake.impersonate.Impersonator; @@ -35,7 +36,7 @@ public class ImpersonateTestSuite implements FabricGameTest { public void nameChanges(TestContext ctx) { Identifier key = new Identifier("impersonatest", "key"); GameProfile profile = new GameProfile(UUID.randomUUID(), "impersonator"); - ServerPlayerEntity player = ctx.spawnServerPlayer(1, 0, 1); + ServerPlayerEntity player = ((ElmendorfTestContext)ctx).spawnServerPlayer(1, 0, 1); Text formerName = player.getDisplayName(); Impersonator impersonator = player.getComponent(Impersonate.IMPERSONATION); impersonator.impersonate(key, profile);