Skip to content

Commit

Permalink
Add self_head as a valid item material to display the players own hea…
Browse files Browse the repository at this point in the history
…d in menus
  • Loading branch information
ErikSzabo committed Jul 22, 2024
1 parent df677e5 commit 00027a6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/java/gg/auroramc/aurora/api/menu/ItemBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,16 @@ public MenuItem build(Player player) {
}

public ItemStack toItemStack(Player player) {
var item = config.getMaterial().contains(":")
? fromType(TypeId.fromDefault(config.getMaterial()), player)
: new ItemStack(Material.valueOf(config.getMaterial().toUpperCase()));
ItemStack item;

if(config.getMaterial().contains(":")) {
item = fromType(TypeId.fromDefault(config.getMaterial()), player);
} else if(config.getMaterial().equalsIgnoreCase("self_head")) {
setPlayerHead(player);
item = new ItemStack(Material.PLAYER_HEAD);
} else {
item = new ItemStack(Material.valueOf(config.getMaterial().toUpperCase()));
}

return toItemStack(item, player);
}
Expand Down

0 comments on commit 00027a6

Please sign in to comment.