Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 04:20:04 +01:00
Use net.kyori.ansi for console logging (#9313)
Uses the new ANSIComponentSerializer introduced in Adventure 4.14.0 to serialize components when logging them via the ComponentLogger, or when sending messages to the console. This replaces the old solution which uses legacy jank and custom color conversions, with a new library that handles the conversion and config
Dieser Commit ist enthalten in:
Ursprung
87dfff4cfa
Commit
2d09115b3a
@ -14,7 +14,7 @@ public org.spigotmc.SpigotWorldConfig getString(Ljava/lang/String;Ljava/lang/Str
|
||||
public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index f3f20b34a3ebcbb75004003892e903ee4fd0edd3..d8da21801eda8ea5d04c8eb2941bbef968cb7951 100644
|
||||
index 952dde5d0d9fa6bcf97ae5cafe482cca1f5b3a78..9ab4d3e462c02e4d23b45adb46965eb75eb2178e 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,6 +13,7 @@ dependencies {
|
||||
@ -440,10 +440,10 @@ index 0000000000000000000000000000000000000000..9ef6712c70fcd8912a79f3f61e351aac
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..52b02cb1f02d1c65b840f38cfc8baee500aa2259
|
||||
index 0000000000000000000000000000000000000000..8633fdfa7e8aeac7414c232006fc298b3bfe1b58
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -0,0 +1,277 @@
|
||||
@@ -0,0 +1,276 @@
|
||||
+package io.papermc.paper.configuration;
|
||||
+
|
||||
+import co.aikar.timings.MinecraftTimings;
|
||||
@ -604,7 +604,6 @@ index 0000000000000000000000000000000000000000..52b02cb1f02d1c65b840f38cfc8baee5
|
||||
+ public class Logging extends ConfigurationPart {
|
||||
+ public boolean logPlayerIpAddresses = true;
|
||||
+ public boolean deobfuscateStacktraces = true;
|
||||
+ public boolean useRgbForNamedTextColors = true;
|
||||
+ }
|
||||
+
|
||||
+ public Scoreboards scoreboards;
|
||||
@ -1379,10 +1378,10 @@ index 0000000000000000000000000000000000000000..f6b9d216c24d8858802f85209fe1a869
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/RemovedConfigurations.java b/src/main/java/io/papermc/paper/configuration/RemovedConfigurations.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..1bb16fc7598cd53e822d84b69d6a9727b37f484f
|
||||
index 0000000000000000000000000000000000000000..efe7fc0bb92b70ef244875219f285724af9bfa24
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/RemovedConfigurations.java
|
||||
@@ -0,0 +1,63 @@
|
||||
@@ -0,0 +1,64 @@
|
||||
+package io.papermc.paper.configuration;
|
||||
+
|
||||
+import org.spongepowered.configurate.NodePath;
|
||||
@ -1442,7 +1441,8 @@ index 0000000000000000000000000000000000000000..1bb16fc7598cd53e822d84b69d6a9727
|
||||
+ path("commandErrorMessage"),
|
||||
+ path("baby-zombie-movement-speed"),
|
||||
+ path("limit-player-interactions"),
|
||||
+ path("warnWhenSettingExcessiveVelocity")
|
||||
+ path("warnWhenSettingExcessiveVelocity"),
|
||||
+ path("logging", "use-rgb-for-named-text-colors")
|
||||
+ };
|
||||
+
|
||||
+}
|
||||
|
@ -15660,7 +15660,7 @@ index 0000000000000000000000000000000000000000..962d3cae6340fc11607b59355e291629
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 52b02cb1f02d1c65b840f38cfc8baee500aa2259..3294da27227b5a332904398afa56d21ea97d55f0 100644
|
||||
index 8633fdfa7e8aeac7414c232006fc298b3bfe1b58..eb12227b009b1fb766a5f9e338e5d2394d498376 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -116,21 +116,6 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@ -15685,7 +15685,7 @@ index 52b02cb1f02d1c65b840f38cfc8baee500aa2259..3294da27227b5a332904398afa56d21e
|
||||
public UnsupportedSettings unsupportedSettings;
|
||||
|
||||
public class UnsupportedSettings extends ConfigurationPart {
|
||||
@@ -274,4 +259,43 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -273,4 +258,43 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public boolean useDimensionTypeForCustomSpawners = false;
|
||||
public boolean strictAdvancementDimensionCheck = false;
|
||||
}
|
||||
|
@ -6,6 +6,10 @@ Subject: [PATCH] Use TerminalConsoleAppender for console improvements
|
||||
Rewrite console improvements (console colors, tab completion,
|
||||
persistent input line, ...) using JLine 3.x and TerminalConsoleAppender.
|
||||
|
||||
Also uses the new ANSIComponentSerializer to serialize components when
|
||||
logging them via the ComponentLogger, or when sending messages to the
|
||||
console, for hex color support.
|
||||
|
||||
New features:
|
||||
- Support console colors for Vanilla commands
|
||||
- Add console colors for warnings and errors
|
||||
@ -18,11 +22,13 @@ Other changes:
|
||||
- Server starts 1-2 seconds faster thanks to optimizations in Log4j
|
||||
configuration
|
||||
|
||||
Co-Authored-By: Emilia Kond <emilia@rymiel.space>
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index d8da21801eda8ea5d04c8eb2941bbef968cb7951..38c08ee8e935d3fdf5ad4e443352e3563609e3c0 100644
|
||||
index 9ab4d3e462c02e4d23b45adb46965eb75eb2178e..700be2fdc10d14222f06e482681bb3a2e9a0aee6 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -8,7 +8,17 @@ plugins {
|
||||
@@ -8,7 +8,19 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
implementation(project(":paper-api"))
|
||||
@ -30,6 +36,7 @@ index d8da21801eda8ea5d04c8eb2941bbef968cb7951..38c08ee8e935d3fdf5ad4e443352e356
|
||||
+ // Paper start
|
||||
+ implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
+ implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
+ implementation("net.kyori:adventure-text-serializer-ansi")
|
||||
+ /*
|
||||
+ Required to add the missing Log4j2Plugins.dat file from log4j-core
|
||||
+ which has been removed by Mojang. Without it, log4j has to classload
|
||||
@ -37,6 +44,7 @@ index d8da21801eda8ea5d04c8eb2941bbef968cb7951..38c08ee8e935d3fdf5ad4e443352e356
|
||||
+ Scanning takes about 1-2 seconds so adding this speeds up the server start.
|
||||
+ */
|
||||
+ runtimeOnly("org.apache.logging.log4j:log4j-core:2.14.1")
|
||||
+ annotationProcessor("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - Needed to generate meta for our Log4j plugins
|
||||
+ // Paper end
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
@ -90,29 +98,141 @@ index 0000000000000000000000000000000000000000..a4070b59e261f0f1ac4beec47b11492f
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..685deaa0e5d1ddc13e3a7c0471b1cfcf1710c869
|
||||
index 0000000000000000000000000000000000000000..8f07539a82f449ad217e316a7513a1708781fb63
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
|
||||
@@ -0,0 +1,17 @@
|
||||
@@ -0,0 +1,26 @@
|
||||
+package com.destroystokyo.paper.console;
|
||||
+
|
||||
+import net.kyori.adventure.audience.MessageType;
|
||||
+import net.kyori.adventure.identity.Identity;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
|
||||
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
+import org.apache.logging.log4j.LogManager;
|
||||
+import org.apache.logging.log4j.Logger;
|
||||
+import org.bukkit.craftbukkit.command.CraftConsoleCommandSender;
|
||||
+
|
||||
+public class TerminalConsoleCommandSender extends CraftConsoleCommandSender {
|
||||
+
|
||||
+ private static final Logger LOGGER = LogManager.getRootLogger();
|
||||
+ private static final ComponentLogger LOGGER = ComponentLogger.logger(LogManager.getRootLogger().getName());
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendRawMessage(String message) {
|
||||
+ // TerminalConsoleAppender supports color codes directly in log messages
|
||||
+ final Component msg = LegacyComponentSerializer.legacySection().deserialize(message);
|
||||
+ this.sendMessage(Identity.nil(), msg, MessageType.SYSTEM);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendMessage(Identity identity, Component message, MessageType type) {
|
||||
+ LOGGER.info(message);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
index 3dc613116c086444ece88bcb0a569eeea953074f..db54a9c32578defa02fa58dc694c96684a4885ac 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
@@ -20,6 +20,7 @@ import net.kyori.adventure.text.TranslatableComponent;
|
||||
import net.kyori.adventure.text.flattener.ComponentFlattener;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import net.kyori.adventure.text.serializer.ComponentSerializer;
|
||||
+import net.kyori.adventure.text.serializer.ansi.ANSIComponentSerializer;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
@@ -107,6 +108,9 @@ public final class PaperAdventure {
|
||||
public static final AttributeKey<Locale> LOCALE_ATTRIBUTE = AttributeKey.valueOf("adventure:locale"); // init after FLATTENER because classloading triggered here might create a logger
|
||||
@Deprecated
|
||||
public static final PlainComponentSerializer PLAIN = PlainComponentSerializer.builder().flattener(FLATTENER).build();
|
||||
+
|
||||
+ public static final ANSIComponentSerializer ANSI_SERIALIZER = ANSIComponentSerializer.builder().flattener(FLATTENER).build();
|
||||
+
|
||||
private static final Codec<CompoundTag, String, IOException, IOException> NBT_CODEC = new Codec<CompoundTag, String, IOException, IOException>() {
|
||||
@Override
|
||||
public @NotNull CompoundTag decode(final @NotNull String encoded) throws IOException {
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java b/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java
|
||||
index c3631efda9c7fa531a8a9f18fbee7b5f8655382b..769f6489632302627fa1730cc08e77f51eb54eb4 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java
|
||||
@@ -1,9 +1,11 @@
|
||||
package io.papermc.paper.adventure.providers;
|
||||
|
||||
import io.papermc.paper.adventure.PaperAdventure;
|
||||
+import java.util.Locale;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
|
||||
import net.kyori.adventure.text.logger.slf4j.ComponentLoggerProvider;
|
||||
+import net.kyori.adventure.translation.GlobalTranslator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -14,6 +16,6 @@ public class ComponentLoggerProviderImpl implements ComponentLoggerProvider {
|
||||
}
|
||||
|
||||
private String serialize(final Component message) {
|
||||
- return PaperAdventure.asPlain(message, null);
|
||||
+ return PaperAdventure.ANSI_SERIALIZER.serialize(GlobalTranslator.render(message, Locale.getDefault()));
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/console/StripANSIConverter.java b/src/main/java/io/papermc/paper/console/StripANSIConverter.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..91547f6e6fe90006713beb2818da634304bdd236
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/console/StripANSIConverter.java
|
||||
@@ -0,0 +1,51 @@
|
||||
+package io.papermc.paper.console;
|
||||
+
|
||||
+import org.apache.logging.log4j.core.LogEvent;
|
||||
+import org.apache.logging.log4j.core.config.Configuration;
|
||||
+import org.apache.logging.log4j.core.config.plugins.Plugin;
|
||||
+import org.apache.logging.log4j.core.layout.PatternLayout;
|
||||
+import org.apache.logging.log4j.core.pattern.ConverterKeys;
|
||||
+import org.apache.logging.log4j.core.pattern.LogEventPatternConverter;
|
||||
+import org.apache.logging.log4j.core.pattern.PatternConverter;
|
||||
+import org.apache.logging.log4j.core.pattern.PatternFormatter;
|
||||
+import org.apache.logging.log4j.core.pattern.PatternParser;
|
||||
+
|
||||
+import java.util.List;
|
||||
+import java.util.regex.Pattern;
|
||||
+
|
||||
+@Plugin(name = "stripAnsi", category = PatternConverter.CATEGORY)
|
||||
+@ConverterKeys({"stripAnsi"})
|
||||
+public final class StripANSIConverter extends LogEventPatternConverter {
|
||||
+ final private Pattern ANSI_PATTERN = Pattern.compile("\\e\\[[\\d;]*[^\\d;]");
|
||||
+
|
||||
+ private final List<PatternFormatter> formatters;
|
||||
+
|
||||
+ private StripANSIConverter(List<PatternFormatter> formatters) {
|
||||
+ super("stripAnsi", null);
|
||||
+ this.formatters = formatters;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void format(LogEvent event, StringBuilder toAppendTo) {
|
||||
+ int start = toAppendTo.length();
|
||||
+ for (PatternFormatter formatter : formatters) {
|
||||
+ formatter.format(event, toAppendTo);
|
||||
+ }
|
||||
+ String content = toAppendTo.substring(start);
|
||||
+ content = ANSI_PATTERN.matcher(content).replaceAll("");
|
||||
+
|
||||
+ toAppendTo.setLength(start);
|
||||
+ toAppendTo.append(content);
|
||||
+ }
|
||||
+
|
||||
+ public static StripANSIConverter newInstance(Configuration config, String[] options) {
|
||||
+ if (options.length != 1) {
|
||||
+ LOGGER.error("Incorrect number of options on stripAnsi. Expected exactly 1, received " + options.length);
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ PatternParser parser = PatternLayout.createPatternParser(config);
|
||||
+ List<PatternFormatter> formatters = parser.parse(options[0]);
|
||||
+ return new StripANSIConverter(formatters);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 79b4139b653a09142e1b624849ad7c529c35450d..bc96a5c546c01b092f513f202e833b7b5f320e72 100644
|
||||
index 79b4139b653a09142e1b624849ad7c529c35450d..54108afdf1f88f8d9056b744ee9b0d3ebf009fcb 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -165,7 +165,7 @@ import com.mojang.datafixers.util.Pair;
|
||||
@ -166,7 +286,7 @@ index 79b4139b653a09142e1b624849ad7c529c35450d..bc96a5c546c01b092f513f202e833b7b
|
||||
@Override
|
||||
public void sendSystemMessage(Component message) {
|
||||
- MinecraftServer.LOGGER.info(message.getString());
|
||||
+ MinecraftServer.LOGGER.info(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(io.papermc.paper.adventure.PaperAdventure.asAdventure(message))); // Paper - Log message with colors
|
||||
+ MinecraftServer.LOGGER.info(io.papermc.paper.adventure.PaperAdventure.ANSI_SERIALIZER.serialize(io.papermc.paper.adventure.PaperAdventure.asAdventure(message))); // Paper - Log message with colors
|
||||
}
|
||||
|
||||
public KeyPair getKeyPair() {
|
||||
@ -221,6 +341,19 @@ index 81a0a897a1fd2a408bfe43f24ed5e5f4bbefe161..24f62f9c4d288297d7a324e806745cc1
|
||||
|
||||
System.setOut(IoBuilder.forLogger(logger).setLevel(Level.INFO).buildPrintStream());
|
||||
System.setErr(IoBuilder.forLogger(logger).setLevel(Level.WARN).buildPrintStream());
|
||||
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
index 75083eeb9b413e6dd5375007360dce6857a08fff..d292fdb165436f0b9b46b32110f5e09ad0e517a1 100644
|
||||
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
+++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -166,7 +166,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
this.finalizers.forEach(Runnable::run);
|
||||
}
|
||||
|
||||
- private static final java.util.regex.Pattern ANSI = java.util.regex.Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})*)?[m|K]"); // CraftBukkit
|
||||
+ private static final java.util.regex.Pattern ANSI = java.util.regex.Pattern.compile("\\e\\[[\\d;]*[^\\d;]"); // CraftBukkit // Paper
|
||||
public void print(JTextArea textArea, JScrollPane scrollPane, String message) {
|
||||
if (!SwingUtilities.isEventDispatchThread()) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index a9cab02b97f85fec31ad636f7a340066d409be36..03ea44619bc3445956f3e4539fc0e2923a29a92d 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@ -478,7 +611,7 @@ index 0000000000000000000000000000000000000000..0694b21465fb9e4164e71862ff24b622
|
||||
@@ -0,0 +1 @@
|
||||
+log4j.skipJansi=true
|
||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||
index 722ca84968cbbbdeffd09939abff0cccd0a84010..620b9490e5f159080e50289d127404a1b56adbef 100644
|
||||
index 722ca84968cbbbdeffd09939abff0cccd0a84010..a994ec0f8621b1f267b40049306f63479c050e2f 100644
|
||||
--- a/src/main/resources/log4j2.xml
|
||||
+++ b/src/main/resources/log4j2.xml
|
||||
@@ -1,17 +1,14 @@
|
||||
@ -495,11 +628,11 @@ index 722ca84968cbbbdeffd09939abff0cccd0a84010..620b9490e5f159080e50289d127404a1
|
||||
- <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||
- </Queue>
|
||||
+ <TerminalConsole name="TerminalConsole">
|
||||
+ <PatternLayout pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx}" />
|
||||
+ <PatternLayout pattern="%highlightError{[%d{HH:mm:ss} %level]: %msg%n%xEx}" />
|
||||
+ </TerminalConsole>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
- <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||
+ <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n" />
|
||||
+ <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %stripAnsi{%msg}%n" />
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy />
|
||||
<OnStartupTriggeringPolicy />
|
||||
|
@ -15,18 +15,18 @@ This may cause additional prefixes to be disabled for plugins bypassing
|
||||
the plugin logger.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 38c08ee8e935d3fdf5ad4e443352e3563609e3c0..97f1a5bafdd1f520fee5f31fda87b4c251aea33f 100644
|
||||
index 700be2fdc10d14222f06e482681bb3a2e9a0aee6..5524d44f8b97480bce3ed5ec7e154aae1fb13a2d 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -17,7 +17,7 @@ dependencies {
|
||||
@@ -18,7 +18,7 @@ dependencies {
|
||||
all its classes to check if they are plugins.
|
||||
Scanning takes about 1-2 seconds so adding this speeds up the server start.
|
||||
*/
|
||||
- runtimeOnly("org.apache.logging.log4j:log4j-core:2.14.1")
|
||||
+ implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation
|
||||
annotationProcessor("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - Needed to generate meta for our Log4j plugins
|
||||
// Paper end
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
index 0a0aa6de31a94a701074cc5f43c94be7515a185c..489ce6f439778b26eb33ede9432681d4bf9e0116 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
@ -41,29 +41,29 @@ index 0a0aa6de31a94a701074cc5f43c94be7515a185c..489ce6f439778b26eb33ede9432681d4
|
||||
|
||||
public static int playerShuffle;
|
||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||
index 620b9490e5f159080e50289d127404a1b56adbef..a8bdaaeaa1a9316848416f0533739b9b083ca151 100644
|
||||
index a994ec0f8621b1f267b40049306f63479c050e2f..bba2de3f3feb5e6a876f9df1eee6da0c7d93e271 100644
|
||||
--- a/src/main/resources/log4j2.xml
|
||||
+++ b/src/main/resources/log4j2.xml
|
||||
@@ -5,10 +5,22 @@
|
||||
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
|
||||
</Queue>
|
||||
<TerminalConsole name="TerminalConsole">
|
||||
- <PatternLayout pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx}" />
|
||||
- <PatternLayout pattern="%highlightError{[%d{HH:mm:ss} %level]: %msg%n%xEx}" />
|
||||
+ <PatternLayout>
|
||||
+ <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %minecraftFormatting{%msg}%n%xEx}">
|
||||
+ <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %msg%n%xEx}">
|
||||
+ <!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
|
||||
+ <PatternMatch key=",net.minecraft.,Minecraft,com.mojang."
|
||||
+ pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx}" />
|
||||
+ pattern="%highlightError{[%d{HH:mm:ss} %level]: %msg%n%xEx}" />
|
||||
+ </LoggerNamePatternSelector>
|
||||
+ </PatternLayout>
|
||||
</TerminalConsole>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
- <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n" />
|
||||
- <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %stripAnsi{%msg}%n" />
|
||||
+ <PatternLayout>
|
||||
+ <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %minecraftFormatting{%msg}{strip}%n">
|
||||
+ <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %stripAnsi{%msg}%n">
|
||||
+ <!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
|
||||
+ <PatternMatch key=",net.minecraft.,Minecraft,com.mojang."
|
||||
+ pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n" />
|
||||
+ pattern="[%d{HH:mm:ss}] [%t/%level]: %stripAnsi{%msg}%n" />
|
||||
+ </LoggerNamePatternSelector>
|
||||
+ </PatternLayout>
|
||||
<Policies>
|
||||
|
@ -14,34 +14,34 @@ log. Disable the logger prefix for these plugins so the messages
|
||||
show up correctly.
|
||||
|
||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||
index a8bdaaeaa1a9316848416f0533739b9b083ca151..476f4a5cbe664ddd05474cb88553018bd334a5b8 100644
|
||||
index bba2de3f3feb5e6a876f9df1eee6da0c7d93e271..88957220d5574e5590e8a545605d76c0c7b0a10e 100644
|
||||
--- a/src/main/resources/log4j2.xml
|
||||
+++ b/src/main/resources/log4j2.xml
|
||||
@@ -6,19 +6,21 @@
|
||||
</Queue>
|
||||
<TerminalConsole name="TerminalConsole">
|
||||
<PatternLayout>
|
||||
- <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %minecraftFormatting{%msg}%n%xEx}">
|
||||
+ <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %minecraftFormatting{%msg}%n%xEx{full}}">
|
||||
- <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %msg%n%xEx}">
|
||||
+ <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %msg%n%xEx{full}}">
|
||||
<!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
|
||||
- <PatternMatch key=",net.minecraft.,Minecraft,com.mojang."
|
||||
- pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx}" />
|
||||
- pattern="%highlightError{[%d{HH:mm:ss} %level]: %msg%n%xEx}" />
|
||||
+ <!-- Disable prefix for various plugins that bypass the plugin logger -->
|
||||
+ <PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE"
|
||||
+ pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx{full}}" />
|
||||
+ pattern="%highlightError{[%d{HH:mm:ss} %level]: %msg%n%xEx{full}}" />
|
||||
</LoggerNamePatternSelector>
|
||||
</PatternLayout>
|
||||
</TerminalConsole>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<PatternLayout>
|
||||
- <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %minecraftFormatting{%msg}{strip}%n">
|
||||
+ <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %minecraftFormatting{%msg}{strip}%n%xEx{full}">
|
||||
- <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %stripAnsi{%msg}%n">
|
||||
+ <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %stripAnsi{%msg}%n%xEx{full}">
|
||||
<!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
|
||||
- <PatternMatch key=",net.minecraft.,Minecraft,com.mojang."
|
||||
- pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n" />
|
||||
- pattern="[%d{HH:mm:ss}] [%t/%level]: %stripAnsi{%msg}%n" />
|
||||
+ <!-- Disable prefix for various plugins that bypass the plugin logger -->
|
||||
+ <PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE"
|
||||
+ pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n%xEx{full}" />
|
||||
+ pattern="[%d{HH:mm:ss}] [%t/%level]: %stripAnsi{%msg}%n%xEx{full}" />
|
||||
</LoggerNamePatternSelector>
|
||||
</PatternLayout>
|
||||
<Policies>
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 97f1a5bafdd1f520fee5f31fda87b4c251aea33f..41485437cdf438cfb837a9fcd276c2dd70b84b42 100644
|
||||
index 5524d44f8b97480bce3ed5ec7e154aae1fb13a2d..02f26dd4a4a75ca35a124ab2e6e426e72121f55b 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -27,6 +27,7 @@ dependencies {
|
||||
@@ -29,6 +29,7 @@ dependencies {
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.0.33")
|
||||
@ -17,7 +17,7 @@ index 97f1a5bafdd1f520fee5f31fda87b4c251aea33f..41485437cdf438cfb837a9fcd276c2dd
|
||||
runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.2")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10")
|
||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||
index 476f4a5cbe664ddd05474cb88553018bd334a5b8..3dc317e466e1b93dff030794dd7f29ca1b266778 100644
|
||||
index 88957220d5574e5590e8a545605d76c0c7b0a10e..ea4e2161c0bd43884055cc6b8d70b2139f70e720 100644
|
||||
--- a/src/main/resources/log4j2.xml
|
||||
+++ b/src/main/resources/log4j2.xml
|
||||
@@ -29,15 +29,18 @@
|
||||
|
@ -6,18 +6,10 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 9617477e8ef0ef5b1af4733ce4e87ddd796a7be2..e6731ada5a7f0f66322fd958f6244b3d5b8887bf 100644
|
||||
index 9183b71f6ca78b4a3bc7d804f8d9c4c6db65d5cc..f1fd98bd3d39b4c34043b269e8c43cff073f2726 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -19,6 +19,7 @@ dependencies {
|
||||
Scanning takes about 1-2 seconds so adding this speeds up the server start.
|
||||
*/
|
||||
implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation
|
||||
+ annotationProcessor("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - Needed to generate meta for our Log4j plugins
|
||||
// Paper end
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
@@ -26,6 +27,7 @@ dependencies {
|
||||
@@ -28,6 +28,7 @@ dependencies {
|
||||
testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
|
||||
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
@ -25,7 +17,7 @@ index 9617477e8ef0ef5b1af4733ce4e87ddd796a7be2..e6731ada5a7f0f66322fd958f6244b3d
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.0.33")
|
||||
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
@@ -105,6 +107,18 @@ tasks.check {
|
||||
@@ -107,6 +108,18 @@ tasks.check {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@ -504,7 +496,7 @@ index 5308f016baf3001ffd1468633cde446493ca581e..1b6d090afea5b0a49b601b73cefeedc0
|
||||
|
||||
protected void channelRead0(ChannelHandlerContext channelhandlercontext, Packet<?> packet) {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 71b395db734c257a64ec3297eebbe52883ea4cc7..072888f891c8e25a2b4daaf561e124930df2be1e 100644
|
||||
index aaad6b0de19872c6e54591adf90c30d2c2ed5223..6a4c7783146ff6b6703e9ae814134a8d1086cf7f 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -195,6 +195,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@ -643,7 +635,7 @@ index 383c52c62f49b17db2fbf58009d6ea132d124bea..e0a71bfc1498a517456b21747ab6ef3f
|
||||
log.log( Level.SEVERE, "\t\t" + stack );
|
||||
}
|
||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||
index d285dbec16272db6b8a71865e05924ad66087407..1a05d23ff886b015fb9396f119822c678a47ec6f 100644
|
||||
index 266b4e6fb3988b5848021c83fdc68e342c70b188..2b247d55e39246fbef31279b14c45fc40f956bfb 100644
|
||||
--- a/src/main/resources/log4j2.xml
|
||||
+++ b/src/main/resources/log4j2.xml
|
||||
@@ -30,10 +30,14 @@
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Implement Mob Goal API
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index e6731ada5a7f0f66322fd958f6244b3d5b8887bf..f57bd7863e90afb461158ab54ce4e3bcd6deb6cf 100644
|
||||
index f1fd98bd3d39b4c34043b269e8c43cff073f2726..b65278b9addf9a26b0f63975f439d333fd3fdf87 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -36,6 +36,7 @@ dependencies {
|
||||
@@ -37,6 +37,7 @@ dependencies {
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10")
|
||||
|
||||
|
@ -1,327 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Roy <10731363+JRoy@users.noreply.github.com>
|
||||
Date: Sat, 20 Feb 2021 13:09:59 -0500
|
||||
Subject: [PATCH] Add support for hex color codes in console
|
||||
|
||||
Converts upstream's hex color code legacy format into actual hex color codes in the console.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
|
||||
index 685deaa0e5d1ddc13e3a7c0471b1cfcf1710c869..8f07539a82f449ad217e316a7513a1708781fb63 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
|
||||
@@ -1,16 +1,25 @@
|
||||
package com.destroystokyo.paper.console;
|
||||
|
||||
+import net.kyori.adventure.audience.MessageType;
|
||||
+import net.kyori.adventure.identity.Identity;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
|
||||
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
-import org.apache.logging.log4j.Logger;
|
||||
import org.bukkit.craftbukkit.command.CraftConsoleCommandSender;
|
||||
|
||||
public class TerminalConsoleCommandSender extends CraftConsoleCommandSender {
|
||||
|
||||
- private static final Logger LOGGER = LogManager.getRootLogger();
|
||||
+ private static final ComponentLogger LOGGER = ComponentLogger.logger(LogManager.getRootLogger().getName());
|
||||
|
||||
@Override
|
||||
public void sendRawMessage(String message) {
|
||||
- // TerminalConsoleAppender supports color codes directly in log messages
|
||||
+ final Component msg = LegacyComponentSerializer.legacySection().deserialize(message);
|
||||
+ this.sendMessage(Identity.nil(), msg, MessageType.SYSTEM);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendMessage(Identity identity, Component message, MessageType type) {
|
||||
LOGGER.info(message);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java b/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java
|
||||
index c3631efda9c7fa531a8a9f18fbee7b5f8655382b..9a3c1314d5a0aa20380662595359580b1a97be89 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java
|
||||
@@ -1,9 +1,11 @@
|
||||
package io.papermc.paper.adventure.providers;
|
||||
|
||||
-import io.papermc.paper.adventure.PaperAdventure;
|
||||
+import io.papermc.paper.console.HexFormattingConverter;
|
||||
+import java.util.Locale;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
|
||||
import net.kyori.adventure.text.logger.slf4j.ComponentLoggerProvider;
|
||||
+import net.kyori.adventure.translation.GlobalTranslator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -14,6 +16,6 @@ public class ComponentLoggerProviderImpl implements ComponentLoggerProvider {
|
||||
}
|
||||
|
||||
private String serialize(final Component message) {
|
||||
- return PaperAdventure.asPlain(message, null);
|
||||
+ return HexFormattingConverter.SERIALIZER.serialize(GlobalTranslator.render(message, Locale.getDefault()));
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/console/HexFormattingConverter.java b/src/main/java/io/papermc/paper/console/HexFormattingConverter.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b9922b07cb105618390187d98acdf89e728e1f5a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/console/HexFormattingConverter.java
|
||||
@@ -0,0 +1,213 @@
|
||||
+package io.papermc.paper.console;
|
||||
+
|
||||
+import io.papermc.paper.configuration.GlobalConfiguration;
|
||||
+import io.papermc.paper.adventure.PaperAdventure;
|
||||
+import net.kyori.adventure.text.format.NamedTextColor;
|
||||
+import net.kyori.adventure.text.format.TextColor;
|
||||
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
+import net.minecrell.terminalconsole.TerminalConsoleAppender;
|
||||
+import org.apache.logging.log4j.core.LogEvent;
|
||||
+import org.apache.logging.log4j.core.config.Configuration;
|
||||
+import org.apache.logging.log4j.core.config.plugins.Plugin;
|
||||
+import org.apache.logging.log4j.core.layout.PatternLayout;
|
||||
+import org.apache.logging.log4j.core.pattern.ConverterKeys;
|
||||
+import org.apache.logging.log4j.core.pattern.LogEventPatternConverter;
|
||||
+import org.apache.logging.log4j.core.pattern.PatternConverter;
|
||||
+import org.apache.logging.log4j.core.pattern.PatternFormatter;
|
||||
+import org.apache.logging.log4j.core.pattern.PatternParser;
|
||||
+import org.apache.logging.log4j.util.PerformanceSensitive;
|
||||
+import org.apache.logging.log4j.util.PropertiesUtil;
|
||||
+
|
||||
+import java.util.List;
|
||||
+import java.util.regex.Matcher;
|
||||
+import java.util.regex.Pattern;
|
||||
+
|
||||
+import static net.minecrell.terminalconsole.MinecraftFormattingConverter.KEEP_FORMATTING_PROPERTY;
|
||||
+
|
||||
+/**
|
||||
+ * Modified version of <a href="https://github.com/Minecrell/TerminalConsoleAppender/blob/master/src/main/java/net/minecrell/terminalconsole/MinecraftFormattingConverter.java">
|
||||
+ * TerminalConsoleAppender's MinecraftFormattingConverter</a> to support hex color codes using the Adventure [char]#rrggbb format.
|
||||
+ */
|
||||
+@Plugin(name = "paperMinecraftFormatting", category = PatternConverter.CATEGORY)
|
||||
+@ConverterKeys({"paperMinecraftFormatting"})
|
||||
+@PerformanceSensitive("allocation")
|
||||
+public final class HexFormattingConverter extends LogEventPatternConverter {
|
||||
+
|
||||
+ private static final boolean KEEP_FORMATTING = PropertiesUtil.getProperties().getBooleanProperty(KEEP_FORMATTING_PROPERTY);
|
||||
+
|
||||
+ private static final String ANSI_RESET = "\u001B[m";
|
||||
+
|
||||
+ private static final char COLOR_CHAR = 0x7f;
|
||||
+ public static final LegacyComponentSerializer SERIALIZER = LegacyComponentSerializer.builder()
|
||||
+ .hexColors()
|
||||
+ .flattener(PaperAdventure.FLATTENER)
|
||||
+ .character(HexFormattingConverter.COLOR_CHAR)
|
||||
+ .build();
|
||||
+ private static final String LOOKUP = "0123456789abcdefklmnor";
|
||||
+
|
||||
+ private static final String RGB_ANSI = "\u001B[38;2;%d;%d;%dm";
|
||||
+ private static final String RESET_RGB_ANSI = ANSI_RESET + RGB_ANSI;
|
||||
+ private static final Pattern NAMED_PATTERN = Pattern.compile(COLOR_CHAR + "[0-9a-fk-orA-FK-OR]");
|
||||
+ private static final Pattern RGB_PATTERN = Pattern.compile(COLOR_CHAR + "#([0-9a-fA-F]){6}");
|
||||
+
|
||||
+ private static final String[] RGB_ANSI_CODES = new String[]{
|
||||
+ formatHexAnsi(NamedTextColor.BLACK), // Black §0
|
||||
+ formatHexAnsi(NamedTextColor.DARK_BLUE), // Dark Blue §1
|
||||
+ formatHexAnsi(NamedTextColor.DARK_GREEN), // Dark Green §2
|
||||
+ formatHexAnsi(NamedTextColor.DARK_AQUA), // Dark Aqua §3
|
||||
+ formatHexAnsi(NamedTextColor.DARK_RED), // Dark Red §4
|
||||
+ formatHexAnsi(NamedTextColor.DARK_PURPLE), // Dark Purple §5
|
||||
+ formatHexAnsi(NamedTextColor.GOLD), // Gold §6
|
||||
+ formatHexAnsi(NamedTextColor.GRAY), // Gray §7
|
||||
+ formatHexAnsi(NamedTextColor.DARK_GRAY), // Dark Gray §8
|
||||
+ formatHexAnsi(NamedTextColor.BLUE), // Blue §9
|
||||
+ formatHexAnsi(NamedTextColor.GREEN), // Green §a
|
||||
+ formatHexAnsi(NamedTextColor.AQUA), // Aqua §b
|
||||
+ formatHexAnsi(NamedTextColor.RED), // Red §c
|
||||
+ formatHexAnsi(NamedTextColor.LIGHT_PURPLE), // Light Purple §d
|
||||
+ formatHexAnsi(NamedTextColor.YELLOW), // Yellow §e
|
||||
+ formatHexAnsi(NamedTextColor.WHITE), // White §f
|
||||
+ "\u001B[5m", // Obfuscated §k
|
||||
+ "\u001B[1m", // Bold §l
|
||||
+ "\u001B[9m", // Strikethrough §m
|
||||
+ "\u001B[4m", // Underline §n
|
||||
+ "\u001B[3m", // Italic §o
|
||||
+ ANSI_RESET, // Reset §r
|
||||
+ };
|
||||
+ private static final String[] ANSI_ANSI_CODES = new String[]{
|
||||
+ ANSI_RESET + "\u001B[0;30m", // Black §0
|
||||
+ ANSI_RESET + "\u001B[0;34m", // Dark Blue §1
|
||||
+ ANSI_RESET + "\u001B[0;32m", // Dark Green §2
|
||||
+ ANSI_RESET + "\u001B[0;36m", // Dark Aqua §3
|
||||
+ ANSI_RESET + "\u001B[0;31m", // Dark Red §4
|
||||
+ ANSI_RESET + "\u001B[0;35m", // Dark Purple §5
|
||||
+ ANSI_RESET + "\u001B[0;33m", // Gold §6
|
||||
+ ANSI_RESET + "\u001B[0;37m", // Gray §7
|
||||
+ ANSI_RESET + "\u001B[0;30;1m", // Dark Gray §8
|
||||
+ ANSI_RESET + "\u001B[0;34;1m", // Blue §9
|
||||
+ ANSI_RESET + "\u001B[0;32;1m", // Green §a
|
||||
+ ANSI_RESET + "\u001B[0;36;1m", // Aqua §b
|
||||
+ ANSI_RESET + "\u001B[0;31;1m", // Red §c
|
||||
+ ANSI_RESET + "\u001B[0;35;1m", // Light Purple §d
|
||||
+ ANSI_RESET + "\u001B[0;33;1m", // Yellow §e
|
||||
+ ANSI_RESET + "\u001B[0;37;1m", // White §f
|
||||
+ "\u001B[5m", // Obfuscated §k
|
||||
+ "\u001B[1m", // Bold §l
|
||||
+ "\u001B[9m", // Strikethrough §m
|
||||
+ "\u001B[4m", // Underline §n
|
||||
+ "\u001B[3m", // Italic §o
|
||||
+ ANSI_RESET, // Reset §r
|
||||
+ };
|
||||
+
|
||||
+ private final boolean ansi;
|
||||
+ private final List<PatternFormatter> formatters;
|
||||
+
|
||||
+ /**
|
||||
+ * Construct the converter.
|
||||
+ *
|
||||
+ * @param formatters The pattern formatters to generate the text to manipulate
|
||||
+ * @param strip If true, the converter will strip all formatting codes
|
||||
+ */
|
||||
+ protected HexFormattingConverter(List<PatternFormatter> formatters, boolean strip) {
|
||||
+ super("paperMinecraftFormatting", null);
|
||||
+ this.formatters = formatters;
|
||||
+ this.ansi = !strip;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void format(LogEvent event, StringBuilder toAppendTo) {
|
||||
+ int start = toAppendTo.length();
|
||||
+ //noinspection ForLoopReplaceableByForEach
|
||||
+ for (int i = 0, size = formatters.size(); i < size; i++) {
|
||||
+ formatters.get(i).format(event, toAppendTo);
|
||||
+ }
|
||||
+
|
||||
+ if (KEEP_FORMATTING || toAppendTo.length() == start) {
|
||||
+ // Skip replacement if disabled or if the content is empty
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ boolean useAnsi = ansi && TerminalConsoleAppender.isAnsiSupported();
|
||||
+ String content = toAppendTo.substring(start);
|
||||
+ content = useAnsi ? convertRGBColors(content) : stripRGBColors(content);
|
||||
+ format(content, toAppendTo, start, useAnsi);
|
||||
+ }
|
||||
+
|
||||
+ private static String convertRGBColors(final String input) {
|
||||
+ return RGB_PATTERN.matcher(input).replaceAll(result -> {
|
||||
+ final int hex = Integer.decode(result.group().substring(1));
|
||||
+ return formatHexAnsi(hex);
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ private static String formatHexAnsi(final TextColor color) {
|
||||
+ return formatHexAnsi(color.value());
|
||||
+ }
|
||||
+
|
||||
+ private static String formatHexAnsi(final int color) {
|
||||
+ final int red = color >> 16 & 0xFF;
|
||||
+ final int green = color >> 8 & 0xFF;
|
||||
+ final int blue = color & 0xFF;
|
||||
+ return String.format(RESET_RGB_ANSI, red, green, blue);
|
||||
+ }
|
||||
+
|
||||
+ private static String stripRGBColors(final String input) {
|
||||
+ return RGB_PATTERN.matcher(input).replaceAll("");
|
||||
+ }
|
||||
+
|
||||
+ static void format(String content, StringBuilder result, int start, boolean ansi) {
|
||||
+ int next = content.indexOf(COLOR_CHAR);
|
||||
+ int last = content.length() - 1;
|
||||
+ if (next == -1 || next == last) {
|
||||
+ result.setLength(start);
|
||||
+ result.append(content);
|
||||
+ if (ansi) {
|
||||
+ result.append(ANSI_RESET);
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ Matcher matcher = NAMED_PATTERN.matcher(content);
|
||||
+ StringBuilder buffer = new StringBuilder();
|
||||
+ final String[] ansiCodes = GlobalConfiguration.get().logging.useRgbForNamedTextColors ? RGB_ANSI_CODES : ANSI_ANSI_CODES;
|
||||
+ while (matcher.find()) {
|
||||
+ int format = LOOKUP.indexOf(Character.toLowerCase(matcher.group().charAt(1)));
|
||||
+ if (format != -1) {
|
||||
+ matcher.appendReplacement(buffer, ansi ? ansiCodes[format] : "");
|
||||
+ }
|
||||
+ }
|
||||
+ matcher.appendTail(buffer);
|
||||
+
|
||||
+ result.setLength(start);
|
||||
+ result.append(buffer);
|
||||
+ if (ansi) {
|
||||
+ result.append(ANSI_RESET);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets a new instance of the {@link HexFormattingConverter} with the
|
||||
+ * specified options.
|
||||
+ *
|
||||
+ * @param config The current configuration
|
||||
+ * @param options The pattern options
|
||||
+ * @return The new instance
|
||||
+ * @see HexFormattingConverter
|
||||
+ */
|
||||
+ public static HexFormattingConverter newInstance(Configuration config, String[] options) {
|
||||
+ if (options.length < 1 || options.length > 2) {
|
||||
+ LOGGER.error("Incorrect number of options on paperMinecraftFormatting. Expected at least 1, max 2 received " + options.length);
|
||||
+ return null;
|
||||
+ }
|
||||
+ if (options[0] == null) {
|
||||
+ LOGGER.error("No pattern supplied on paperMinecraftFormatting");
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ PatternParser parser = PatternLayout.createPatternParser(config);
|
||||
+ List<PatternFormatter> formatters = parser.parse(options[0]);
|
||||
+ boolean strip = options.length > 1 && "strip".equals(options[1]);
|
||||
+ return new HexFormattingConverter(formatters, strip);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 5ac5937c72286d96c394a4da90cbc4436e22ed59..607651ca570483e98786aded8986a535301f3e80 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1706,7 +1706,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@Override
|
||||
public void sendSystemMessage(Component message) {
|
||||
- MinecraftServer.LOGGER.info(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(io.papermc.paper.adventure.PaperAdventure.asAdventure(message))); // Paper - Log message with colors
|
||||
+ MinecraftServer.LOGGER.info(io.papermc.paper.console.HexFormattingConverter.SERIALIZER.serialize(io.papermc.paper.adventure.PaperAdventure.asAdventure(message))); // Paper - Log message with colors
|
||||
}
|
||||
|
||||
public KeyPair getKeyPair() {
|
||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||
index 1a05d23ff886b015fb9396f119822c678a47ec6f..2e421eaac80cf251b32e0bb504dd54a73edf4986 100644
|
||||
--- a/src/main/resources/log4j2.xml
|
||||
+++ b/src/main/resources/log4j2.xml
|
||||
@@ -6,21 +6,21 @@
|
||||
</Queue>
|
||||
<TerminalConsole name="TerminalConsole">
|
||||
<PatternLayout>
|
||||
- <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %minecraftFormatting{%msg}%n%xEx{full}}">
|
||||
+ <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level]: [%logger] %paperMinecraftFormatting{%msg}%n%xEx{full}}">
|
||||
<!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
|
||||
<!-- Disable prefix for various plugins that bypass the plugin logger -->
|
||||
<PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE"
|
||||
- pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx{full}}" />
|
||||
+ pattern="%highlightError{[%d{HH:mm:ss} %level]: %paperMinecraftFormatting{%msg}%n%xEx{full}}" />
|
||||
</LoggerNamePatternSelector>
|
||||
</PatternLayout>
|
||||
</TerminalConsole>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<PatternLayout>
|
||||
- <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %minecraftFormatting{%msg}{strip}%n%xEx{full}">
|
||||
+ <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level]: [%logger] %paperMinecraftFormatting{%msg}{strip}%n%xEx{full}">
|
||||
<!-- Log root, Minecraft, Mojang and Bukkit loggers without prefix -->
|
||||
<!-- Disable prefix for various plugins that bypass the plugin logger -->
|
||||
<PatternMatch key=",net.minecraft.,Minecraft,com.mojang.,com.sk89q.,ru.tehkode.,Minecraft.AWE"
|
||||
- pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n%xEx{full}" />
|
||||
+ pattern="[%d{HH:mm:ss}] [%t/%level]: %paperMinecraftFormatting{%msg}{strip}%n%xEx{full}" />
|
||||
</LoggerNamePatternSelector>
|
||||
</PatternLayout>
|
||||
<Policies>
|
@ -39,7 +39,7 @@ index 23239679d6584f1088b2b94c46eb9a5c1f9ad91d..fa56cd09102a89692b42f1d142579905
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
index 66464c10a6b33414c6d1b67b926a66c343d5f887..c07918aa1ed2469ad7a76a0add60ab648ff7f421 100644
|
||||
index 2e93eec8733c5b548a15269a322fe4dd1f189b7d..dd9f611efc95f7d06fd3011fedd5d0317b1d0a85 100644
|
||||
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
+++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -59,6 +59,15 @@ public class MinecraftServerGui extends JComponent {
|
@ -21,7 +21,7 @@ index a20d47f54f12dfc0a5f76dd969238e34c958b618..935dac757280731bfeb0a8f033cbe315
|
||||
this.saveUserBanList();
|
||||
this.loadIpBanList();
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 6c1db5d6bf11184205073a4ce755e7f4e987643a..01e67001435dfa74062fda386072c552b39f2377 100644
|
||||
index 1ffd3854239862414e6ceecf2764ba3d6bd7942a..030b6e33fe80f6c50c473dbaa8f9aa9d4384a6b2 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -198,6 +198,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@ -5,7 +5,7 @@ Subject: [PATCH] Allow using signs inside spawn protection
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index df9d65167346152d9c589e3072e3d3d6882db5c6..6c695a80b1e175a6207a89c3f38e6c5faa3742e6 100644
|
||||
index ad19b3870fcc8ebd20fe429de3123731a0c2df07..fa808d6e3288996fab06e4b577957185e0009bce 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1826,7 +1826,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -5,7 +5,7 @@ Subject: [PATCH] forced whitelist: use configurable kick message
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 607651ca570483e98786aded8986a535301f3e80..cd531eff22742cff16ce4888853cba53861792dd 100644
|
||||
index 34658ffabd88abbc84bfc19f44c9cd391f2cb1bb..b3f04bb7afee65584566591b302feb8dfa850e87 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2150,7 +2150,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 6c695a80b1e175a6207a89c3f38e6c5faa3742e6..7eb9ddbdb1c2a57674f4ca91e0bda88e42f364ed 100644
|
||||
index fa808d6e3288996fab06e4b577957185e0009bce..4495dcbf340fb7a89060b0836a7e2b0cca4bc2b4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1290,7 +1290,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -208,7 +208,7 @@ index 0000000000000000000000000000000000000000..dd9d77d7c7f1a5a130a1f4c15e5b1e68
|
||||
+ public void setErrorIndex(final int errorIndex) {}
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 01e67001435dfa74062fda386072c552b39f2377..6c159945384586e9dbed871d180ae55f1e83e56a 100644
|
||||
index 030b6e33fe80f6c50c473dbaa8f9aa9d4384a6b2..3f230a32346d6923a9fe4c2311142fbf4b088373 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -173,7 +173,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@ -5,7 +5,7 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 7eb9ddbdb1c2a57674f4ca91e0bda88e42f364ed..4f4b6348da714854fc87ed992d16ff567a5690aa 100644
|
||||
index 4495dcbf340fb7a89060b0836a7e2b0cca4bc2b4..7451b61d28c22555619a80b741744b376d92ce58 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2040,6 +2040,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..dd6012b6a097575b2d1471be5069ecce
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 6c159945384586e9dbed871d180ae55f1e83e56a..91ed7311d365c9134c9a2598ca5ed9f94263b6e9 100644
|
||||
index 3f230a32346d6923a9fe4c2311142fbf4b088373..75c0ea2a59963334555efa1af03693fdff0fac32 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -209,6 +209,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
@ -5,7 +5,7 @@ Subject: [PATCH] add RespawnFlags to PlayerRespawnEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4f4b6348da714854fc87ed992d16ff567a5690aa..d27eeef0cfeda8de66710f7b3ca1b9056270fea4 100644
|
||||
index 7451b61d28c22555619a80b741744b376d92ce58..b3a75c6c1639b756084fb880ec085dd3541adcb4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2780,7 +2780,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -131,7 +131,7 @@ index 43221bf57fb4eeb70823c12b48f4df0bb817eb0b..e903371b370034f6447c5f23562fe5c9
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index d27eeef0cfeda8de66710f7b3ca1b9056270fea4..a4baf4e5cba66e0e5d9418ddf7ca8d612854f22e 100644
|
||||
index b3a75c6c1639b756084fb880ec085dd3541adcb4..3e825ec345fd1074e3ab7ec8549bd1bc7a8f3e8e 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2789,7 +2789,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -5,7 +5,7 @@ Subject: [PATCH] Move range check for block placing up
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index a4baf4e5cba66e0e5d9418ddf7ca8d612854f22e..2060f20a4da4c4005b8de03f82f497626f83d9b0 100644
|
||||
index 3e825ec345fd1074e3ab7ec8549bd1bc7a8f3e8e..aaeacc33183774aa3969aaff2e5304936f7041d4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1812,6 +1812,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -275,7 +275,7 @@ index 98385550084c9f975e494668961bac6ccb0700ab..1147044f2c4c2e9510cb6e5c38b6abe8
|
||||
Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit
|
||||
WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index cd531eff22742cff16ce4888853cba53861792dd..e1ca7910cb7c605e8aa175ff6b978e901f405f56 100644
|
||||
index b3f04bb7afee65584566591b302feb8dfa850e87..21d893bb1867aa5cae7924734a0e843d4c35aa94 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -554,11 +554,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@ -11,7 +11,7 @@ Tested-by: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
Reviewed-by: Mariell Hoversholm <proximyst@proximyst.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 91ed7311d365c9134c9a2598ca5ed9f94263b6e9..4757d6432631f0c5379597b40fda169ac7cd8621 100644
|
||||
index 75c0ea2a59963334555efa1af03693fdff0fac32..1fbe7a58707ddd40f80d71e3703ff3fefff672f4 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -219,6 +219,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@ -91,7 +91,7 @@ index 29a0a720f22f56ca3d844efef1ecde3980fb1c12..838244e3680ea6020701e10bafbde7f5
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 2060f20a4da4c4005b8de03f82f497626f83d9b0..707f0e0bdd3617fac987dacea36df6c363ca71ca 100644
|
||||
index aaeacc33183774aa3969aaff2e5304936f7041d4..1349efcfb368305d5437ec464a5f32a17177f0ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2624,6 +2624,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -36,7 +36,7 @@ index b5f54ee82905e3e6ab5bfde35ab625f5feeb1393..c0a80824a0307ea673805015119cc834
|
||||
|
||||
public boolean shouldDisconnect() {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index e1ca7910cb7c605e8aa175ff6b978e901f405f56..b800249823e413933a5d469e431a003f977f59e7 100644
|
||||
index 21d893bb1867aa5cae7924734a0e843d4c35aa94..76bdca305277d8d2a659b029f035bb4da25a076e 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2153,7 +2153,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@ -88,7 +88,7 @@ index c68bac4727f6b2ca95fc8c438303097af14286f2..bb629ec263959c8268de88ca807bddb6
|
||||
return Component.translatable("commands.kick.success", serverPlayer.getDisplayName(), reason);
|
||||
}, true);
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 707f0e0bdd3617fac987dacea36df6c363ca71ca..2f04823ef4143223ae1e1d108f9ff5721c575039 100644
|
||||
index 1349efcfb368305d5437ec464a5f32a17177f0ca..0a39701d26eb37504980c8a399c259f612e0286a 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -362,7 +362,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -5,7 +5,7 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 2f04823ef4143223ae1e1d108f9ff5721c575039..febb8df46cd2d82e9109366c78f8fc3452121cd3 100644
|
||||
index 0a39701d26eb37504980c8a399c259f612e0286a..81998223bcee27a489cdcc1bf3fb7a894718c478 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1209,7 +1209,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -5,7 +5,7 @@ Subject: [PATCH] Adds PlayerArmSwingEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index febb8df46cd2d82e9109366c78f8fc3452121cd3..54bbe187860c8aecd4da8bd3eb1c25c18b29dddf 100644
|
||||
index 81998223bcee27a489cdcc1bf3fb7a894718c478..4d2c3a03236e95283473e3290f5efe95f2a196bb 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2491,7 +2491,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -17,7 +17,7 @@ index dc134bfac4fb2bef6d99c7c88cb680d87808a5f7..62906422a96995ca4eac5a4d8ad2af30
|
||||
public boolean isRealPlayer; // Paper
|
||||
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 54bbe187860c8aecd4da8bd3eb1c25c18b29dddf..f0aa3519f90d00e5f1d3bcc3cd431f3c57744412 100644
|
||||
index 4d2c3a03236e95283473e3290f5efe95f2a196bb..8141d09c2b31053f0fbf3696dbc857d743873454 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -514,7 +514,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add config for mobs immune to default effects
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index c65aa2ed46ac8cef2306eb4035c7a0742a3e8b08..f82323c18792882dbbadc78a382dc7ffa9a4612f 100644
|
||||
index 62e8586d30950eed81868ccbb48212a426774da3..9cc26c870d3785c7ab798cf53f10ad8fd942bfb0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1164,7 +1164,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@ -230,7 +230,7 @@ index 0000000000000000000000000000000000000000..34734bb969a1a74c7a4f9c17d40ebf00
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||
index 2e421eaac80cf251b32e0bb504dd54a73edf4986..74ccc67e3c12dc5182602fb691ef3ddeb5b53280 100644
|
||||
index 2b247d55e39246fbef31279b14c45fc40f956bfb..675cd61221e807aadf28322b46c3daa1370241b5 100644
|
||||
--- a/src/main/resources/log4j2.xml
|
||||
+++ b/src/main/resources/log4j2.xml
|
||||
@@ -34,6 +34,10 @@
|
Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren