public static final class ParticleEffect.ParticlePacket
extends java.lang.Object
| Constructor and Description |
|---|
ParticlePacket(ParticleEffect effect,
float offsetX,
float offsetY,
float offsetZ,
float speed,
int amount,
boolean longDistance,
ParticleEffect.ParticleData data)
Construct a new particle packet
|
ParticlePacket(ParticleEffect effect,
ParticleEffect.ParticleColor color,
boolean longDistance)
Construct a new particle packet of a single colored particle
|
ParticlePacket(ParticleEffect effect,
org.bukkit.util.Vector direction,
float speed,
boolean longDistance,
ParticleEffect.ParticleData data)
Construct a new particle packet of a single particle flying into a determined direction
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getVersion()
Returns the version of your server (1.x)
|
static void |
initialize()
Initializes
packetConstructor,
getHandle,
playerConnection
and
sendPacket
and sets initialized
to true if it succeeds
Note: These fields only have to be initialized once, so it will return if initialized
is already set to true |
static boolean |
isInitialized()
|
void |
sendTo(org.bukkit.Location center,
double range)
Sends the packet to all players in a certain range
|
void |
sendTo(org.bukkit.Location center,
java.util.List<org.bukkit.entity.Player> players)
Sends the packet to all players in the list
|
void |
sendTo(org.bukkit.Location center,
org.bukkit.entity.Player player)
Sends the packet to a single player and caches it
|
public ParticlePacket(ParticleEffect effect, float offsetX, float offsetY, float offsetZ, float speed, int amount, boolean longDistance, ParticleEffect.ParticleData data) throws java.lang.IllegalArgumentException
effect - Particle effectoffsetX - Maximum distance particles can fly away from the center on the x-axisoffsetY - Maximum distance particles can fly away from the center on the y-axisoffsetZ - Maximum distance particles can fly away from the center on the z-axisspeed - Display speed of the particlesamount - Amount of particleslongDistance - Indicates whether the maximum distance is increased from 256 to 65536data - Data of the effectjava.lang.IllegalArgumentException - If the speed or amount is lower than 0initialize()public ParticlePacket(ParticleEffect effect, org.bukkit.util.Vector direction, float speed, boolean longDistance, ParticleEffect.ParticleData data) throws java.lang.IllegalArgumentException
effect - Particle effectdirection - Direction of the particlespeed - Display speed of the particlelongDistance - Indicates whether the maximum distance is increased from 256 to 65536data - Data of the effectjava.lang.IllegalArgumentException - If the speed is lower than 0public ParticlePacket(ParticleEffect effect, ParticleEffect.ParticleColor color, boolean longDistance)
effect - Particle effectcolor - Color of the particlelongDistance - Indicates whether the maximum distance is increased from 256 to 65536public static void initialize()
throws com.massivecraft.factions.util.Particles.ParticleEffect.ParticlePacket.VersionIncompatibleException
packetConstructor, getHandle, playerConnection and sendPacket and sets initialized to true if it succeeds
Note: These fields only have to be initialized once, so it will return if initialized
is already set to trueVersionIncompatibleException - if your bukkit version is not supported by this librarycom.massivecraft.factions.util.Particles.ParticleEffect.ParticlePacket.VersionIncompatibleExceptionpublic static int getVersion()
public static boolean isInitialized()
initialize()public void sendTo(org.bukkit.Location center,
org.bukkit.entity.Player player)
throws com.massivecraft.factions.util.Particles.ParticleEffect.ParticlePacket.PacketInstantiationException,
com.massivecraft.factions.util.Particles.ParticleEffect.ParticlePacket.PacketSendingException
center - Center location of the effectplayer - Receiver of the packetPacketInstantiationException - If instantion fails due to an unknown errorPacketSendingException - If sending fails due to an unknown errorcom.massivecraft.factions.util.Particles.ParticleEffect.ParticlePacket.PacketInstantiationExceptioncom.massivecraft.factions.util.Particles.ParticleEffect.ParticlePacket.PacketSendingExceptioninitializePacket(Location)public void sendTo(org.bukkit.Location center,
java.util.List<org.bukkit.entity.Player> players)
throws java.lang.IllegalArgumentException
center - Center location of the effectplayers - Receivers of the packetjava.lang.IllegalArgumentException - If the player list is emptysendTo(Location center, Player player)public void sendTo(org.bukkit.Location center,
double range)
throws java.lang.IllegalArgumentException
center - Center location of the effectrange - Range in which players will receive the packet (Maximum range for particles is usually 16, but it can differ for some types)java.lang.IllegalArgumentException - If the range is lower than 1sendTo(Location center, Player player)