p)
- {
- for(Player i : p)
- {
- play(l, i);
- }
- }
-}
diff --git a/src/main/java/ninja/bytecode/iris/util/ParticleEffect.java b/src/main/java/ninja/bytecode/iris/util/ParticleEffect.java
deleted file mode 100644
index ba2f68f5a..000000000
--- a/src/main/java/ninja/bytecode/iris/util/ParticleEffect.java
+++ /dev/null
@@ -1,2101 +0,0 @@
-package ninja.bytecode.iris.util;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.bukkit.Bukkit;
-import org.bukkit.Color;
-import org.bukkit.Location;
-import org.bukkit.Material;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-import ninja.bytecode.iris.util.ParticleEffect.ParticleData;
-import ninja.bytecode.iris.util.ReflectionUtils.PackageType;
-
-/**
- * ParticleEffect Library
- *
- * This library was created by @DarkBlade12 and allows you to display all
- * Minecraft particle effects on a Bukkit server
- *
- * You are welcome to use it, modify it and redistribute it under the following
- * conditions:
- *
- * - Don't claim this class as your own
- *
- Don't remove this disclaimer
- *
- *
- * Special thanks:
- *
- * - @microgeek (original idea, names and packet parameters)
- *
- @ShadyPotato (1.8 names, ids and packet parameters)
- *
- @RingOfStorms (particle behavior)
- *
- @Cybermaxke (particle behavior)
- *
- @JamieSinn (hosting a jenkins server and documentation for
- * particleeffect)
- *
- *
- * It would be nice if you provide credit to me if you use this class in a
- * published project
- *
- * @author DarkBlade12
- * @version 1.7
- */
-@SuppressWarnings("unused")
-public enum ParticleEffect
-{
- /**
- * A particle effect which is displayed by exploding tnt and creepers:
- *
- * - It looks like a white cloud
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- EXPLOSION_NORMAL("explode", 0, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by exploding ghast fireballs and wither
- * skulls:
- *
- * - It looks like a gray ball which is fading away
- *
- The speed value slightly influences the size of this particle effect
- *
- */
- EXPLOSION_LARGE("largeexplode", 1, -1),
- /**
- * A particle effect which is displayed by exploding tnt and creepers:
- *
- * - It looks like a crowd of gray balls which are fading away
- *
- The speed value has no influence on this particle effect
- *
- */
- EXPLOSION_HUGE("hugeexplosion", 2, -1),
- /**
- * A particle effect which is displayed by launching fireworks:
- *
- * - It looks like a white star which is sparkling
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- FIREWORKS_SPARK("fireworksSpark", 3, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by swimming entities and arrows in
- * water:
- *
- * - It looks like a bubble
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- WATER_BUBBLE("bubble", 4, -1, ParticleProperty.DIRECTIONAL, ParticleProperty.REQUIRES_WATER),
- /**
- * A particle effect which is displayed by swimming entities and shaking wolves:
- *
- * - It looks like a blue drop
- *
- The speed value has no influence on this particle effect
- *
- */
- WATER_SPLASH("splash", 5, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed on water when fishing:
- *
- * - It looks like a blue droplet
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- WATER_WAKE("wake", 6, 7, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by water:
- *
- * - It looks like a tiny blue square
- *
- The speed value has no influence on this particle effect
- *
- */
- SUSPENDED("suspended", 7, -1, ParticleProperty.REQUIRES_WATER),
- /**
- * A particle effect which is displayed by air when close to bedrock and the in
- * the void:
- *
- * - It looks like a tiny gray square
- *
- The speed value has no influence on this particle effect
- *
- */
- SUSPENDED_DEPTH("depthSuspend", 8, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed when landing a critical hit and by
- * arrows:
- *
- * - It looks like a light brown cross
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- CRIT("crit", 9, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed when landing a hit with an enchanted
- * weapon:
- *
- * - It looks like a cyan star
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- CRIT_MAGIC("magicCrit", 10, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by primed tnt, torches, droppers,
- * dispensers, end portals, brewing stands and monster spawners:
- *
- * - It looks like a little gray cloud
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- SMOKE_NORMAL("smoke", 11, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by fire, minecarts with furnace and
- * blazes:
- *
- * - It looks like a large gray cloud
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- SMOKE_LARGE("largesmoke", 12, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed when splash potions or bottles o'
- * enchanting hit something:
- *
- * - It looks like a white swirl
- *
- The speed value causes the particle to only move upwards when set to 0
- *
- Only the motion on the y-axis can be controlled, the motion on the x- and
- * z-axis are multiplied by 0.1 when setting the values to 0
- *
- */
- SPELL("spell", 13, -1),
- /**
- * A particle effect which is displayed when instant splash potions hit
- * something:
- *
- * - It looks like a white cross
- *
- The speed value causes the particle to only move upwards when set to 0
- *
- Only the motion on the y-axis can be controlled, the motion on the x- and
- * z-axis are multiplied by 0.1 when setting the values to 0
- *
- */
- SPELL_INSTANT("instantSpell", 14, -1),
- /**
- * A particle effect which is displayed by entities with active potion effects:
- *
- * - It looks like a colored swirl
- *
- The speed value causes the particle to be colored black when set to 0
- *
- The particle color gets lighter when increasing the speed and darker when
- * decreasing the speed
- *
- */
- SPELL_MOB("mobSpell", 15, -1, ParticleProperty.COLORABLE),
- /**
- * A particle effect which is displayed by entities with active potion effects
- * applied through a beacon:
- *
- * - It looks like a transparent colored swirl
- *
- The speed value causes the particle to be always colored black when set
- * to 0
- *
- The particle color gets lighter when increasing the speed and darker when
- * decreasing the speed
- *
- */
- SPELL_MOB_AMBIENT("mobSpellAmbient", 16, -1, ParticleProperty.COLORABLE),
- /**
- * A particle effect which is displayed by witches:
- *
- * - It looks like a purple cross
- *
- The speed value causes the particle to only move upwards when set to 0
- *
- Only the motion on the y-axis can be controlled, the motion on the x- and
- * z-axis are multiplied by 0.1 when setting the values to 0
- *
- */
- SPELL_WITCH("witchMagic", 17, -1),
- /**
- * A particle effect which is displayed by blocks beneath a water source:
- *
- * - It looks like a blue drip
- *
- The speed value has no influence on this particle effect
- *
- */
- DRIP_WATER("dripWater", 18, -1),
- /**
- * A particle effect which is displayed by blocks beneath a lava source:
- *
- * - It looks like an orange drip
- *
- The speed value has no influence on this particle effect
- *
- */
- DRIP_LAVA("dripLava", 19, -1),
- /**
- * A particle effect which is displayed when attacking a villager in a village:
- *
- * - It looks like a cracked gray heart
- *
- The speed value has no influence on this particle effect
- *
- */
- VILLAGER_ANGRY("angryVillager", 20, -1),
- /**
- * A particle effect which is displayed when using bone meal and trading with a
- * villager in a village:
- *
- * - It looks like a green star
- *
- The speed value has no influence on this particle effect
- *
- */
- VILLAGER_HAPPY("happyVillager", 21, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by mycelium:
- *
- * - It looks like a tiny gray square
- *
- The speed value has no influence on this particle effect
- *
- */
- TOWN_AURA("townaura", 22, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by note blocks:
- *
- * - It looks like a colored note
- *
- The speed value causes the particle to be colored green when set to 0
- *
- */
- NOTE("note", 23, -1, ParticleProperty.COLORABLE),
- /**
- * A particle effect which is displayed by nether portals, endermen, ender
- * pearls, eyes of ender, ender chests and dragon eggs:
- *
- * - It looks like a purple cloud
- *
- The speed value influences the spread of this particle effect
- *
- */
- PORTAL("portal", 24, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by enchantment tables which are nearby
- * bookshelves:
- *
- * - It looks like a cryptic white letter
- *
- The speed value influences the spread of this particle effect
- *
- */
- ENCHANTMENT_TABLE("enchantmenttable", 25, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by torches, active furnaces, magma cubes
- * and monster spawners:
- *
- * - It looks like a tiny flame
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- FLAME("flame", 26, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by lava:
- *
- * - It looks like a spark
- *
- The speed value has no influence on this particle effect
- *
- */
- LAVA("lava", 27, -1),
- /**
- * A particle effect which is currently unused:
- *
- * - It looks like a transparent gray square
- *
- The speed value has no influence on this particle effect
- *
- */
- FOOTSTEP("footstep", 28, -1),
- /**
- * A particle effect which is displayed when a mob dies:
- *
- * - It looks like a large white cloud
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- CLOUD("cloud", 29, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by redstone ore, powered redstone,
- * redstone torches and redstone repeaters:
- *
- * - It looks like a tiny colored cloud
- *
- The speed value causes the particle to be colored red when set to 0
- *
- */
- REDSTONE("reddust", 30, -1, ParticleProperty.COLORABLE),
- /**
- * A particle effect which is displayed when snowballs hit a block:
- *
- * - It looks like a little piece with the snowball texture
- *
- The speed value has no influence on this particle effect
- *
- */
- SNOWBALL("snowballpoof", 31, -1),
- /**
- * A particle effect which is currently unused:
- *
- * - It looks like a tiny white cloud
- *
- The speed value influences the velocity at which the particle flies off
- *
- */
- SNOW_SHOVEL("snowshovel", 32, -1, ParticleProperty.DIRECTIONAL),
- /**
- * A particle effect which is displayed by slimes:
- *
- * - It looks like a tiny part of the slimeball icon
- *
- The speed value has no influence on this particle effect
- *
- */
- SLIME("slime", 33, -1),
- /**
- * A particle effect which is displayed when breeding and taming animals:
- *
- * - It looks like a red heart
- *
- The speed value has no influence on this particle effect
- *
- */
- HEART("heart", 34, -1),
- /**
- * A particle effect which is displayed by barriers:
- *
- * - It looks like a red box with a slash through it
- *
- The speed value has no influence on this particle effect
- *
- */
- BARRIER("barrier", 35, 8),
- /**
- * A particle effect which is displayed when breaking a tool or eggs hit a
- * block:
- *
- * - It looks like a little piece with an item texture
- *
- */
- ITEM_CRACK("iconcrack", 36, -1, ParticleProperty.DIRECTIONAL, ParticleProperty.REQUIRES_DATA),
- /**
- * A particle effect which is displayed when breaking blocks or sprinting:
- *
- * - It looks like a little piece with a block texture
- *
- The speed value has no influence on this particle effect
- *
- */
- BLOCK_CRACK("blockcrack", 37, -1, ParticleProperty.REQUIRES_DATA),
- /**
- * A particle effect which is displayed when falling:
- *
- * - It looks like a little piece with a block texture
- *
- */
- BLOCK_DUST("blockdust", 38, 7, ParticleProperty.DIRECTIONAL, ParticleProperty.REQUIRES_DATA),
- /**
- * A particle effect which is displayed when rain hits the ground:
- *
- * - It looks like a blue droplet
- *
- The speed value has no influence on this particle effect
- *
- */
- WATER_DROP("droplet", 39, 8),
- /**
- * A particle effect which is currently unused:
- *
- * - It has no visual effect
- *
- */
- ITEM_TAKE("take", 40, 8),
-
- /**
- * A particle effect which is displayed by elder guardians:
- *
- * - It looks like the shape of the elder guardian
- *
- The speed value has no influence on this particle effect
- *
- The offset values have no influence on this particle effect
- *
- */
- MOB_APPEARANCE("mobappearance", 41, 8),
-
- /**
- * A particle effect which is displayed by enderdragons
- */
- DRAGON_BREATH("dragonbreath", 42, 9),
-
- /**
- * The end rod particle effect from end rods
- */
- END_ROD("endrod", 43, 9),
-
- /**
- * A damage indicator particle effect
- */
- DAMAGE_INDICATOR("damageindicator", 44, 9),
-
- /**
- * A swipe sword effect
- */
- SWEEP_ATTACK("sweepttack", 45, 9);
-
- private static final Map NAME_MAP = new HashMap();
- private static final Map ID_MAP = new HashMap();
- private final String name;
- private final int id;
- private final int requiredVersion;
- private final List properties;
-
- // Initialize map for quick name and id lookup
- static
- {
- for(ParticleEffect effect : values())
- {
- NAME_MAP.put(effect.name, effect);
- ID_MAP.put(effect.id, effect);
- }
- }
-
- /**
- * Construct a new particle effect
- *
- * @param name
- * Name of this particle effect
- * @param id
- * Id of this particle effect
- * @param requiredVersion
- * Version which is required (1.x)
- * @param properties
- * Properties of this particle effect
- */
- private ParticleEffect(String name, int id, int requiredVersion, ParticleProperty... properties)
- {
- this.name = name;
- this.id = id;
- this.requiredVersion = requiredVersion;
- this.properties = Arrays.asList(properties);
- }
-
- /**
- * Returns the name of this particle effect
- *
- * @return The name
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Returns the id of this particle effect
- *
- * @return The id
- */
- public int getId()
- {
- return id;
- }
-
- /**
- * Returns the required version for this particle effect (1.x)
- *
- * @return The required version
- */
- public int getRequiredVersion()
- {
- return requiredVersion;
- }
-
- /**
- * Determine if this particle effect has a specific property
- *
- * @return Whether it has the property or not
- */
- public boolean hasProperty(ParticleProperty property)
- {
- return properties.contains(property);
- }
-
- /**
- * Determine if this particle effect is supported by your current server version
- *
- * @return Whether the particle effect is supported or not
- */
- public boolean isSupported()
- {
- return true;
- }
-
- /**
- * Returns the particle effect with the given name
- *
- * @param name
- * Name of the particle effect
- * @return The particle effect
- */
- public static ParticleEffect fromName(String name)
- {
- for(Entry entry : NAME_MAP.entrySet())
- {
- if(!entry.getKey().equalsIgnoreCase(name))
- {
- continue;
- }
- return entry.getValue();
- }
- return null;
- }
-
- /**
- * Returns the particle effect with the given id
- *
- * @param id
- * Id of the particle effect
- * @return The particle effect
- */
- public static ParticleEffect fromId(int id)
- {
- for(Entry entry : ID_MAP.entrySet())
- {
- if(entry.getKey() != id)
- {
- continue;
- }
- return entry.getValue();
- }
- return null;
- }
-
- /**
- * Determine if water is at a certain location
- *
- * @param location
- * Location to check
- * @return Whether water is at this location or not
- */
- private static boolean isWater(Location location)
- {
- Material material = location.getBlock().getType();
- return false;
- }
-
- /**
- * Determine if the distance between @param location and one of the players
- * exceeds 256
- *
- * @param location
- * Location to check
- * @return Whether the distance exceeds 256 or not
- */
- private static boolean isLongDistance(Location location, List players)
- {
- String world = location.getWorld().getName();
- for(Player player : players)
- {
- Location playerLocation = player.getLocation();
- if(!world.equals(playerLocation.getWorld().getName()) || playerLocation.distanceSquared(location) < 65536)
- {
- continue;
- }
- return true;
- }
- return false;
- }
-
- /**
- * Determine if the data type for a particle effect is correct
- *
- * @param effect
- * Particle effect
- * @param data
- * Particle data
- * @return Whether the data type is correct or not
- */
- private static boolean isDataCorrect(ParticleEffect effect, ParticleData data)
- {
- return ((effect == BLOCK_CRACK || effect == BLOCK_DUST) && data instanceof BlockData) || (effect == ITEM_CRACK && data instanceof ItemData);
- }
-
- /**
- * Determine if the color type for a particle effect is correct
- *
- * @param effect
- * Particle effect
- * @param color
- * Particle color
- * @return Whether the color type is correct or not
- */
- private static boolean isColorCorrect(ParticleEffect effect, ParticleColor color)
- {
- return ((effect == SPELL_MOB || effect == SPELL_MOB_AMBIENT || effect == REDSTONE) && color instanceof OrdinaryColor) || (effect == NOTE && color instanceof NoteColor);
- }
-
- /**
- * Displays a particle effect which is only visible for all players within a
- * certain range in the world of @param center
- *
- * @param offsetX
- * Maximum distance particles can fly away from the center on the
- * x-axis
- * @param offsetY
- * Maximum distance particles can fly away from the center on the
- * y-axis
- * @param offsetZ
- * Maximum distance particles can fly away from the center on the
- * z-axis
- * @param speed
- * Display speed of the particles
- * @param amount
- * Amount of particles
- * @param center
- * Center location of the effect
- * @param range
- * Range of the visibility
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleDataException
- * If the particle effect requires additional data
- * @throws IllegalArgumentException
- * If the particle effect requires water and none is at the center
- * location
- * @see ParticlePacket
- * @see ParticlePacket#sendTo(Location, double)
- */
- public void display(float speed, int amount, Location center, double range) throws ParticleVersionException, ParticleDataException, IllegalArgumentException
- {
- if(!isSupported())
- {
- return;
- }
-
- if(hasProperty(ParticleProperty.REQUIRES_DATA))
- {
- throw new ParticleDataException("This particle effect requires additional data");
- }
-
- if(hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center))
- {
- throw new IllegalArgumentException("There is no water at the center location");
- }
-
- new ParticlePacket(this, 0, 0, 0, speed, amount, range > 256, null).sendTo(center, range);
- }
-
- /**
- * Displays a particle effect which is only visible for the specified players
- *
- * @param offsetX
- * Maximum distance particles can fly away from the center on the
- * x-axis
- * @param offsetY
- * Maximum distance particles can fly away from the center on the
- * y-axis
- * @param offsetZ
- * Maximum distance particles can fly away from the center on the
- * z-axis
- * @param speed
- * Display speed of the particles
- * @param amount
- * Amount of particles
- * @param center
- * Center location of the effect
- * @param players
- * Receivers of the effect
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleDataException
- * If the particle effect requires additional data
- * @throws IllegalArgumentException
- * If the particle effect requires water and none is at the center
- * location
- * @see ParticlePacket
- * @see ParticlePacket#sendTo(Location, List)
- */
- public void display(float speed, int amount, Location center, List players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException
- {
- if(!isSupported())
- {
- throw new ParticleVersionException("This particle effect is not supported by your server version");
- }
- if(hasProperty(ParticleProperty.REQUIRES_DATA))
- {
- throw new ParticleDataException("This particle effect requires additional data");
- }
- if(hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center))
- {
- throw new IllegalArgumentException("There is no water at the center location");
- }
- new ParticlePacket(this, 0, 0, 0, speed, amount, isLongDistance(center, players), null).sendTo(center, players);
- }
-
- /**
- * Displays a particle effect which is only visible for the specified players
- *
- * @param offsetX
- * Maximum distance particles can fly away from the center on the
- * x-axis
- * @param offsetY
- * Maximum distance particles can fly away from the center on the
- * y-axis
- * @param offsetZ
- * Maximum distance particles can fly away from the center on the
- * z-axis
- * @param speed
- * Display speed of the particles
- * @param amount
- * Amount of particles
- * @param center
- * Center location of the effect
- * @param players
- * Receivers of the effect
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleDataException
- * If the particle effect requires additional data
- * @throws IllegalArgumentException
- * If the particle effect requires water and none is at the center
- * location
- * @see #display(float, float, float, float, int, Location, List)
- */
- public void display(float speed, int amount, Location center, Player... players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException
- {
- display(speed, amount, center, Arrays.asList(players));
- }
-
- /**
- * Displays a single particle which flies into a determined direction and is
- * only visible for all players within a certain range in the world of @param
- * center
- *
- * @param direction
- * Direction of the particle
- * @param speed
- * Display speed of the particle
- * @param center
- * Center location of the effect
- * @param range
- * Range of the visibility
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleDataException
- * If the particle effect requires additional data
- * @throws IllegalArgumentException
- * If the particle effect is not directional or if it requires water
- * and none is at the center location
- * @see ParticlePacket#ParticlePacket(ParticleEffect, Vector, float, boolean,
- * ParticleData)
- * @see ParticlePacket#sendTo(Location, double)
- */
- public void display(Vector direction, float speed, Location center, double range) throws ParticleVersionException, ParticleDataException, IllegalArgumentException
- {
- if(!isSupported())
- {
- throw new ParticleVersionException("This particle effect is not supported by your server version");
- }
- if(hasProperty(ParticleProperty.REQUIRES_DATA))
- {
- throw new ParticleDataException("This particle effect requires additional data");
- }
- if(!hasProperty(ParticleProperty.DIRECTIONAL))
- {
- throw new IllegalArgumentException("This particle effect is not directional");
- }
- if(hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center))
- {
- throw new IllegalArgumentException("There is no water at the center location");
- }
- new ParticlePacket(this, direction, speed, range > 256, null).sendTo(center, range);
- }
-
- /**
- * Displays a single particle which flies into a determined direction and is
- * only visible for the specified players
- *
- * @param direction
- * Direction of the particle
- * @param speed
- * Display speed of the particle
- * @param center
- * Center location of the effect
- * @param players
- * Receivers of the effect
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleDataException
- * If the particle effect requires additional data
- * @throws IllegalArgumentException
- * If the particle effect is not directional or if it requires water
- * and none is at the center location
- * @see ParticlePacket#ParticlePacket(ParticleEffect, Vector, float, boolean,
- * ParticleData)
- * @see ParticlePacket#sendTo(Location, List)
- */
- public void display(Vector direction, float speed, Location center, List players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException
- {
- if(!isSupported())
- {
- throw new ParticleVersionException("This particle effect is not supported by your server version");
- }
- if(hasProperty(ParticleProperty.REQUIRES_DATA))
- {
- throw new ParticleDataException("This particle effect requires additional data");
- }
- if(!hasProperty(ParticleProperty.DIRECTIONAL))
- {
- throw new IllegalArgumentException("This particle effect is not directional");
- }
- if(hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center))
- {
- throw new IllegalArgumentException("There is no water at the center location");
- }
- new ParticlePacket(this, direction, speed, isLongDistance(center, players), null).sendTo(center, players);
- }
-
- /**
- * Displays a single particle which flies into a determined direction and is
- * only visible for the specified players
- *
- * @param direction
- * Direction of the particle
- * @param speed
- * Display speed of the particle
- * @param center
- * Center location of the effect
- * @param players
- * Receivers of the effect
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleDataException
- * If the particle effect requires additional data
- * @throws IllegalArgumentException
- * If the particle effect is not directional or if it requires water
- * and none is at the center location
- * @see #display(Vector, float, Location, List)
- */
- public void display(Vector direction, float speed, Location center, Player... players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException
- {
- display(direction, speed, center, Arrays.asList(players));
- }
-
- /**
- * Displays a single particle which is colored and only visible for all players
- * within a certain range in the world of @param center
- *
- * @param color
- * Color of the particle
- * @param center
- * Center location of the effect
- * @param range
- * Range of the visibility
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleColorException
- * If the particle effect is not colorable or the color type is
- * incorrect
- * @see ParticlePacket#ParticlePacket(ParticleEffect, ParticleColor, boolean)
- * @see ParticlePacket#sendTo(Location, double)
- */
- public void display(ParticleColor color, Location center, double range) throws ParticleVersionException, ParticleColorException
- {
- if(!isSupported())
- {
- throw new ParticleVersionException("This particle effect is not supported by your server version");
- }
- if(!hasProperty(ParticleProperty.COLORABLE))
- {
- throw new ParticleColorException("This particle effect is not colorable");
- }
- if(!isColorCorrect(this, color))
- {
- throw new ParticleColorException("The particle color type is incorrect");
- }
- new ParticlePacket(this, color, range > 256).sendTo(center, range);
- }
-
- /**
- * Displays a single particle which is colored and only visible for the
- * specified players
- *
- * @param color
- * Color of the particle
- * @param center
- * Center location of the effect
- * @param players
- * Receivers of the effect
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleColorException
- * If the particle effect is not colorable or the color type is
- * incorrect
- * @see ParticlePacket#ParticlePacket(ParticleEffect, ParticleColor, boolean)
- * @see ParticlePacket#sendTo(Location, List)
- */
- public void display(ParticleColor color, Location center, List players) throws ParticleVersionException, ParticleColorException
- {
- if(!isSupported())
- {
- throw new ParticleVersionException("This particle effect is not supported by your server version");
- }
- if(!hasProperty(ParticleProperty.COLORABLE))
- {
- throw new ParticleColorException("This particle effect is not colorable");
- }
- if(!isColorCorrect(this, color))
- {
- throw new ParticleColorException("The particle color type is incorrect");
- }
- new ParticlePacket(this, color, isLongDistance(center, players)).sendTo(center, players);
- }
-
- /**
- * Displays a single particle which is colored and only visible for the
- * specified players
- *
- * @param color
- * Color of the particle
- * @param center
- * Center location of the effect
- * @param players
- * Receivers of the effect
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleColorException
- * If the particle effect is not colorable or the color type is
- * incorrect
- * @see #display(ParticleColor, Location, List)
- */
- public void display(ParticleColor color, Location center, Player... players) throws ParticleVersionException, ParticleColorException
- {
- display(color, center, Arrays.asList(players));
- }
-
- /**
- * Displays a particle effect which requires additional data and is only visible
- * for all players within a certain range in the world of @param center
- *
- * @param data
- * Data of the effect
- * @param offsetX
- * Maximum distance particles can fly away from the center on the
- * x-axis
- * @param offsetY
- * Maximum distance particles can fly away from the center on the
- * y-axis
- * @param offsetZ
- * Maximum distance particles can fly away from the center on the
- * z-axis
- * @param speed
- * Display speed of the particles
- * @param amount
- * Amount of particles
- * @param center
- * Center location of the effect
- * @param range
- * Range of the visibility
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleDataException
- * If the particle effect does not require additional data or if the
- * data type is incorrect
- * @see ParticlePacket
- * @see ParticlePacket#sendTo(Location, double)
- */
- public void display(ParticleData data, float speed, int amount, Location center, double range) throws ParticleVersionException, ParticleDataException
- {
- if(!isSupported())
- {
- throw new ParticleVersionException("This particle effect is not supported by your server version");
- }
-
- if(!hasProperty(ParticleProperty.REQUIRES_DATA))
- {
- throw new ParticleDataException("This particle effect does not require additional data");
- }
-
- if(!isDataCorrect(this, data))
- {
- throw new ParticleDataException("The particle data type is incorrect");
- }
-
- new ParticlePacket(this, 0, 0, 0, speed, amount, range > 256, data).sendTo(center, range);
- }
-
- /**
- * Displays a particle effect which requires additional data and is only visible
- * for the specified players
- *
- * @param data
- * Data of the effect
- * @param offsetX
- * Maximum distance particles can fly away from the center on the
- * x-axis
- * @param offsetY
- * Maximum distance particles can fly away from the center on the
- * y-axis
- * @param offsetZ
- * Maximum distance particles can fly away from the center on the
- * z-axis
- * @param speed
- * Display speed of the particles
- * @param amount
- * Amount of particles
- * @param center
- * Center location of the effect
- * @param players
- * Receivers of the effect
- * @throws ParticleVersionException
- * If the particle effect is not supported by the server version
- * @throws ParticleDataException
- * If the particle effect does not require additional data or if the
- * data type is incorrect
- * @see ParticlePacket
- * @see ParticlePacket#sendTo(Location, List)
- */
- public void display(ParticleData data, float speed, int amount, Location center, List