summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java
diff options
context:
space:
mode:
authorhuskcasaca <[email protected]>2022-09-29 00:17:10 +0800
committerKeuin <[email protected]>2022-09-29 00:39:10 +0800
commit7d40308cf9cdded54159b783b83149fd43f697b7 (patch)
treeda90df0a6277e3828c54459721b4e033465f90b3 /src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java
parentda1b7d4c482d482d201547899411fcbc330c7abe (diff)
Port to 1.19.2
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/util/PrintUtil.java6
1 files changed, 2 insertions, 4 deletions
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<ServerCommandSource> message(CommandContext<ServerCommandSource> 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 {