mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: cae142b85 Enable Hex colors on PaperAdventure.LEGACY_SECTION_UXRC, and use it for sending messages to console command sender (#5230) c1635eabb PlayerDeathEvent#getDeathMessage should provide translation for legacy reasons #5227 3f74af202 Fix Log4J converter not parsing hex without named colors (#5228)
This commit is contained in:
@@ -4,8 +4,20 @@ Date: Thu, 9 May 2019 14:27:37 -0500
|
||||
Subject: [PATCH] Silk touch spawners
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
index 23e6a033612d964f1185dd09a10b470f46685568..a93102ec168ebddd524492250df09c7522b12fc8 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
@@ -33,6 +33,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
public final class PaperAdventure {
|
||||
public static final AttributeKey<Locale> LOCALE_ATTRIBUTE = AttributeKey.valueOf("adventure:locale");
|
||||
public static final LegacyComponentSerializer LEGACY_SECTION_UXRC = LegacyComponentSerializer.builder().hexColors().useUnusualXRepeatedCharacterHexFormat().build();
|
||||
+ public static final LegacyComponentSerializer LEGACY_AMPERSAND = LegacyComponentSerializer.builder().character(LegacyComponentSerializer.AMPERSAND_CHAR).hexColors().build(); // Purpur
|
||||
static final GsonComponentSerializer GSON = GsonComponentSerializer.builder()
|
||||
.legacyHoverEventSerializer(NBTLegacyHoverEventSerializer.INSTANCE)
|
||||
.build();
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockMobSpawner.java b/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
index 81e145ff0759322f74888c81df8d2133fece7144..f9c4fe9bec9f0ca32e2de907f8705a5d627e0736 100644
|
||||
index 81e145ff0759322f74888c81df8d2133fece7144..567a6a064254d99ae6a931b91e6bdd94badb19fc 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
@@ -1,5 +1,17 @@
|
||||
@@ -47,7 +59,7 @@ index 81e145ff0759322f74888c81df8d2133fece7144..f9c4fe9bec9f0ca32e2de907f8705a5d
|
||||
+
|
||||
+ String name = world.purpurConfig.silkTouchSpawnerName;
|
||||
+ if (name != null && !name.isEmpty() && !name.equals("Spawner")) {
|
||||
+ final Component displayName = LegacyComponentSerializer.legacyAmpersand().deserialize(name).replaceText(config).decoration(ITALIC, false);
|
||||
+ final Component displayName = PaperAdventure.LEGACY_AMPERSAND.deserialize(name).replaceText(config).decoration(ITALIC, false);
|
||||
+ display.set("Name", NBTTagString.create(GsonComponentSerializer.gson().serialize(displayName)));
|
||||
+ customDisplay = true;
|
||||
+ }
|
||||
@@ -56,7 +68,7 @@ index 81e145ff0759322f74888c81df8d2133fece7144..f9c4fe9bec9f0ca32e2de907f8705a5d
|
||||
+ if (lore != null && !lore.isEmpty()) {
|
||||
+ NBTTagList list = new NBTTagList();
|
||||
+ for (String line : lore) {
|
||||
+ final Component lineComponent = LegacyComponentSerializer.legacyAmpersand().deserialize(line).replaceText(config).decoration(ITALIC, false);
|
||||
+ final Component lineComponent = PaperAdventure.LEGACY_AMPERSAND.deserialize(line).replaceText(config).decoration(ITALIC, false);
|
||||
+ list.add(NBTTagString.create(GsonComponentSerializer.gson().serialize(lineComponent)));
|
||||
+ }
|
||||
+ display.set("Lore", list);
|
||||
|
||||
Reference in New Issue
Block a user