SteamWar/SpigotCore
Archiviert
13
0

Little Skull Patch

Dieser Commit ist enthalten in:
Chaoscaot 2021-04-29 02:03:23 +02:00
Ursprung f0c4786800
Commit d830eb6f47

Datei anzeigen

@ -19,7 +19,9 @@
package de.steamwar.inventory;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
@ -269,7 +271,12 @@ class SWItem_14 {
ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
SkullMeta headmeta = (SkullMeta) head.getItemMeta();
assert headmeta != null;
Player p = Bukkit.getPlayer(player);
if (p != null) {
headmeta.setOwningPlayer(p);
} else {
headmeta.setOwner(player);
}
headmeta.setDisplayName(player);
head.setItemMeta(headmeta);
return head;