Fixing CommandSkull
Dieser Commit ist enthalten in:
Ursprung
3e6495eb1a
Commit
77fe1090c1
@ -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;
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren