2022-06-16 05:54:54 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
|
|
|
Date: Thu, 7 Apr 2022 17:49:25 -0400
|
|
|
|
Subject: [PATCH] Nameable Banner API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java
|
2023-09-29 02:28:26 +02:00
|
|
|
index 2b7fcd30b6eb0ab60b44de31ad0e0b20033f45c5..0a80bd370dd41ffbfbbe6b0d88cd6fa8a47a5725 100644
|
2022-06-16 05:54:54 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java
|
2023-09-29 02:28:26 +02:00
|
|
|
@@ -108,4 +108,26 @@ public class CraftBanner extends CraftBlockEntityState<BannerBlockEntity> implem
|
|
|
|
public CraftBanner copy() {
|
|
|
|
return new CraftBanner(this);
|
2022-06-16 05:54:54 +02:00
|
|
|
}
|
2023-09-29 02:28:26 +02:00
|
|
|
+
|
2022-06-16 05:54:54 +02:00
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public net.kyori.adventure.text.Component customName() {
|
|
|
|
+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getSnapshot().getCustomName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void customName(net.kyori.adventure.text.Component customName) {
|
|
|
|
+ this.getSnapshot().setCustomName(io.papermc.paper.adventure.PaperAdventure.asVanilla(customName));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public String getCustomName() {
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serializeOrNull(this.customName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCustomName(String name) {
|
|
|
|
+ this.customName(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserializeOrNull(name));
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|