From 77fe1090c1d1e0df48c82aaa9c9c9572887b2ccc Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 31 Dec 2019 15:54:27 +0100 Subject: [PATCH] Fixing CommandSkull --- .../src/de/steamwar/bausystem/commands/CommandSkull.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java index df90f84..4222a7e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java @@ -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; } }