Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 19:10:09 +01:00
dcc290167f
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: dea9ce0a SPIGOT-7198: Add Sittable interface to Camel CraftBukkit Changes: eecb4c0dc SPIGOT-7196: Exception loading alternate worlds 0ff61e8fa SPIGOT-7198: Add Sittable interface to Camel 676441aac PR-1121: Handle additional missing SpawnEggs in MetaSpawnEgg e85280e02 Handle missing SpawnEggs in MetaSpawnEgg Spigot Changes: d90018e0 SPIGOT-7199: NPE loading or creating world with custom chunk generator
37 Zeilen
1.5 KiB
Diff
37 Zeilen
1.5 KiB
Diff
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 85f7ed3041befcc37729e9cd25723644600c7f62..31d916bc2364d0c518652b5b5868ab3d45a77ccc 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java
|
|
@@ -99,4 +99,25 @@ public class CraftBanner extends CraftBlockEntityState<BannerBlockEntity> implem
|
|
}
|
|
banner.itemPatterns = newPatterns;
|
|
}
|
|
+ // 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
|
|
}
|