Package xyz.xenondevs.particle.data
Class VibrationData
java.lang.Object
xyz.xenondevs.particle.data.ParticleData
xyz.xenondevs.particle.data.VibrationData
This class holds all data that is needed by the client to display a
ParticleEffect.VIBRATION
particle. The required information is: The start Location (Only for pre 1.19 version), The destination
and the amount of ticks it will take the particle to fly this path.
Minecraft only supports full block coordinates for the start and destination location. So any particle will spawn at the center of a block. (Again, only for pre 1.19 versions. The client uses the normal spawn location of the particle since 1.19)
- Author:
- ByteZ
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionVibrationData(org.bukkit.entity.Entity destination, int ticks) Creates a newVibrationDatainstance.VibrationData(org.bukkit.Location destination, int ticks) Creates a newVibrationDatainstance.VibrationData(org.bukkit.Location start, org.bukkit.entity.Entity destination, int ticks) Creates a newVibrationDatainstance.VibrationData(org.bukkit.Location start, org.bukkit.Location destination, int ticks) Creates a newVibrationDatainstance. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.LocationGets the destinationLocationof the particle.org.bukkit.entity.EntityGets the destinationEntityof the particle.org.bukkit.LocationgetStart()Gets the startLocationof the particle.intgetTicks()Gets the amount of ticks it will take the particle to travel.Creates a new VibrationParticleOption instance with the data of the currentVibrationDatainstance.Methods inherited from class xyz.xenondevs.particle.data.ParticleData
getEffect, setEffect
-
Constructor Details
-
VibrationData
public VibrationData(org.bukkit.Location start, org.bukkit.Location destination, int ticks) Creates a newVibrationDatainstance.- Parameters:
start- the startLocationof the particle. (Not needed since 1.19)destination- the destinationLocationof the particle.ticks- the amount of ticks it will take the particle to reach theblockDestination
-
VibrationData
public VibrationData(org.bukkit.Location destination, int ticks) Creates a newVibrationDatainstance.- Parameters:
destination- the destinationLocationof the particle.ticks- the amount of ticks it will take the particle to reach theblockDestination
-
VibrationData
public VibrationData(org.bukkit.Location start, org.bukkit.entity.Entity destination, int ticks) Creates a newVibrationDatainstance.- Parameters:
start- the startLocationof the particle. (Not needed since 1.19)destination- the destinationEntityof the particle.ticks- the amount of ticks it will take the particle to reach theblockDestination
-
VibrationData
public VibrationData(org.bukkit.entity.Entity destination, int ticks) Creates a newVibrationDatainstance.- Parameters:
destination- the destinationEntityof the particle.ticks- the amount of ticks it will take the particle to reach theblockDestination
-
-
Method Details
-
getStart
public org.bukkit.Location getStart()Gets the startLocationof the particle.- Returns:
- the start
Locationof the particle.
-
getBlockDestination
public org.bukkit.Location getBlockDestination()Gets the destinationLocationof the particle.- Returns:
- the destination
Locationof the particle.
-
getEntityDestination
public org.bukkit.entity.Entity getEntityDestination()Gets the destinationEntityof the particle.- Returns:
- the destination
Entityof the particle.
-
getTicks
public int getTicks()Gets the amount of ticks it will take the particle to travel.- Returns:
- the travel time in ticks.
-
toNMSData
Creates a new VibrationParticleOption instance with the data of the currentVibrationDatainstance.Please note that this class is not supported in any versions before 1.17 and could lead to errors if used in legacy versions.
- Specified by:
toNMSDatain classParticleData- Returns:
- a new VibrationParticleOption with the data of the current
VibrationDatainstance.
-