Class ParticleSpawner
java.lang.Object
dev.esophose.playerparticles.particles.spawning.ParticleSpawner
- Direct Known Subclasses:
ReflectiveParticleSpawner,SpigotParticleSpawner
public abstract class ParticleSpawner
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParticleSpawner.ParticleColorExceptionRepresents a runtime exception that is thrown either if the displayed particle effect is not colorable or if the particle color type is incorrectstatic classParticleSpawner.ParticleDataExceptionRepresents a runtime exception that is thrown either if the displayed particle effect requires data and has none or vice-versa or if the data type is incorrect -
Constructor Summary
Constructors Constructor Description ParticleSpawner() -
Method Summary
Modifier and Type Method Description static booleancanSee(org.bukkit.entity.Player player, org.bukkit.entity.Player target)Checks if a player can see another playerabstract voiddisplay(ParticleEffect particleEffect, double offsetX, double offsetY, double offsetZ, double speed, int amount, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner)Displays a particle effectabstract voiddisplay(ParticleEffect particleEffect, ColorTransition colorTransition, double offsetX, double offsetY, double offsetZ, int amount, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner, float size)Displays a particle effect which requires additional data and is only visible for all players within a certain range in the world of @param centerabstract voiddisplay(ParticleEffect particleEffect, ParticleColor color, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner, float size)Displays a single particle which is coloredabstract voiddisplay(ParticleEffect particleEffect, Vibration vibration, double offsetX, double offsetY, double offsetZ, int amount, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner)Displays a particle effect which requires additional data and is only visible for all players within a certain range in the world of @param centerabstract voiddisplay(ParticleEffect particleEffect, org.bukkit.Material spawnMaterial, double offsetX, double offsetY, double offsetZ, double speed, int amount, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner)Displays a particle effect which requires additional data and is only visible for all players within a certain range in the world of @param centerstatic java.util.List<org.bukkit.entity.Player>getPlayersInRange(org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner)Gets a List of Players within the particle display range
-
Constructor Details
-
ParticleSpawner
public ParticleSpawner()
-
-
Method Details
-
display
public abstract void display(ParticleEffect particleEffect, double offsetX, double offsetY, double offsetZ, double speed, int amount, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner)Displays a particle effect- Parameters:
particleEffect- The particle type to displayoffsetX- 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 particlescenter- Center location of the effectisLongRange- If the particle can be viewed from long rangeowner- The player that owns the particles- Throws:
ParticleSpawner.ParticleDataException- If the particle effect requires additional data
-
display
public abstract void display(ParticleEffect particleEffect, ParticleColor color, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner, float size)Displays a single particle which is colored- Parameters:
particleEffect- The particle type to displaycolor- Color of the particlecenter- Center location of the effectisLongRange- If the particle can be viewed from long rangeowner- The player that owns the particlessize- The size of the particle- Throws:
ParticleSpawner.ParticleColorException- If the particle effect is not colorable or the color type is incorrect
-
display
public abstract void display(ParticleEffect particleEffect, org.bukkit.Material spawnMaterial, double offsetX, double offsetY, double offsetZ, double speed, int amount, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner)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- Parameters:
particleEffect- The particle type to displayspawnMaterial- Material of the 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 particlescenter- Center location of the effectisLongRange- If the particle can be viewed from long rangeowner- The player that owns the particles- Throws:
ParticleSpawner.ParticleDataException- If the particle effect does not require additional data or if the data type is incorrect
-
display
public abstract void display(ParticleEffect particleEffect, ColorTransition colorTransition, double offsetX, double offsetY, double offsetZ, int amount, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner, float size)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- Parameters:
particleEffect- The particle type to displaycolorTransition- Color transition of the 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-axisamount- Amount of particlescenter- Center location of the effectisLongRange- If the particle can be viewed from long rangeowner- The player that owns the particlessize- The size of the particles- Throws:
ParticleSpawner.ParticleDataException- If the particle effect does not require additional data or if the data type is incorrect
-
display
public abstract void display(ParticleEffect particleEffect, Vibration vibration, double offsetX, double offsetY, double offsetZ, int amount, org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner)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- Parameters:
particleEffect- The particle type to displayvibration- Vibration of the 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-axisamount- Amount of particlescenter- Center location of the effectisLongRange- If the particle can be viewed from long rangeowner- The player that owns the particles- Throws:
ParticleSpawner.ParticleDataException- If the particle effect does not require additional data or if the data type is incorrect
-
getPlayersInRange
public static java.util.List<org.bukkit.entity.Player> getPlayersInRange(org.bukkit.Location center, boolean isLongRange, org.bukkit.entity.Player owner)Gets a List of Players within the particle display range- Parameters:
center- The center of the radius to check aroundisLongRange- If the particle can be viewed from long rangeowner- The player that owns the particles- Returns:
- A List of Players within the particle display range
-
canSee
public static boolean canSee(org.bukkit.entity.Player player, org.bukkit.entity.Player target)Checks if a player can see another player- Parameters:
player- The playertarget- The target- Returns:
- True if player can see target, otherwise false
-