public class SkillUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
SkillUtils.TotemRunnable
A runnable that needs a totem entity to be executed.
|
Constructor and Description |
---|
SkillUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addPotionEffect(org.bukkit.entity.Entity entity,
org.bukkit.potion.PotionEffectType potionEffectType,
int duration,
int amplifier)
Adds the given potion effect to an entity.
|
static void |
addPotionEffect(java.util.List<org.bukkit.entity.Entity> entities,
org.bukkit.potion.PotionEffectType potionEffectType,
int duration,
int amplifier)
Adds the given potion effect to multiple entities.
|
static void |
callPlayerDamageOverTimeEvent(org.bukkit.entity.Player player,
org.bukkit.entity.Entity entity,
org.bukkit.Color color,
int damage,
int ticks,
int interval)
Calls a damage event, that deals damage based on a specified interval.
|
static void |
callPlayerFixedDamageEvent(org.bukkit.entity.Player player,
org.bukkit.entity.Entity entity,
double damage)
Calls a damage event, that will not receive attack bonuses, hittting a single enemy.
|
static void |
callPlayerFixedDamageEvent(org.bukkit.entity.Player player,
java.util.List<org.bukkit.entity.Entity> entities,
double damage)
Calls a damage event, that will not receive attack bonuses, hittting multiple enemies.
|
static void |
callPlayerMagicDamageEvent(org.bukkit.entity.Player player,
org.bukkit.entity.Entity entity,
double damageMultiplier)
Calls a damage event with a damage multiplier, for magic attacks, hitting a single enemy.
|
static void |
callPlayerMagicDamageEvent(org.bukkit.entity.Player player,
java.util.List<org.bukkit.entity.Entity> entities,
double damageMultiplier)
Calls a damage event with a damage multiplier, for magic attacks, hitting multiple enemies.
|
private static void |
callTotemEvent(org.bukkit.entity.Entity totem,
SkillUtils.TotemRunnable runnable,
int ticks,
int interval)
Calls a the totem runnable for an existing totem.
|
static void |
createExplosion(org.bukkit.Location location,
float power)
Creates an audiovisual explosion, that can not destroy blocks.
|
static java.util.List<org.bukkit.entity.Player> |
getPlayersInRadius(org.bukkit.Location location,
int radius)
Determines all players in the radius of the given location.
|
static org.bukkit.entity.Entity |
getTargetInLine(org.bukkit.entity.Player player,
int range)
Determines the first target in the line of sight of the player.
|
static java.util.List<org.bukkit.entity.Entity> |
getTargetsInLine(org.bukkit.entity.Player player,
int range)
Determines all targets in the line of sight of the player.
|
static java.util.List<org.bukkit.entity.Entity> |
getTargetsInRadius(org.bukkit.Location location,
double radius)
Determines all targets in the radius of the given location.
|
static java.util.List<org.bukkit.entity.Entity> |
getTargetsInRadius(org.bukkit.Location location,
double radius,
java.util.List<org.bukkit.entity.Entity> excludes)
Determines all targets in the radius of the given location.
|
static org.bukkit.util.Vector |
getThrowbackVector(org.bukkit.Location originLocation,
org.bukkit.Location throwbackLocation,
double force)
Generates a vector from one location away from another.
|
static org.bukkit.util.Vector |
getVectorForPoints(org.bukkit.Location originLocation,
org.bukkit.Location targetLocation)
Generates a vector from one location to another.
|
static boolean |
isValidAttackTarget(org.bukkit.entity.Entity entity)
Determines if given entity should be targetable.
|
static void |
rotateEntity(org.bukkit.entity.Entity entity)
Lets the entity rotate 360 degrees over the course of 0.5 seconds.
|
static void |
spawnTotem(org.bukkit.entity.Player owner,
org.bukkit.Material material,
SkillUtils.TotemRunnable runnable,
int ticks,
int interval)
Spawns a totem to execute a runnable based on a specified interval.
|
static void |
spawnTower(org.bukkit.entity.Player owner,
org.bukkit.inventory.ItemStack headItemStack,
org.bukkit.inventory.ItemStack bodyItemStack,
SkillUtils.TotemRunnable runnable,
int ticks,
int interval)
Spawns a tower (big totem) to execute a runnable based on a specified interval.
|
static void |
throwBackEntity(org.bukkit.entity.Entity entity,
org.bukkit.Location fromLocation,
double force)
Throws an entity back from a location.
|
static void |
throwEntitiesIntoAir(java.util.List<org.bukkit.entity.Entity> entities,
double force)
Throws multiple entities into the air.
|
static void |
throwEntity(org.bukkit.entity.Entity entity,
double x,
double y,
double z)
Throws an entity to given coordinates.
|
static void |
throwEntity(org.bukkit.entity.Entity entity,
org.bukkit.entity.Entity target)
Throws an entity to another entity.
|
static void |
throwEntity(org.bukkit.entity.Entity entity,
org.bukkit.Location location)
Throws an entity to a location.
|
static void |
throwEntityIntoAir(org.bukkit.entity.Entity entity,
double force)
Throws an entity into the air.
|
public static boolean isValidAttackTarget(org.bukkit.entity.Entity entity)
entity
- The entity to target.public static org.bukkit.entity.Entity getTargetInLine(org.bukkit.entity.Player player, int range)
player
- The player that is targeting.range
- The range of the line in blocks.public static java.util.List<org.bukkit.entity.Entity> getTargetsInLine(org.bukkit.entity.Player player, int range)
player
- The player that is targeting.range
- The range of the line in blocks.public static java.util.List<org.bukkit.entity.Entity> getTargetsInRadius(org.bukkit.Location location, double radius)
location
- The center to check around for targets.radius
- The radius from the center in blocks.public static java.util.List<org.bukkit.entity.Entity> getTargetsInRadius(org.bukkit.Location location, double radius, java.util.List<org.bukkit.entity.Entity> excludes)
location
- The center to check around for targets.radius
- The radius from the center in blocks.excludes
- Entities that should be ignored.public static java.util.List<org.bukkit.entity.Player> getPlayersInRadius(org.bukkit.Location location, int radius)
location
- The center to check around for players.radius
- The radius from the center in blocks.public static void addPotionEffect(java.util.List<org.bukkit.entity.Entity> entities, org.bukkit.potion.PotionEffectType potionEffectType, int duration, int amplifier)
entities
- The entities to receive the potion effect.potionEffectType
- The type of the effect.duration
- The duration of the effect in seconds.amplifier
- The strength of the effect. (Starts at 0)public static void addPotionEffect(org.bukkit.entity.Entity entity, org.bukkit.potion.PotionEffectType potionEffectType, int duration, int amplifier)
entity
- The entity to receive the potion effect.potionEffectType
- The type of the effect.duration
- The duration of the effect in seconds.amplifier
- The strength of the effect. (Starts at 0)public static void callPlayerMagicDamageEvent(org.bukkit.entity.Player player, java.util.List<org.bukkit.entity.Entity> entities, double damageMultiplier)
player
- The player who casted the attack.entities
- The entities that got hit by the attack.damageMultiplier
- The magic multiplier of the damage.callPlayerMagicDamageEvent(Player, Entity, double)
public static void callPlayerMagicDamageEvent(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity, double damageMultiplier)
player
- The player who casted the attack.entity
- The entity that got hit by the attack.damageMultiplier
- The magic multiplier of the damage.MobMetadataUtils.setMagicDamageMultiplier(Entity, double)
public static void callPlayerFixedDamageEvent(org.bukkit.entity.Player player, java.util.List<org.bukkit.entity.Entity> entities, double damage)
player
- The player who casted the attack.entities
- The entities that got hit by the attack.damage
- The fixed damage value.callPlayerFixedDamageEvent(Player, Entity, double)
public static void callPlayerFixedDamageEvent(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity, double damage)
player
- The player who casted the attack.entity
- The entity that got hit by the attack.damage
- The fixed damage value.MobMetadataUtils.setFixedDamage(Entity, boolean)
public static void callPlayerDamageOverTimeEvent(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity, org.bukkit.Color color, int damage, int ticks, int interval)
player
- The player who casted the attack.entity
- The entity that got hit by the attack.color
- The color of the damage particles.damage
- The fixed damage value.ticks
- How often the damage should be dealt.interval
- The server ticks between each damage.public static void spawnTotem(org.bukkit.entity.Player owner, org.bukkit.Material material, SkillUtils.TotemRunnable runnable, int ticks, int interval)
owner
- The player who summoned the totem.material
- The material of the totem head.runnable
- The runnable that should be executed.ticks
- How often the runnable should be executed.interval
- The server ticks between each execution.public static void spawnTower(org.bukkit.entity.Player owner, org.bukkit.inventory.ItemStack headItemStack, org.bukkit.inventory.ItemStack bodyItemStack, SkillUtils.TotemRunnable runnable, int ticks, int interval)
owner
- The player who summoned the tower.headItemStack
- The head of thr tower.bodyItemStack
- The body of the tower.runnable
- The runnable that should be executed.ticks
- How often the runnable should be executed.interval
- The server ticks between each execution.private static void callTotemEvent(org.bukkit.entity.Entity totem, SkillUtils.TotemRunnable runnable, int ticks, int interval)
totem
- The summoned totem.runnable
- The runnable that should be executed.ticks
- How often the runnable should be executed.interval
- The server ticks between each execution.public static void createExplosion(org.bukkit.Location location, float power)
location
- The location of the explosion.power
- The power of the explosion.public static void rotateEntity(org.bukkit.entity.Entity entity)
entity
- The entity to rotate.public static void throwEntity(org.bukkit.entity.Entity entity, org.bukkit.entity.Entity target)
entity
- The entity to throw.target
- The targeted entity.public static void throwEntity(org.bukkit.entity.Entity entity, org.bukkit.Location location)
entity
- The entity to throw.location
- The targeted location.public static void throwEntity(org.bukkit.entity.Entity entity, double x, double y, double z)
entity
- The entity to throw.x
- The targeted x coordinate.y
- The targeted y coordinate.z
- The targeted z coordinate.public static void throwEntitiesIntoAir(java.util.List<org.bukkit.entity.Entity> entities, double force)
entities
- The entities to throw.force
- The force to throw with.public static void throwEntityIntoAir(org.bukkit.entity.Entity entity, double force)
entity
- The entity to throw.force
- The force to throw with.public static void throwBackEntity(org.bukkit.entity.Entity entity, org.bukkit.Location fromLocation, double force)
entity
- The entity to throw.fromLocation
- The location to throw back from.force
- The force to throw with.public static org.bukkit.util.Vector getVectorForPoints(org.bukkit.Location originLocation, org.bukkit.Location targetLocation)
originLocation
- The starting location.targetLocation
- The targeted location.public static org.bukkit.util.Vector getThrowbackVector(org.bukkit.Location originLocation, org.bukkit.Location throwbackLocation, double force)
originLocation
- The starting location.throwbackLocation
- The throwback location.force
- The force away from the throwback location.