From 7d40308cf9cdded54159b783b83149fd43f697b7 Mon Sep 17 00:00:00 2001 From: huskcasaca <100605532+huskcasaca@users.noreply.github.com> Date: Thu, 29 Sep 2022 00:17:10 +0800 Subject: Port to 1.19.2 --- src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java') diff --git a/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java b/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java index 640794e..e4a1826 100644 --- a/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java +++ b/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java @@ -1,10 +1,8 @@ package com.keuin.kbackupfabric.util; import com.mojang.brigadier.context.CommandContext; -import net.minecraft.network.MessageType; import net.minecraft.server.PlayerManager; import net.minecraft.server.command.ServerCommandSource; -import net.minecraft.text.LiteralText; import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -44,7 +42,7 @@ public final class PrintUtil { synchronized (syncBroadcast) { if (fuckingPlayerManager != null) // fuckingPlayerManager.sendToAll(new LiteralText(message).setStyle(broadcastStyle)); - fuckingPlayerManager.broadcast(new LiteralText(message).setStyle(broadcastStyle), MessageType.GAME_INFO, UUID.randomUUID()); + fuckingPlayerManager.broadcast(Text.literal(message).setStyle(broadcastStyle), true); else PrintUtil.error("Error in PrintUtil.broadcast: PlayerManager is not initialized."); } @@ -85,7 +83,7 @@ public final class PrintUtil { private static CommandContext message(CommandContext context, String messageText, boolean broadcastToOps, Style style) { if (context != null) { synchronized (syncMessage) { - Text text = new LiteralText(messageText).setStyle(style); + Text text = Text.literal(messageText).setStyle(style); context.getSource().sendFeedback(text, broadcastToOps); } } else { -- cgit v1.2.3