diff --git a/src/xyz/soper/arty/item/Shell.java b/src/xyz/soper/arty/item/Shell.java index 3ce1dbd..4acc69c 100644 --- a/src/xyz/soper/arty/item/Shell.java +++ b/src/xyz/soper/arty/item/Shell.java @@ -1,5 +1,7 @@ package xyz.soper.arty.item; +import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import java.util.List; @@ -33,4 +35,17 @@ public class Shell { this.failChance = failChance; } + /** + * Checks if the item stack is a shell + * @param item ItemStack to check against + * @return True if item is an arrow with a gray name "Shell" + */ + public static boolean isShell(ItemStack item){ + if(item.getType() == Material.ARROW + && item.hasItemMeta() + && item.getItemMeta().hasDisplayName() + && item.getItemMeta().getDisplayName().equals(ChatColor.GRAY + "Shell")) return true; + return false; + } + }