Package dev.cwhead.GravesX.manager
Class ParticleManager
java.lang.Object
dev.cwhead.GravesX.manager.ParticleManager
Spawns particles to graves.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Vibration
buildVibrationSingle
(Graves plugin, org.bukkit.Location graveLoc, Grave grave) getGravesBlockData
(Grave grave, org.bukkit.Location loc) Return your Graves BlockData for this grave if available.org.bukkit.inventory.ItemStack
parseItemStack
(Grave grave) Parse an ItemStack from config (material only; amount 1).parseTrailData
(Graves plugin, Grave grave) Try to construct Particle.Trail reflectively to avoid compile-time dependency.org.bukkit.Color
Resolve a Bukkit Color from text, with a default fallback.void
spawnVibrationBounce
(Graves plugin, org.bukkit.Location graveLoc, Grave grave, org.bukkit.Particle particle, int count) Build a Vibration instance from config, using block or entity destination.void
startCompassParticleTrail
(org.bukkit.Location startLocation, org.bukkit.Location endLocation, org.bukkit.Particle particleType, int count, double speed, long durationTicks, UUID playerUUID) Plays a particle trail from start to end, stepping one block/tick (or as configured).org.bukkit.block.data.BlockData
toBukkitBlockData
(BlockData gravesBD) Convert your Graves BlockData to Bukkit BlockData for vanilla particle APIs.
-
Constructor Details
-
ParticleManager
-
-
Method Details
-
startCompassParticleTrail
public void startCompassParticleTrail(org.bukkit.Location startLocation, org.bukkit.Location endLocation, org.bukkit.Particle particleType, int count, double speed, long durationTicks, UUID playerUUID) Plays a particle trail from start to end, stepping one block/tick (or as configured). Each step is executed on the owning region of the current step location so that trails can cross region/chunk boundaries safely.- Parameters:
startLocation
- start anchor (not mutated)endLocation
- end anchor (not mutated)particleType
- particle type to spawncount
- particle count per stepspeed
- step length in blocks per tick (e.g., 0.5 = half a block/tick)durationTicks
- maximum lifetime of the trail in ticksplayerUUID
- who triggered the trail (used for cooldown)
-
getGravesBlockData
Return your Graves BlockData for this grave if available. If the grave has no attached BlockData, synthesize one from config as a fallback so the pipeline is consistent. -
toBukkitBlockData
Convert your Graves BlockData to Bukkit BlockData for vanilla particle APIs. Uses replaceData if present; otherwise uses replaceMaterial. -
parseItemStack
Parse an ItemStack from config (material only; amount 1).- Returns:
- ItemStack or STONE if invalid.
-
safeColor
Resolve a Bukkit Color from text, with a default fallback. Accepts names ("RED"), hex ("#FF0000"), or "r,g,b". -
buildVibrationSingle
-
spawnVibrationBounce
public void spawnVibrationBounce(Graves plugin, org.bukkit.Location graveLoc, Grave grave, org.bukkit.Particle particle, int count) Build a Vibration instance from config, using block or entity destination. Falls back to a block destination at the origin if parsing fails. -
parseTrailData
Try to construct Particle.Trail reflectively to avoid compile-time dependency. Supports (int duration, double spread), (int), and no-arg constructors.
-