Skip to content

Commit

Permalink
ChatMessagesMixin: Don't use javafx.util.Pair
Browse files Browse the repository at this point in the history
  • Loading branch information
caoimhebyrne committed Feb 3, 2024
1 parent f121834 commit 0932505
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,7 +24,7 @@ public class ChatMessagesMixin {
TextRenderer textRenderer,
CallbackInfoReturnable<List<OrderedText>> 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);
}
Expand All @@ -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;
}
}

0 comments on commit 0932505

Please sign in to comment.