SteamWar/BauSystem
Archiviert
13
0

Fixing CommandSkull

Dieser Commit ist enthalten in:
Lixfel 2019-12-31 15:54:27 +01:00
Ursprung 3e6495eb1a
Commit 77fe1090c1

Datei anzeigen

@ -12,7 +12,6 @@ import org.bukkit.inventory.meta.SkullMeta;
public class CommandSkull implements CommandExecutor {
@Override
@SuppressWarnings("deprecation")
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if(!(commandSender instanceof Player))
return false;
@ -23,13 +22,12 @@ public class CommandSkull implements CommandExecutor {
return false;
}
ItemStack is = new ItemStack(SWItem.getMaterial("SKULL_ITEM"), 1, (short)0, (byte)3);
ItemStack is = SWItem.getPlayerSkull(args[0]).getItemStack();
SkullMeta sm = (SkullMeta)is.getItemMeta();
sm.setOwner(args[0]);
assert sm != null;
sm.setDisplayName("§e" + args[0] + "§8s Kopf");
is.setItemMeta(sm);
p.getInventory().setItemInMainHand(is);
return false;
}
}