Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Added flags support in the two defaults item classes
Browse files Browse the repository at this point in the history
  • Loading branch information
LoRy24 committed Jul 27, 2021
1 parent e1f8c41 commit 903f637
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.lory24.mcuitils.utils.ItemEnchant;
import org.bukkit.Material;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

Expand All @@ -26,6 +27,7 @@ public ItemStack buildToItemStack() {
ItemMeta meta = i.getItemMeta();
if (getName() != null) meta.setDisplayName(getName());
for (ItemEnchant e : getEnchants()) meta.addEnchant(e.getEnchant(), e.getLevel(), e.isIgnoreLimit());
for (ItemFlag f : getFlags()) meta.addItemFlags(f);
meta.setLore(getLore());
i.setItemMeta(meta);
return i;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/github/lory24/mcuitils/api/GUIHead.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.mojang.authlib.properties.Property;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;

Expand Down Expand Up @@ -61,6 +62,7 @@ public ItemStack buildToItemStack() {
if (getSkullOwner() != null) meta.setOwner(getSkullOwner());

for (ItemEnchant e : getEnchants()) meta.addEnchant(e.getEnchant(), e.getLevel(), e.isIgnoreLimit());
for (ItemFlag f : getFlags()) meta.addItemFlags(f);

// Set custom texture
if (isCustomTexture()) {
Expand Down

0 comments on commit 903f637

Please sign in to comment.