mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +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:
@@ -5,17 +5,16 @@ Subject: [PATCH] Allow anvil colors
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java
|
||||
index 4aa6b035a6a8ea39401c6566cd286de39f60e942..bae418eb43a413b09adbfa1f87e5e20052289a21 100644
|
||||
index 4aa6b035a6a8ea39401c6566cd286de39f60e942..02924766a4c655f149b58bf1ded8e0610f8900a3 100644
|
||||
--- a/src/main/java/net/minecraft/server/ContainerAnvil.java
|
||||
+++ b/src/main/java/net/minecraft/server/ContainerAnvil.java
|
||||
@@ -10,6 +10,14 @@ import org.apache.logging.log4j.Logger;
|
||||
@@ -10,6 +10,13 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
// CraftBukkit end
|
||||
|
||||
+// Purpur start
|
||||
+import io.papermc.paper.adventure.PaperAdventure;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
+
|
||||
+import static net.kyori.adventure.text.format.TextDecoration.ITALIC;
|
||||
+// Purpur end
|
||||
@@ -23,7 +22,7 @@ index 4aa6b035a6a8ea39401c6566cd286de39f60e942..bae418eb43a413b09adbfa1f87e5e200
|
||||
public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -251,6 +259,17 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
@@ -251,6 +258,17 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
} else if (!this.renameText.equals(itemstack.getName().getString())) {
|
||||
b1 = 1;
|
||||
i += b1;
|
||||
@@ -31,9 +30,9 @@ index 4aa6b035a6a8ea39401c6566cd286de39f60e942..bae418eb43a413b09adbfa1f87e5e200
|
||||
+ if (player != null && player.world.purpurConfig.anvilAllowColors && player.getBukkitEntity().hasPermission("purpur.anvil.color")) {
|
||||
+ final Component renameTextComponent;
|
||||
+ if (renameText.startsWith("&r") && player.getBukkitEntity().hasPermission("purpur.anvil.remove_italics")) {
|
||||
+ renameTextComponent = LegacyComponentSerializer.legacyAmpersand().deserialize(renameText.substring(2)).decoration(ITALIC, false);
|
||||
+ renameTextComponent = PaperAdventure.LEGACY_AMPERSAND.deserialize(renameText.substring(2)).decoration(ITALIC, false);
|
||||
+ } else {
|
||||
+ renameTextComponent = LegacyComponentSerializer.legacyAmpersand().deserialize(renameText);
|
||||
+ renameTextComponent = PaperAdventure.LEGACY_AMPERSAND.deserialize(renameText);
|
||||
+ }
|
||||
+ itemstack1.a(PaperAdventure.asVanilla(renameTextComponent));
|
||||
+ } else
|
||||
|
||||
Reference in New Issue
Block a user