Fix chat messages being logged without formatting to console (#9058)

This commit is contained in:
Jason 2023-03-27 10:19:23 -07:00 committed by GitHub
parent fbf74ba0ac
commit bd62f2c2dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 183 additions and 158 deletions

View file

@ -729,7 +729,7 @@ index fc4dcd801480fe6d89a985de411baa9a3a66f6ef..4a1148a76020089caf01f888f87afdbb
} catch (Exception exception) {
if (listener.shouldPropagateHandlingExceptions()) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0dbdf1d9a 100644
index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022db631a903 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -189,7 +189,7 @@ import org.bukkit.event.player.AsyncPlayerChatPreviewEvent;
@ -741,7 +741,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
@@ -864,6 +864,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -865,6 +865,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
MinecraftServer.LOGGER.info("Stopping server");
@ -749,7 +749,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
// CraftBukkit start
if (this.server != null) {
this.server.disablePlugins();
@@ -1102,9 +1103,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1103,9 +1104,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private boolean haveTime() {
// CraftBukkit start
@ -771,7 +771,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
private void executeModerately() {
this.runAllTasks();
java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L);
@@ -1112,9 +1125,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1113,9 +1126,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end
protected void waitUntilNextTick() {
@ -783,7 +783,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
});
}
@@ -1199,9 +1212,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1200,9 +1213,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public void onServerExit() {}
public void tickServer(BooleanSupplier shouldKeepTicking) {
@ -802,7 +802,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
++this.tickCount;
this.tickChildren(shouldKeepTicking);
if (i - this.lastServerStatus >= 5000000000L) {
@@ -1210,15 +1231,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1211,15 +1232,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit
@ -823,7 +823,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
this.profiler.push("tallying");
long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
@@ -1228,8 +1252,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1229,8 +1253,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.frameTimer.logFrameDuration(k - i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
@ -833,7 +833,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
}
private ServerStatus buildServerStatus() {
@@ -1261,26 +1284,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1262,26 +1285,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickChildren(BooleanSupplier shouldKeepTicking) {
@ -867,7 +867,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
// Send time updates to everyone, it will get the right time from the world the player is in.
if (this.tickCount % 20 == 0) {
for (int i = 0; i < this.getPlayerList().players.size(); ++i) {
@@ -1288,7 +1311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1289,7 +1312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level.getGameTime(), entityplayer.getPlayerTime(), entityplayer.level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time
}
}
@ -876,7 +876,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
@@ -1334,24 +1357,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1335,24 +1358,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
this.profiler.popPush("connection");