mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-01 14:07:43 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
3ea414fe85
@ -19,7 +19,7 @@ public class PlayerHeadMeta extends ItemMeta implements ItemMetaBuilder.Provider
|
|||||||
private final PlayerSkin playerSkin;
|
private final PlayerSkin playerSkin;
|
||||||
|
|
||||||
protected PlayerHeadMeta(@NotNull ItemMetaBuilder metaBuilder, UUID skullOwner,
|
protected PlayerHeadMeta(@NotNull ItemMetaBuilder metaBuilder, UUID skullOwner,
|
||||||
PlayerSkin playerSkin) {
|
@Nullable PlayerSkin playerSkin) {
|
||||||
super(metaBuilder);
|
super(metaBuilder);
|
||||||
this.skullOwner = skullOwner;
|
this.skullOwner = skullOwner;
|
||||||
this.playerSkin = playerSkin;
|
this.playerSkin = playerSkin;
|
||||||
@ -29,7 +29,7 @@ public class PlayerHeadMeta extends ItemMeta implements ItemMetaBuilder.Provider
|
|||||||
return skullOwner;
|
return skullOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerSkin getPlayerSkin() {
|
public @Nullable PlayerSkin getPlayerSkin() {
|
||||||
return playerSkin;
|
return playerSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +48,11 @@ public class PlayerHeadMeta extends ItemMeta implements ItemMetaBuilder.Provider
|
|||||||
public Builder playerSkin(@Nullable PlayerSkin playerSkin) {
|
public Builder playerSkin(@Nullable PlayerSkin playerSkin) {
|
||||||
this.playerSkin = playerSkin;
|
this.playerSkin = playerSkin;
|
||||||
handleCompound("SkullOwner", nbtCompound -> {
|
handleCompound("SkullOwner", nbtCompound -> {
|
||||||
|
if (playerSkin == null) {
|
||||||
|
nbtCompound.removeTag("Properties");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
NBTList<NBTCompound> textures = new NBTList<>(NBTTypes.TAG_Compound);
|
NBTList<NBTCompound> textures = new NBTList<>(NBTTypes.TAG_Compound);
|
||||||
String value = this.playerSkin.getTextures() == null ? "" : this.playerSkin.getTextures();
|
String value = this.playerSkin.getTextures() == null ? "" : this.playerSkin.getTextures();
|
||||||
String signature = this.playerSkin.getSignature() == null ? "" : this.playerSkin.getSignature();
|
String signature = this.playerSkin.getSignature() == null ? "" : this.playerSkin.getSignature();
|
||||||
|
Loading…
Reference in New Issue
Block a user