Skip to content

Commit

Permalink
chore: add debugging to indicate items that couldn't be added through…
Browse files Browse the repository at this point in the history
… /head
  • Loading branch information
Thatsmusic99 committed Sep 2, 2024
1 parent ab3e7ed commit 155108d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CompletableFuture;

Expand Down Expand Up @@ -57,7 +58,11 @@ private void giveHead(Player p, String n) {

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

final HashMap<Integer, ItemStack> items = p.getInventory().addItem(skull);
for (Integer i : items.keySet()) {
HeadsPlus.debug("Item " + items.get(i).toString() + " couldn't be added.");
}
}, HeadsPlus.sync);
}

Expand Down Expand Up @@ -108,7 +113,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N
}
// Check restrictions
if (!RestrictionsManager.canUse(args[0].toLowerCase(), RestrictionsManager.ActionType.HEADS)) {
// TODO: cannot use head
hpc.sendMessage("commands.head.restricted-head", sender);
return true;
}
giveHead(p, args[0]);
Expand Down

0 comments on commit 155108d

Please sign in to comment.