public class CustomWeaponGlider extends java.lang.Object implements CustomWeapon
| Modifier and Type | Field and Description |
|---|---|
private static SkillParticle |
particle
A particle, used to represent chicken feathers.
|
| Constructor and Description |
|---|
CustomWeaponGlider() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cancelFallDamage(org.bukkit.event.entity.EntityDamageEvent event)
Cancels fall damage when holding a feather (glider) and makes it loose 2 durability.
|
boolean |
canHaveSkillSlot()
Determines if the custom weapon can have a skillgem slot.
|
static void |
dechick(org.bukkit.event.player.PlayerMoveEvent event)
Removes all chickens from the player's head.
|
static void |
fly(org.bukkit.entity.Player player)
Throws the player into the air and triggers gliding.
|
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.
|
static void |
glide(org.bukkit.event.player.PlayerMoveEvent event)
Adds a chicken to the player's head, if it is not already there.
|
private static void |
playChickenSounds(org.bukkit.Location origin)
Plays three chicken sounds in different pitches at the same time.
|
static void |
shoot(org.bukkit.entity.Player player)
Shoots a chicken in the player's eye direction.
|
private static org.bukkit.entity.Entity |
spawnTemporaryChicken(org.bukkit.Location location,
int duration)
Spawns a temporary chicken, which will be removed after a given amount of ticks.
|
void |
use(org.bukkit.event.player.PlayerInteractEvent event)
Cancels the event of a feather interaction.
|
private static SkillParticle particle
public void use(org.bukkit.event.player.PlayerInteractEvent event)
use in interface CustomItemevent - The interaction event.fly(Player),
shoot(Player)public java.util.List<org.bukkit.Material> getCustomItemMaterials()
getCustomItemMaterials in interface CustomItempublic boolean canHaveSkillSlot()
canHaveSkillSlot in interface CustomWeaponpublic java.util.List<java.lang.String> getCustomWeaponLores(boolean hasSkillSlot)
getCustomWeaponLores in interface CustomWeaponhasSkillSlot - If the weapon has a skillgem slot.public static void shoot(org.bukkit.entity.Player player)
player - The player who is shooting the chicken.Cooldown.playerProjectileShoot(Player),
NmsEntityChickoon,
spawnTemporaryChicken(Location, int),
SkillUtils.createExplosion(Location, float),
SkillUtils.callPlayerFixedDamageEvent(Player, Entity, double),
DurabilityCalculator.damageItem(Player, ItemStack, int, boolean)public static void fly(org.bukkit.entity.Player player)
player - The player who starts to fly.Cooldown.playerProjectileShoot(Player),
SkillUtils.throwEntityIntoAir(Entity, double),
SkillUtils.callPlayerFixedDamageEvent(Player, Entity, double),
DurabilityCalculator.damageItem(Player, ItemStack, int, boolean)private static void playChickenSounds(org.bukkit.Location origin)
origin - The location where the sounds should originate from.public static void glide(org.bukkit.event.player.PlayerMoveEvent event)
event - The move event.NmsEntityChickoonpublic static void dechick(org.bukkit.event.player.PlayerMoveEvent event)
event - The move event.public static void cancelFallDamage(org.bukkit.event.entity.EntityDamageEvent event)
event - The damage event.DurabilityCalculator.damageItem(Player, ItemStack, int, boolean)private static org.bukkit.entity.Entity spawnTemporaryChicken(org.bukkit.Location location,
int duration)
location - The location where the chicken should spawn.duration - The time in ticks till despawn.NmsEntityChickoon