Fix error when provided an invalid id

Dieser Commit ist enthalten in:
Silent 2020-11-15 15:34:11 +01:00
Ursprung 104b40901e
Commit af6e7e67ec

Datei anzeigen

@ -87,11 +87,11 @@ public class Command_headdb implements CommandExecutor {
}
Head head = HeadAPI.getHeadByID(id);
ItemStack item = head.getItemStack();
if (item == null) {
if (head == null) {
Utils.sendMessage(sender, "&cCould not find head with id &e" + id);
return true;
}
ItemStack item = head.getItemStack();
item.setAmount(amount);
target.getInventory().addItem(item);
Utils.sendMessage(sender, "Given &c" + target.getName() + " &ex" + amount + " " + head.getName());