Little Skull Patch
Dieser Commit ist enthalten in:
Ursprung
f0c4786800
Commit
d830eb6f47
@ -19,7 +19,9 @@
|
|||||||
|
|
||||||
package de.steamwar.inventory;
|
package de.steamwar.inventory;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
|
|
||||||
@ -269,7 +271,12 @@ class SWItem_14 {
|
|||||||
ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
|
ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
|
||||||
SkullMeta headmeta = (SkullMeta) head.getItemMeta();
|
SkullMeta headmeta = (SkullMeta) head.getItemMeta();
|
||||||
assert headmeta != null;
|
assert headmeta != null;
|
||||||
headmeta.setOwner(player);
|
Player p = Bukkit.getPlayer(player);
|
||||||
|
if (p != null) {
|
||||||
|
headmeta.setOwningPlayer(p);
|
||||||
|
} else {
|
||||||
|
headmeta.setOwner(player);
|
||||||
|
}
|
||||||
headmeta.setDisplayName(player);
|
headmeta.setDisplayName(player);
|
||||||
head.setItemMeta(headmeta);
|
head.setItemMeta(headmeta);
|
||||||
return head;
|
return head;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren