Compare commits

...

8 commits

Author SHA1 Message Date
Shane Freeder
fc9ee65a32
Make WorldCreator#keepSpawnLoaded return the WorldCreator (Fixes #8321) (#8371)
* Make WorldCreator#keepSpawnLoaded return the WorldCreator (Fixes #8321)

Thought that I fixed this before push/merge, apparently not, hence, fix
the return type and add mitigation for this.

* Fix patch/build

* Rebuild patches
2022-09-20 01:52:01 +01:00
pop4959
df630a27cc
Don't print component in resource pack rejection message (#8085) 2022-07-03 11:11:37 -07:00
u9g
072f54c5f9
Add ARMOR tag to MaterialTags (1.18.2) (#7880) 2022-06-15 00:03:29 +01:00
Space Walker
ef5d95f9fb
Update alternate current patch (#7971) 2022-06-14 11:41:05 +02:00
Josh Roy
3eaf3a8f5e Update paperweight to 1.3.7 2022-06-12 22:01:46 -04:00
Josh Roy
c6e6beef6a Ensure that Log4J is shutdown when stopping the server (Fixes #7932) 2022-06-12 22:01:46 -04:00
Josh Roy
38c13b27c9 Update Adventure to 4.11.0 and implement ComponentLogger 2022-06-12 22:01:46 -04:00
Noah van der Aa
3925a53dd0
Make timings link clickable (#7944) 2022-06-12 10:07:35 +02:00
15 changed files with 617 additions and 403 deletions

View file

@ -5,7 +5,7 @@ plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
id("io.papermc.paperweight.core") version "1.3.6"
id("io.papermc.paperweight.core") version "1.3.7"
}
allprojects {

View file

@ -7,14 +7,14 @@ Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index 98afa6a25131dc626ea7a5122f33df6bd2d39178..eefc024acc3e14ae21855df7f2f358bd1e0a9e38 100644
index 98afa6a25131dc626ea7a5122f33df6bd2d39178..fc37b3ef788b43d5523e8af416f8dbb6387ec92e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,18 +8,37 @@ java {
@@ -8,18 +8,38 @@ java {
withJavadocJar()
}
+val adventureVersion = "4.10.1"
+val adventureVersion = "4.11.0"
+val apiAndDocs: Configuration by configurations.creating {
+ attributes {
+ attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@ -46,10 +46,11 @@ index 98afa6a25131dc626ea7a5122f33df6bd2d39178..eefc024acc3e14ae21855df7f2f358bd
+ apiAndDocs("net.kyori:adventure-text-serializer-gson")
+ apiAndDocs("net.kyori:adventure-text-serializer-legacy")
+ apiAndDocs("net.kyori:adventure-text-serializer-plain")
+ apiAndDocs("net.kyori:adventure-text-logger-slf4j")
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.8.4")
@@ -77,9 +96,24 @@ tasks.withType<Javadoc> {
@@ -77,9 +97,24 @@ tasks.withType<Javadoc> {
"https://guava.dev/releases/31.0.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
"https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
@ -3976,6 +3977,24 @@ index 228421154913116069c20323afb519bdde2134df..26791db3c267670d5782f1d2b67ff7d5
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index 03ca87a1cbace2459174bb7bb8847bda766e80c5..b37938745f916b5f0111b07b1a1c97527f026e9d 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/src/main/java/org/bukkit/plugin/Plugin.java
@@ -179,6 +179,13 @@ public interface Plugin extends TabExecutor {
@NotNull
public Logger getLogger();
+ // Paper start - Adventure component logger
+ @NotNull
+ default net.kyori.adventure.text.logger.slf4j.ComponentLogger getComponentLogger() {
+ return net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(getLogger().getName());
+ }
+ // Paper end
+
/**
* Returns the name of the plugin.
* <p>
diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java
index ff3fcb2697eb00736238d0efdcaefe43043334d3..75acd6f8f3d774bb79e8e513125e801c5569a244 100644
--- a/src/main/java/org/bukkit/scoreboard/Objective.java

View file

@ -6,13 +6,13 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts
index 19b65a9b56b73f873ef646d14a6cf091b69d3873..bc6f68a0cadeec865401e9cb0dce89460484b148 100644
index fc37b3ef788b43d5523e8af416f8dbb6387ec92e..677a6d377bcc5ed5db32601073a0a90c74100786 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -39,6 +39,9 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-gson")
@@ -40,6 +40,9 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
+
+ implementation("org.ow2.asm:asm:9.2")
+ implementation("org.ow2.asm:asm-commons:9.2")

View file

@ -14,25 +14,25 @@ it without having to shade it in the plugin and going through
several layers of logging abstraction.
diff --git a/build.gradle.kts b/build.gradle.kts
index bc6f68a0cadeec865401e9cb0dce89460484b148..d6c4abc30af2b535644707a240b60d1b613785e9 100644
index 677a6d377bcc5ed5db32601073a0a90c74100786..46016bd1a2403c9f449ba92ec942cd349da747ac 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -39,6 +39,8 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-gson")
@@ -40,6 +40,8 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
+ api("org.apache.logging.log4j:log4j-api:2.17.1")
+ api("org.slf4j:slf4j-api:1.8.0-beta4")
implementation("org.ow2.asm:asm:9.2")
implementation("org.ow2.asm:asm-commons:9.2")
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index 03ca87a1cbace2459174bb7bb8847bda766e80c5..34438b5362b0ba0949625d81e8371fe0d1f76fdf 100644
index b37938745f916b5f0111b07b1a1c97527f026e9d..08aef59d8443038771704d9587e31f299e587307 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/src/main/java/org/bukkit/plugin/Plugin.java
@@ -179,6 +179,22 @@ public interface Plugin extends TabExecutor {
@NotNull
public Logger getLogger();
@@ -186,6 +186,22 @@ public interface Plugin extends TabExecutor {
}
// Paper end
+ // Paper start - Add SLF4J/Log4J loggers
+ @NotNull

View file

@ -113,10 +113,10 @@ index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab015
+}
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
new file mode 100644
index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd585fea27
index 0000000000000000000000000000000000000000..728bc33cd6081f9462ab62d2ca6935573ccd3533
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
@@ -0,0 +1,655 @@
@@ -0,0 +1,661 @@
+/*
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
+ *
@ -627,6 +627,12 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ .ensureSize("BOOTS", 6).lock();
+
+ /**
+ * Covers all variants of armor.
+ */
+ public static final MaterialSetTag ARMOR = new MaterialSetTag(keyFor("armor")).add(HELMETS, CHESTPLATES, LEGGINGS, BOOTS)
+ .ensureSize("ARMOR", 25).lock();
+
+ /**
+ * Covers the variants of bows.
+ */
+ public static final MaterialSetTag BOWS = new MaterialSetTag(keyFor("bows"))
@ -1067,7 +1073,7 @@ index 0000000000000000000000000000000000000000..d7eb49a05c3f0cacf285f8995433c5d5
+ .ensureSize("WATER_BASED", 11).lock();
+}
diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java
index 5a25301a81b0e88a4891cbc4710289544d44105c..34d23f53acf00620223731c4fdacffde9cff41a8 100644
index 107d12d447be481928ee796f73b7acb2c4b9b2d8..42d0f31c2be2d39c4481f98c0756c4f1ae337717 100644
--- a/src/main/java/org/bukkit/Tag.java
+++ b/src/main/java/org/bukkit/Tag.java
@@ -11,6 +11,10 @@ import org.jetbrains.annotations.NotNull;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] WorldCreator#keepSpawnLoaded
diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java
index cbdcac688afb7c13dd7058fa522bbd2c5adc445e..355f9f27d29c65efebf099a72c37892a309edef1 100644
index cbdcac688afb7c13dd7058fa522bbd2c5adc445e..dc92ce261b9e67979da3f82cb75292ff980ad87e 100644
--- a/src/main/java/org/bukkit/WorldCreator.java
+++ b/src/main/java/org/bukkit/WorldCreator.java
@@ -22,6 +22,7 @@ public class WorldCreator {
@ -16,7 +16,7 @@ index cbdcac688afb7c13dd7058fa522bbd2c5adc445e..355f9f27d29c65efebf099a72c37892a
/**
* Creates an empty WorldCreationOptions for the given world name
@@ -573,4 +574,29 @@ public class WorldCreator {
@@ -573,4 +574,32 @@ public class WorldCreator {
return result;
}
@ -38,10 +38,13 @@ index cbdcac688afb7c13dd7058fa522bbd2c5adc445e..355f9f27d29c65efebf099a72c37892a
+ * configuration, otherwise, will act as an override towards this setting
+ *
+ * @param keepSpawnLoaded the new value
+ * @return This object, for chaining
+ */
+ public void keepSpawnLoaded(@NotNull net.kyori.adventure.util.TriState keepSpawnLoaded) {
+ @NotNull
+ public WorldCreator keepSpawnLoaded(@NotNull net.kyori.adventure.util.TriState keepSpawnLoaded) {
+ java.util.Objects.requireNonNull(keepSpawnLoaded, "keepSpawnLoaded");
+ this.keepSpawnLoaded = keepSpawnLoaded;
+ return this;
+ }
+
+ // Paper end

View file

@ -788,6 +788,31 @@ index 0000000000000000000000000000000000000000..2a08e0461db4e699b7e6a1558a4419c8
+ return net.minecraft.network.chat.Component.Serializer.fromJson(GsonComponentSerializer.gson().serializer().toJsonTree(component));
+ }
+}
diff --git a/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java b/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..c3631efda9c7fa531a8a9f18fbee7b5f8655382b
--- /dev/null
+++ b/src/main/java/io/papermc/paper/adventure/providers/ComponentLoggerProviderImpl.java
@@ -0,0 +1,19 @@
+package io.papermc.paper.adventure.providers;
+
+import io.papermc.paper.adventure.PaperAdventure;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
+import net.kyori.adventure.text.logger.slf4j.ComponentLoggerProvider;
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.LoggerFactory;
+
+public class ComponentLoggerProviderImpl implements ComponentLoggerProvider {
+ @Override
+ public @NotNull ComponentLogger logger(@NotNull LoggerHelper helper, @NotNull String name) {
+ return helper.delegating(LoggerFactory.getLogger(name), this::serialize);
+ }
+
+ private String serialize(final Component message) {
+ return PaperAdventure.asPlain(message, null);
+ }
+}
diff --git a/src/main/java/io/papermc/paper/adventure/providers/GsonComponentSerializerProviderImpl.java b/src/main/java/io/papermc/paper/adventure/providers/GsonComponentSerializerProviderImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..c620d5aa2b0208b769dbe9563f0e99edc9a91047
@ -3680,6 +3705,13 @@ index 838d5b877c01be3ef353f434d98e27b46c0a3fb4..5c4c0ba05f10d2d83b22d3e86805cfa8
HashSet<Player> reference = new HashSet<Player>(players.size());
for (ServerPlayer player : players) {
reference.add(player.getBukkitEntity());
diff --git a/src/main/resources/META-INF/services/net.kyori.adventure.text.logger.slf4j.ComponentLoggerProvider b/src/main/resources/META-INF/services/net.kyori.adventure.text.logger.slf4j.ComponentLoggerProvider
new file mode 100644
index 0000000000000000000000000000000000000000..399bde6e57cd82b50d3ebe0f51a3958fa2d52d43
--- /dev/null
+++ b/src/main/resources/META-INF/services/net.kyori.adventure.text.logger.slf4j.ComponentLoggerProvider
@@ -0,0 +1 @@
+io.papermc.paper.adventure.providers.ComponentLoggerProviderImpl
diff --git a/src/main/resources/META-INF/services/net.kyori.adventure.text.minimessage.MiniMessage$Provider b/src/main/resources/META-INF/services/net.kyori.adventure.text.minimessage.MiniMessage$Provider
new file mode 100644
index 0000000000000000000000000000000000000000..6ce632b6c9dc5e4b3b978331df51c0ffd1526471

View file

@ -163,10 +163,10 @@ index 0000000000000000000000000000000000000000..b47b7dce26805badd422c1867733ff4b
+}
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
new file mode 100644
index 0000000000000000000000000000000000000000..4092a227a540a1c5cfb95efcc2a36e049b9a979c
index 0000000000000000000000000000000000000000..46297ac0a19fd2398ab777a381eff4d0a256161e
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -0,0 +1,384 @@
@@ -0,0 +1,385 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@ -194,6 +194,7 @@ index 0000000000000000000000000000000000000000..4092a227a540a1c5cfb95efcc2a36e04
+
+import com.google.common.collect.Sets;
+import io.papermc.paper.adventure.PaperAdventure;
+import net.kyori.adventure.text.event.ClickEvent;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
+import net.minecraft.server.MinecraftServer;
@ -511,7 +512,7 @@ index 0000000000000000000000000000000000000000..4092a227a540a1c5cfb95efcc2a36e04
+ }
+
+ timingsURL = con.getHeaderField("Location");
+ listeners.sendMessage(text("View Timings Report: " + timingsURL, NamedTextColor.GREEN));
+ listeners.sendMessage(text("View Timings Report: ", NamedTextColor.GREEN).append(text(timingsURL).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, timingsURL))));
+
+ if (response != null && !response.isEmpty()) {
+ Bukkit.getLogger().log(Level.INFO, "Timing Response: " + response);
@ -1327,7 +1328,7 @@ index de0f49f3e9134c068aa479067ee2986c981167b8..0750cf27c1b2cac723d68d0e6c2204cb
this.entityManager.saveAll();
} else {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 7d624f741291cad59545e465db9c46e56581ed8a..628ae2171c42d04b418001bf542e25ebe12bb18e 100644
index 9dd29a669a10735819d3be03e4693850de58bb28..96c59b0e5ac3d36c8ecd513b64723e7dbe5d9b3a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -210,6 +210,7 @@ import org.bukkit.inventory.CraftingInventory;
@ -1707,7 +1708,7 @@ index 95abf42577725383a2b49242c28b81beef487ee5..4e5cfc508e356691a9a249013553f97e
};
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index e2270d75c1ffaf0b68300f0734987e86ab6fedda..4a04536ecdeb055fd32272884f6057e5d04f1035 100644
index 81e78644417764cee33f81cdb116a91fb1d8ccf3..a40995140db011271bd092b0b7415d1eee0e8b18 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2361,12 +2361,31 @@ public final class CraftServer implements Server {

View file

@ -323,7 +323,7 @@ index f994d393929ca6813d4209fb9c93550e4f692228..0b049b267a1e1d6b48c035ed54ff2433
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a67fc9b0899f9d2128ac202ba0c12776653dfe28..59d0ada796efc4b2cf65d8398911f132320482ee 100644
index 21a10a0dc98cb2c669a505d6185c2093855afae6..9e2adc414d43f0c91f222be5f082e74d9db173aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2067,7 +2067,7 @@ public final class CraftServer implements Server {
@ -451,10 +451,10 @@ index 69b7a11d423b1cd8560cd726dd2b9a2b203e7dfd..7a5e7e8a680ead5128fbf5829bc47704
private static List<String> asList(String... params) {
return Arrays.asList(params);
diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
index b4a19d80bbf71591f25729fd0e98590350cb31d0..d752720f2f234b9dbd2117333fee1bfad663ec02 100644
index b4a19d80bbf71591f25729fd0e98590350cb31d0..e948ec5a573b22645664eb53bc3e9932246544e4 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
@@ -12,12 +12,27 @@ public class ServerShutdownThread extends Thread {
@@ -12,12 +12,28 @@ public class ServerShutdownThread extends Thread {
@Override
public void run() {
try {
@ -477,6 +477,7 @@ index b4a19d80bbf71591f25729fd0e98590350cb31d0..d752720f2f234b9dbd2117333fee1bfa
+ e.printStackTrace();
+ // Paper end
} finally {
+ org.apache.logging.log4j.LogManager.shutdown(); // Paper
try {
- net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Use TerminalConsoleAppender
+ //net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Move into stop

View file

@ -21,35 +21,62 @@ index 1adbceadd5df96e17796561a40eb7b760493440e..c07257314e070d4423c4f53f58cb0962
public static boolean allowBlockPermanentBreakingExploits = false;
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
index 685deaa0e5d1ddc13e3a7c0471b1cfcf1710c869..709f2a420ceaffe0101c676ec23e949e8d684465 100644
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,5 +1,10 @@
@@ -1,16 +1,25 @@
package com.destroystokyo.paper.console;
+import io.papermc.paper.console.HexFormattingConverter;
+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.apache.logging.log4j.Logger;
import org.bukkit.craftbukkit.command.CraftConsoleCommandSender;
@@ -10,8 +15,13 @@ public class TerminalConsoleCommandSender extends 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
- LOGGER.info(message);
+ 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(HexFormattingConverter.SERIALIZER.serialize(message));
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

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Configurable feature seeds
Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com>
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index 4092a227a540a1c5cfb95efcc2a36e049b9a979c..e2f60115370f19e935eb3b14d5de99aa4126c6b0 100644
index 46297ac0a19fd2398ab777a381eff4d0a256161e..78280fb3bcd8d792a58ece6d735e0824ea4be536 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -282,7 +282,7 @@ public class TimingsExport extends Thread {
@@ -283,7 +283,7 @@ public class TimingsExport extends Thread {
JSONObject object = new JSONObject();
for (String key : config.getKeys(false)) {
String fullKey = (parentKey != null ? parentKey + "." + key : key);

View file

@ -67,10 +67,10 @@ determined by the number of players on the server multiplied by the
whatever `global-max-concurrent-loads` is configured to.
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index e2f60115370f19e935eb3b14d5de99aa4126c6b0..f3bf9df8c0bd56cad461210ce8551ade3a220b6b 100644
index 78280fb3bcd8d792a58ece6d735e0824ea4be536..06bff37e4c1fddd3be6343049a66787c63fb420c 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -161,7 +161,11 @@ public class TimingsExport extends Thread {
@@ -162,7 +162,11 @@ public class TimingsExport extends Thread {
pair("gamerules", toObjectMapper(world.getWorld().getGameRules(), rule -> {
return pair(rule, world.getWorld().getGameRuleValue(rule));
})),

View file

@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: pop4959 <pop4959@gmail.com>
Date: Sat, 2 Jul 2022 11:56:26 -0700
Subject: [PATCH] Don't print component in resource pack rejection message
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0b7923f67d27549f41c0d398d1b99737f0c8a746..3faf67d100e49836eb9b408e88c296e615ca33f8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1960,7 +1960,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void handleResourcePackResponse(ServerboundResourcePackPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) {
- ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
+ ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getGameProfile().getName()); // Paper - Don't print component in resource pack rejection message
this.disconnect(new TranslatableComponent("multiplayer.requiredTexturePrompt.disconnect"), org.bukkit.event.player.PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // Paper - add cause
}
// Paper start

View file

@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 19 Sep 2022 00:13:02 +0100
Subject: [PATCH] Mitigate effects of WorldCreator#keepSpawnLoaded ret type
change
TODO: Remove in 1.21?
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
index 89a32de0a3fbb7465b078b2aa1cc1d156a4a174d..0df544ad8ed22ed2505140a4eca849058ee34ccf 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
@@ -426,6 +426,12 @@ public class Commodore
{
desc = getOriginalOrRewrite(desc);
}
+ if (owner.equals("org/bukkit/WorldCreator") && name.equals("keepSpawnLoaded") && desc.equals("(Lnet/kyori/adventure/util/TriState;)V")) {
+ super.visitMethodInsn(opcode, owner, name, "(Lnet/kyori/adventure/util/TriState;)Lorg/bukkit/WorldCreator;", itf);
+ // new method has a return, so, make sure we pop it
+ super.visitInsn(Opcodes.POP);
+ return;
+ }
// Paper end
if ( modern )