added shell check method
This commit is contained in:
parent
d5fe421df0
commit
6ef8ef8f32
@ -1,5 +1,7 @@
|
|||||||
package xyz.soper.arty.item;
|
package xyz.soper.arty.item;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -33,4 +35,17 @@ public class Shell {
|
|||||||
this.failChance = failChance;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user