diff --git a/patches/server/Add-advancement-display-API.patch b/patches/server/Add-advancement-display-API.patch index e713325f4a..1e653f3ea2 100644 --- a/patches/server/Add-advancement-display-API.patch +++ b/patches/server/Add-advancement-display-API.patch @@ -135,22 +135,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ +package io.papermc.paper.advancement; + -+import com.mojang.logging.LogUtils; +import io.papermc.paper.adventure.PaperAdventure; +import net.kyori.adventure.text.format.TextColor; +import net.minecraft.advancements.FrameType; +import net.minecraft.network.chat.contents.TranslatableContents; -+import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class AdvancementFrameTest { -+ @Before -+ public void before() { -+ // Work around weird classloading issue when initializing PaperAdventure -+ LogUtils.getLogger(); -+ } + + @Test + public void test() { diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index b0b67849eb..c67f01d886 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -741,7 +741,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import org.jetbrains.annotations.Nullable; + +public final class PaperAdventure { -+ public static final AttributeKey LOCALE_ATTRIBUTE = AttributeKey.valueOf("adventure:locale"); + private static final Pattern LOCALIZATION_PATTERN = Pattern.compile("%(?:(\\d+)\\$)?s"); + public static final ComponentFlattener FLATTENER = ComponentFlattener.basic().toBuilder() + .complexMapper(TranslatableComponent.class, (translatable, consumer) -> { @@ -791,6 +790,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + }) + .build(); ++ public static final AttributeKey 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(); + private static final Codec NBT_CODEC = new Codec() { + @Override