more more work (757)
This commit is contained in:
parent
71ae391eb3
commit
22227ccf26
38 changed files with 203 additions and 194 deletions
37
patches/server/0738-Nameable-Banner-API.patch
Normal file
37
patches/server/0738-Nameable-Banner-API.patch
Normal file
|
@ -0,0 +1,37 @@
|
|||
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
|
||||
index 26ae3fe910964193c7fb22b8b644d5c0476f8d3d..0f8de5b87deeaf2aca043c017576f7c54c4a2f8e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java
|
||||
@@ -110,4 +110,26 @@ public class CraftBanner extends CraftBlockEntityState<BannerBlockEntity> implem
|
||||
public CraftBanner copy(Location location) {
|
||||
return new CraftBanner(this, location);
|
||||
}
|
||||
+
|
||||
+ // 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue