Skip to content

Commit

Permalink
chore: add check for when /head may fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Thatsmusic99 committed Sep 1, 2024
1 parent dd55697 commit ab3e7ed
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ private void giveHead(Player p, String n) {
result = HeadsPlus.get().getProfileHandler().setProfile((SkullMeta) skull.getItemMeta(), n);
}

result.thenAcceptAsync(meta -> {
result.whenCompleteAsync((meta, err) -> {

if (err != null) {
hpc.sendMessage("commands.errors.cmd-fail", p);
err.printStackTrace();
return;
}

meta.setDisplayName(ConfigMobs.get().getPlayerDisplayName(n));
skull.setItemMeta(meta);
p.getInventory().addItem(skull);
Expand Down

0 comments on commit ab3e7ed

Please sign in to comment.