added shell check method

master
Soper Aylamo 2021-05-09 04:44:51 -04:00
parent d5fe421df0
commit 6ef8ef8f32
1 changed files with 15 additions and 0 deletions

View File

@ -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;
}
}