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
ConstructorDescriptionVibrationData
(org.bukkit.entity.Entity destination, int ticks) Creates a newVibrationData
instance.VibrationData
(org.bukkit.Location destination, int ticks) Creates a newVibrationData
instance.VibrationData
(org.bukkit.Location start, org.bukkit.entity.Entity destination, int ticks) Creates a newVibrationData
instance.VibrationData
(org.bukkit.Location start, org.bukkit.Location destination, int ticks) Creates a newVibrationData
instance. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Location
Gets the destinationLocation
of the particle.org.bukkit.entity.Entity
Gets the destinationEntity
of the particle.org.bukkit.Location
getStart()
Gets the startLocation
of the particle.int
getTicks()
Gets the amount of ticks it will take the particle to travel.Creates a new VibrationParticleOption instance with the data of the currentVibrationData
instance.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 newVibrationData
instance.- Parameters:
start
- the startLocation
of the particle. (Not needed since 1.19)destination
- the destinationLocation
of 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 newVibrationData
instance.- Parameters:
destination
- the destinationLocation
of 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 newVibrationData
instance.- Parameters:
start
- the startLocation
of the particle. (Not needed since 1.19)destination
- the destinationEntity
of 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 newVibrationData
instance.- Parameters:
destination
- the destinationEntity
of 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 startLocation
of the particle.- Returns:
- the start
Location
of the particle.
-
getBlockDestination
public org.bukkit.Location getBlockDestination()Gets the destinationLocation
of the particle.- Returns:
- the destination
Location
of the particle.
-
getEntityDestination
public org.bukkit.entity.Entity getEntityDestination()Gets the destinationEntity
of the particle.- Returns:
- the destination
Entity
of 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 currentVibrationData
instance.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:
toNMSData
in classParticleData
- Returns:
- a new VibrationParticleOption with the data of the current
VibrationData
instance.
-