public class CustomWeaponHook extends java.lang.Object implements CustomWeapon
Constructor and Description |
---|
CustomWeaponHook() |
Modifier and Type | Method and Description |
---|---|
boolean |
canHaveSkillSlot()
Determines if the custom weapon can have a skillgem slot.
|
java.util.List<org.bukkit.Material> |
getCustomItemMaterials()
Returns the materials that trigger events with the item.
|
java.util.List<java.lang.String> |
getCustomWeaponLores(boolean hasSkillSlot)
Gets the lores to show on an instance of the custom weapon.
|
private static boolean |
pull(org.bukkit.block.Block block,
org.bukkit.event.entity.ProjectileLaunchEvent event)
Searches the block for valid attack targets.
|
void |
use(org.bukkit.event.player.PlayerInteractEvent event)
Handles the interaction with the item.
|
static void |
use(org.bukkit.event.entity.ProjectileLaunchEvent event)
Handles a hook launch and cancels it, when no target was found within 15 blocks.
|
public void use(org.bukkit.event.player.PlayerInteractEvent event)
use
in interface CustomItem
event
- The interaction event.public static void use(org.bukkit.event.entity.ProjectileLaunchEvent event)
event
- The projectile event.pull(Block, ProjectileLaunchEvent)
,
DurabilityCalculator.damageItem(Player, org.bukkit.inventory.ItemStack, int, boolean)
public java.util.List<org.bukkit.Material> getCustomItemMaterials()
getCustomItemMaterials
in interface CustomItem
public boolean canHaveSkillSlot()
canHaveSkillSlot
in interface CustomWeapon
public java.util.List<java.lang.String> getCustomWeaponLores(boolean hasSkillSlot)
getCustomWeaponLores
in interface CustomWeapon
hasSkillSlot
- If the weapon has a skillgem slot.private static boolean pull(org.bukkit.block.Block block, org.bukkit.event.entity.ProjectileLaunchEvent event)
block
- The block to search for targets.event
- The projectile event.SkillUtils.getVectorForPoints(Location, Location)
,
DurabilityCalculator.damageItem(Player, org.bukkit.inventory.ItemStack, boolean)