File tree 3 files changed +36
-0
lines changed
paper-api/src/main/java/org/bukkit/block
paper-server/src/main/java/org/bukkit/craftbukkit/block
3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -605,6 +605,7 @@ public net.minecraft.world.level.block.entity.SculkSensorBlockEntity lastVibrati
605
605
public net.minecraft.world.level.block.entity.SculkShriekerBlockEntity warningLevel
606
606
public net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity openCount
607
607
public net.minecraft.world.level.block.entity.SignBlockEntity playerWhoMayEdit
608
+ public net.minecraft.world.level.block.entity.SkullBlockEntity customName
608
609
public net.minecraft.world.level.block.entity.SkullBlockEntity noteBlockSound
609
610
public net.minecraft.world.level.block.entity.SkullBlockEntity owner
610
611
public net.minecraft.world.level.block.entity.StructureBlockEntity author
Original file line number Diff line number Diff line change 1
1
package org .bukkit .block ;
2
2
3
+ import net .kyori .adventure .text .Component ;
3
4
import org .bukkit .Material ;
4
5
import org .bukkit .NamespacedKey ;
5
6
import org .bukkit .OfflinePlayer ;
@@ -168,4 +169,24 @@ public interface Skull extends TileState {
168
169
@ Deprecated (since = "1.13" , forRemoval = true )
169
170
@ Contract ("_ -> fail" )
170
171
public void setSkullType (SkullType skullType );
172
+
173
+ /**
174
+ * Get the custom name of skull.
175
+ * <p>This name is set when placing a skull item that has a custom name.
176
+ * This name is only carried back to the item when broken for player heads
177
+ * (skeleton/creeper heads will not retain the name).</p>
178
+ *
179
+ * @return Custom name of skull
180
+ */
181
+ public @ Nullable Component customName ();
182
+
183
+ /**
184
+ * Set the custom name of skull.
185
+ * <p>This name is set when placing a skull item that has a custom name.
186
+ * This name is only carried back to the item when broken for player heads
187
+ * (skeleton/creeper heads will not retain the name).</p>
188
+ *
189
+ * @param customName Custom name of skull
190
+ */
191
+ public void customName (@ Nullable Component customName );
171
192
}
Original file line number Diff line number Diff line change 2
2
3
3
import com .google .common .base .Preconditions ;
4
4
import com .mojang .authlib .GameProfile ;
5
+ import io .papermc .paper .adventure .PaperAdventure ;
6
+ import net .kyori .adventure .text .Component ;
5
7
import net .minecraft .Util ;
6
8
import net .minecraft .resources .ResourceLocation ;
7
9
import net .minecraft .server .MinecraftServer ;
@@ -216,4 +218,16 @@ public CraftSkull copy() {
216
218
public CraftSkull copy (Location location ) {
217
219
return new CraftSkull (this , location );
218
220
}
221
+
222
+ @ Override
223
+ public @ Nullable Component customName () {
224
+ SkullBlockEntity snapshot = getSnapshot ();
225
+ return snapshot .customName == null ? null : PaperAdventure .asAdventure (snapshot .customName );
226
+ }
227
+
228
+ @ Override
229
+ public void customName (@ Nullable Component customName ) {
230
+ SkullBlockEntity snapshot = getSnapshot ();
231
+ snapshot .customName = customName == null ? null : PaperAdventure .asVanilla (customName );
232
+ }
219
233
}
You can’t perform that action at this time.
0 commit comments