mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 02:02:04 -07:00
Fix chat messages being logged without formatting to console (#9058)
This commit is contained in:
@@ -2117,6 +2117,14 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/
|
|||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
||||||
|
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
|
||||||
|
|
||||||
|
public static final Logger LOGGER = LogUtils.getLogger();
|
||||||
|
+ public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper
|
||||||
|
public static final String VANILLA_BRAND = "vanilla";
|
||||||
|
private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F;
|
||||||
|
private static final int TICK_STATS_SPAN = 100;
|
||||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
private boolean allowFlight;
|
private boolean allowFlight;
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -2153,6 +2161,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
public boolean isStopped() {
|
public boolean isStopped() {
|
||||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
}
|
||||||
|
|
||||||
|
public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) {
|
||||||
|
- String s1 = params.decorate(message).getString();
|
||||||
|
+ // Paper start
|
||||||
|
+ net.kyori.adventure.text.Component s1 = io.papermc.paper.adventure.PaperAdventure.asAdventure(params.decorate(message));
|
||||||
|
|
||||||
|
if (prefix != null) {
|
||||||
|
- MinecraftServer.LOGGER.info("[{}] {}", prefix, s1);
|
||||||
|
+ MinecraftServer.COMPONENT_LOGGER.info("[{}] {}", prefix, s1);
|
||||||
|
} else {
|
||||||
|
- MinecraftServer.LOGGER.info("{}", s1);
|
||||||
|
+ MinecraftServer.COMPONENT_LOGGER.info("{}", s1);
|
||||||
|
+ // Paper end
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
public final java.util.concurrent.ExecutorService chatExecutor = java.util.concurrent.Executors.newCachedThreadPool(
|
public final java.util.concurrent.ExecutorService chatExecutor = java.util.concurrent.Executors.newCachedThreadPool(
|
||||||
|
@@ -15,8 +15,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
+ private static MinecraftServer SERVER; // Paper
|
+ private static MinecraftServer SERVER; // Paper
|
||||||
public static final Logger LOGGER = LogUtils.getLogger();
|
public static final Logger LOGGER = LogUtils.getLogger();
|
||||||
|
public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper
|
||||||
public static final String VANILLA_BRAND = "vanilla";
|
public static final String VANILLA_BRAND = "vanilla";
|
||||||
private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F;
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
|
public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
|
||||||
|
Reference in New Issue
Block a user