From 093250536a3bcbe5bf8423d15eae5a42770f943a Mon Sep 17 00:00:00 2001 From: Caoimhe Date: Sat, 3 Feb 2024 13:12:07 +0000 Subject: [PATCH] ChatMessagesMixin: Don't use `javafx.util.Pair` --- .../java/dev/caoimhe/compactchat/CompactChatClient.java | 2 +- .../dev/caoimhe/compactchat/mixin/ChatMessagesMixin.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/dev/caoimhe/compactchat/CompactChatClient.java b/src/main/java/dev/caoimhe/compactchat/CompactChatClient.java index b84a493..df24659 100644 --- a/src/main/java/dev/caoimhe/compactchat/CompactChatClient.java +++ b/src/main/java/dev/caoimhe/compactchat/CompactChatClient.java @@ -5,10 +5,10 @@ import dev.caoimhe.compactchat.config.Configuration; import dev.caoimhe.compactchat.util.CollectionUtil; import dev.caoimhe.compactchat.util.FabricLoaderUtil; -import javafx.util.Pair; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.text.OrderedText; +import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/dev/caoimhe/compactchat/mixin/ChatMessagesMixin.java b/src/main/java/dev/caoimhe/compactchat/mixin/ChatMessagesMixin.java index 8543693..bab34a6 100644 --- a/src/main/java/dev/caoimhe/compactchat/mixin/ChatMessagesMixin.java +++ b/src/main/java/dev/caoimhe/compactchat/mixin/ChatMessagesMixin.java @@ -3,11 +3,11 @@ import com.llamalad7.mixinextras.injector.ModifyReturnValue; import com.llamalad7.mixinextras.sugar.Local; import dev.caoimhe.compactchat.CompactChatClient; -import javafx.util.Pair; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.util.ChatMessages; import net.minecraft.text.OrderedText; import net.minecraft.text.StringVisitable; +import org.apache.commons.lang3.tuple.Pair; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -24,7 +24,7 @@ public class ChatMessagesMixin { TextRenderer textRenderer, CallbackInfoReturnable> cir ) { - var entry = CompactChatClient.SPLIT_MESSAGES_CACHE.getIfPresent(new Pair<>(message.getString(), width)); + var entry = CompactChatClient.SPLIT_MESSAGES_CACHE.getIfPresent(Pair.of(message.getString(), width)); if (entry != null) { cir.setReturnValue(entry); } @@ -36,7 +36,7 @@ public class ChatMessagesMixin { @Local(argsOnly = true) StringVisitable message, @Local(argsOnly = true) int width ) { - CompactChatClient.SPLIT_MESSAGES_CACHE.put(new Pair<>(message.getString(), width), original); + CompactChatClient.SPLIT_MESSAGES_CACHE.put(Pair.of(message.getString(), width), original); return original; } }