geforkt von Mirrors/HeadDB
Fix error when provided an invalid id
Dieser Commit ist enthalten in:
Ursprung
104b40901e
Commit
af6e7e67ec
@ -87,11 +87,11 @@ public class Command_headdb implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Head head = HeadAPI.getHeadByID(id);
|
Head head = HeadAPI.getHeadByID(id);
|
||||||
ItemStack item = head.getItemStack();
|
if (head == null) {
|
||||||
if (item == null) {
|
|
||||||
Utils.sendMessage(sender, "&cCould not find head with id &e" + id);
|
Utils.sendMessage(sender, "&cCould not find head with id &e" + id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
ItemStack item = head.getItemStack();
|
||||||
item.setAmount(amount);
|
item.setAmount(amount);
|
||||||
target.getInventory().addItem(item);
|
target.getInventory().addItem(item);
|
||||||
Utils.sendMessage(sender, "Given &c" + target.getName() + " &ex" + amount + " " + head.getName());
|
Utils.sendMessage(sender, "Given &c" + target.getName() + " &ex" + amount + " " + head.getName());
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren