├── README.md ├── pom.xml └── src └── main └── java └── hm └── zelha └── particlesfx ├── particles ├── ParticleAngry.java ├── ParticleAsh.java ├── ParticleAshWhite.java ├── ParticleBlockBreak.java ├── ParticleBlockCrumble.java ├── ParticleBlockDust.java ├── ParticleBlockMarker.java ├── ParticleBubble.java ├── ParticleBubblePop.java ├── ParticleCampfireCosy.java ├── ParticleCampfireSignal.java ├── ParticleCherryLeaves.java ├── ParticleCloud.java ├── ParticleCrimsonSpore.java ├── ParticleCrit.java ├── ParticleCurrentDown.java ├── ParticleDamage.java ├── ParticleDragonBreath.java ├── ParticleDustColored.java ├── ParticleDustMulticolored.java ├── ParticleDustPlume.java ├── ParticleEffect.java ├── ParticleEffectColored.java ├── ParticleEnchant.java ├── ParticleEnchantedHit.java ├── ParticleEndRod.java ├── ParticleEnderSignal.java ├── ParticleExplosion.java ├── ParticleExplosionEmitter.java ├── ParticleFirefly.java ├── ParticleFirework.java ├── ParticleFishing.java ├── ParticleFlame.java ├── ParticleFlameSmall.java ├── ParticleFlameSoul.java ├── ParticleFlash.java ├── ParticleGlow.java ├── ParticleGlowInk.java ├── ParticleGust.java ├── ParticleGustEmitterLarge.java ├── ParticleGustEmitterSmall.java ├── ParticleGustSmall.java ├── ParticleHappy.java ├── ParticleHeart.java ├── ParticleHoney.java ├── ParticleInfested.java ├── ParticleInstantEffect.java ├── ParticleItemBreak.java ├── ParticleLava.java ├── ParticleLavaPop.java ├── ParticleMycelium.java ├── ParticleNautilus.java ├── ParticleNectar.java ├── ParticleNote.java ├── ParticleNull.java ├── ParticleObsidianTear.java ├── ParticleOmenRaid.java ├── ParticleOmenTrial.java ├── ParticleOminous.java ├── ParticlePaleOakLeaves.java ├── ParticlePoof.java ├── ParticlePortal.java ├── ParticleScrape.java ├── ParticleSculkCharge.java ├── ParticleSculkChargePop.java ├── ParticleShriek.java ├── ParticleSmoke.java ├── ParticleSmokeLarge.java ├── ParticleSmokeWhite.java ├── ParticleSneeze.java ├── ParticleSnowflake.java ├── ParticleSonicBoom.java ├── ParticleSoul.java ├── ParticleSoulSculk.java ├── ParticleSpit.java ├── ParticleSplash.java ├── ParticleSporeBlossom.java ├── ParticleSquidInk.java ├── ParticleSweepAttack.java ├── ParticleTintedLeaves.java ├── ParticleTotem.java ├── ParticleTrail.java ├── ParticleTrialOminous.java ├── ParticleTrialSpawner.java ├── ParticleUnderwater.java ├── ParticleVault.java ├── ParticleVibration.java ├── ParticleWarpedSpore.java ├── ParticleWater.java ├── ParticleWaxOff.java ├── ParticleWaxOn.java ├── ParticleWitch.java └── parents │ ├── ColorableParticle.java │ ├── IParticle.java │ ├── LiquidParticle.java │ ├── MaterialParticle.java │ ├── Particle.java │ ├── SizeableParticle.java │ └── TravellingParticle.java ├── shapers ├── ParticleCircle.java ├── ParticleCircleFilled.java ├── ParticleCylinder.java ├── ParticleFluid.java ├── ParticleImage.java ├── ParticleLine.java ├── ParticleLineCurved.java ├── ParticlePolygon.java ├── ParticlePolygonFilled.java ├── ParticleSphere.java ├── ParticleSphereCSA.java ├── ParticleSpiral.java ├── ParticleText.java └── parents │ ├── ParticleShaper.java │ ├── RotationHandler.java │ └── Shape.java └── util ├── ArrayListSafe.java ├── CircleInfo.java ├── Color.java ├── Corner.java ├── CurveInfo.java ├── LVMath.java ├── LiquidParticleState.java ├── LocationSafe.java ├── Pair.java ├── ParticleSFX.java ├── ParticleShapeCompound.java ├── PolygonLayer.java ├── Rotation.java └── ShapeDisplayMechanic.java /src/main/java/hm/zelha/particlesfx/particles/ParticleAngry.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleAngry extends Particle { 6 | public ParticleAngry(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("angry_villager", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleAngry(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleAngry(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleAngry() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleAngry inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleAngry clone() { 31 | return new ParticleAngry().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleAsh.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleAsh extends Particle { 6 | public ParticleAsh(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("ash", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleAsh(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleAsh(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleAsh() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleAsh inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleAsh clone() { 31 | return new ParticleAsh().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleAshWhite.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleAshWhite extends Particle { 6 | public ParticleAshWhite(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("white_ash", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleAshWhite(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleAshWhite(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleAshWhite() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleAshWhite inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleAshWhite clone() { 31 | return new ParticleAshWhite().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleBlockBreak.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.MaterialParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import net.minecraft.core.particles.ParticleParamBlock; 6 | import net.minecraft.core.registries.BuiltInRegistries; 7 | import net.minecraft.resources.MinecraftKey; 8 | import org.apache.commons.lang.Validate; 9 | import org.bukkit.Material; 10 | import org.bukkit.craftbukkit.v1_21_R5.block.data.CraftBlockData; 11 | import org.bukkit.craftbukkit.v1_21_R5.util.CraftMagicNumbers; 12 | 13 | public class ParticleBlockBreak extends Particle implements MaterialParticle { 14 | public ParticleBlockBreak(Material material, double offsetX, double offsetY, double offsetZ, int count) { 15 | super("", offsetX, offsetY, offsetZ, count); 16 | 17 | setMaterial(material); 18 | } 19 | 20 | public ParticleBlockBreak(double offsetX, double offsetY, double offsetZ, int count) { 21 | this(Material.DRAGON_EGG, offsetX, offsetY, offsetZ, count); 22 | } 23 | 24 | public ParticleBlockBreak(Material material, double offsetX, double offsetY, double offsetZ) { 25 | this(material, offsetX, offsetY, offsetZ, 1); 26 | } 27 | 28 | public ParticleBlockBreak(double offsetX, double offsetY, double offsetZ) { 29 | this(Material.DRAGON_EGG, offsetX, offsetY, offsetZ, 1); 30 | } 31 | 32 | public ParticleBlockBreak(Material material, int count) { 33 | this(material, 0, 0, 0, count); 34 | } 35 | 36 | public ParticleBlockBreak(Material material) { 37 | this(material, 0, 0, 0, 1); 38 | } 39 | 40 | public ParticleBlockBreak(int count) { 41 | this(Material.DRAGON_EGG, 0, 0, 0, count); 42 | } 43 | 44 | public ParticleBlockBreak() { 45 | this(Material.DRAGON_EGG, 0, 0, 0, 1); 46 | } 47 | 48 | @Override 49 | public ParticleBlockBreak inherit(Particle particle) { 50 | super.inherit(particle); 51 | 52 | if (particle instanceof MaterialParticle) { 53 | setMaterial(((MaterialParticle) particle).getMaterial()); 54 | } 55 | 56 | return this; 57 | } 58 | 59 | @Override 60 | public ParticleBlockBreak clone() { 61 | return new ParticleBlockBreak().inherit(this); 62 | } 63 | 64 | public void setMaterial(Material material) { 65 | Validate.notNull(material, "Material cannot be null!"); 66 | Validate.isTrue(material.isBlock(), "Material must be a block!"); 67 | 68 | particle = new ParticleParamBlock((net.minecraft.core.particles.Particle) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "block")), ((CraftBlockData) material.createBlockData()).getState()); 69 | } 70 | 71 | public Material getMaterial() { 72 | return CraftMagicNumbers.getMaterial(((ParticleParamBlock) particle).b().b()); 73 | } 74 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleBlockCrumble.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.MaterialParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import net.minecraft.core.particles.ParticleParamBlock; 6 | import net.minecraft.core.registries.BuiltInRegistries; 7 | import net.minecraft.resources.MinecraftKey; 8 | import org.apache.commons.lang.Validate; 9 | import org.bukkit.Material; 10 | import org.bukkit.craftbukkit.v1_21_R5.block.data.CraftBlockData; 11 | import org.bukkit.craftbukkit.v1_21_R5.util.CraftMagicNumbers; 12 | 13 | public class ParticleBlockCrumble extends Particle implements MaterialParticle { 14 | public ParticleBlockCrumble(Material material, double offsetX, double offsetY, double offsetZ, int count) { 15 | super("", offsetX, offsetY, offsetZ, count); 16 | 17 | setMaterial(material); 18 | } 19 | 20 | public ParticleBlockCrumble(double offsetX, double offsetY, double offsetZ, int count) { 21 | this(Material.DRAGON_EGG, offsetX, offsetY, offsetZ, count); 22 | } 23 | 24 | public ParticleBlockCrumble(Material material, double offsetX, double offsetY, double offsetZ) { 25 | this(material, offsetX, offsetY, offsetZ, 1); 26 | } 27 | 28 | public ParticleBlockCrumble(double offsetX, double offsetY, double offsetZ) { 29 | this(Material.DRAGON_EGG, offsetX, offsetY, offsetZ, 1); 30 | } 31 | 32 | public ParticleBlockCrumble(Material material, int count) { 33 | this(material, 0, 0, 0, count); 34 | } 35 | 36 | public ParticleBlockCrumble(Material material) { 37 | this(material, 0, 0, 0, 1); 38 | } 39 | 40 | public ParticleBlockCrumble(int count) { 41 | this(Material.DRAGON_EGG, 0, 0, 0, count); 42 | } 43 | 44 | public ParticleBlockCrumble() { 45 | this(Material.DRAGON_EGG, 0, 0, 0, 1); 46 | } 47 | 48 | @Override 49 | public ParticleBlockCrumble inherit(Particle particle) { 50 | super.inherit(particle); 51 | 52 | if (particle instanceof MaterialParticle) { 53 | setMaterial(((MaterialParticle) particle).getMaterial()); 54 | } 55 | 56 | return this; 57 | } 58 | 59 | @Override 60 | public ParticleBlockCrumble clone() { 61 | return new ParticleBlockCrumble().inherit(this); 62 | } 63 | 64 | public void setMaterial(Material material) { 65 | Validate.notNull(material, "Material cannot be null!"); 66 | Validate.isTrue(material.isBlock(), "Material must be a block!"); 67 | 68 | particle = new ParticleParamBlock((net.minecraft.core.particles.Particle) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "block_crumble")), ((CraftBlockData) material.createBlockData()).getState()); 69 | } 70 | 71 | public Material getMaterial() { 72 | return CraftMagicNumbers.getMaterial(((ParticleParamBlock) particle).b().b()); 73 | } 74 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleBlockDust.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.MaterialParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import net.minecraft.core.particles.ParticleParamBlock; 6 | import net.minecraft.core.registries.BuiltInRegistries; 7 | import net.minecraft.resources.MinecraftKey; 8 | import org.apache.commons.lang.Validate; 9 | import org.bukkit.Material; 10 | import org.bukkit.craftbukkit.v1_21_R5.block.data.CraftBlockData; 11 | import org.bukkit.craftbukkit.v1_21_R5.util.CraftMagicNumbers; 12 | 13 | public class ParticleBlockDust extends Particle implements MaterialParticle { 14 | public ParticleBlockDust(Material material, double offsetX, double offsetY, double offsetZ, int count) { 15 | super("", offsetX, offsetY, offsetZ, count); 16 | 17 | setMaterial(material); 18 | } 19 | 20 | public ParticleBlockDust(double offsetX, double offsetY, double offsetZ, int count) { 21 | this(Material.DRAGON_EGG, offsetX, offsetY, offsetZ, count); 22 | } 23 | 24 | public ParticleBlockDust(Material material, double offsetX, double offsetY, double offsetZ) { 25 | this(material,offsetX, offsetY, offsetZ, 1); 26 | } 27 | 28 | public ParticleBlockDust(double offsetX, double offsetY, double offsetZ) { 29 | this(Material.DRAGON_EGG, offsetX, offsetY, offsetZ, 1); 30 | } 31 | 32 | public ParticleBlockDust(Material material, int count) { 33 | this(material, 0, 0, 0, count); 34 | } 35 | 36 | public ParticleBlockDust(Material material) { 37 | this(material, 0, 0, 0, 1); 38 | } 39 | 40 | public ParticleBlockDust(int count) { 41 | this(Material.DRAGON_EGG, 0, 0, 0, count); 42 | } 43 | 44 | public ParticleBlockDust() { 45 | this(Material.DRAGON_EGG, 0, 0, 0, 1); 46 | } 47 | 48 | @Override 49 | public ParticleBlockDust inherit(Particle particle) { 50 | super.inherit(particle); 51 | 52 | if (particle instanceof MaterialParticle) { 53 | setMaterial(((MaterialParticle) particle).getMaterial()); 54 | } 55 | 56 | return this; 57 | } 58 | 59 | @Override 60 | public ParticleBlockDust clone() { 61 | return new ParticleBlockDust().inherit(this); 62 | } 63 | 64 | public void setMaterial(Material material) { 65 | Validate.notNull(material, "Material cannot be null!"); 66 | Validate.isTrue(material.isBlock(), "Material must be a block!"); 67 | 68 | particle = new ParticleParamBlock((net.minecraft.core.particles.Particle) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "falling_dust")), ((CraftBlockData) material.createBlockData()).getState()); 69 | } 70 | 71 | public Material getMaterial() { 72 | return CraftMagicNumbers.getMaterial(((ParticleParamBlock) particle).b().b()); 73 | } 74 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleBlockMarker.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.MaterialParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import net.minecraft.core.particles.ParticleParamBlock; 6 | import net.minecraft.core.registries.BuiltInRegistries; 7 | import net.minecraft.resources.MinecraftKey; 8 | import org.apache.commons.lang.Validate; 9 | import org.bukkit.Material; 10 | import org.bukkit.craftbukkit.v1_21_R5.block.data.CraftBlockData; 11 | import org.bukkit.craftbukkit.v1_21_R5.util.CraftMagicNumbers; 12 | 13 | public class ParticleBlockMarker extends Particle implements MaterialParticle { 14 | public ParticleBlockMarker(Material material, double offsetX, double offsetY, double offsetZ, int count) { 15 | super("", offsetX, offsetY, offsetZ, count); 16 | 17 | setMaterial(material); 18 | } 19 | 20 | public ParticleBlockMarker(double offsetX, double offsetY, double offsetZ, int count) { 21 | this(Material.BARRIER, offsetX, offsetY, offsetZ, count); 22 | } 23 | 24 | public ParticleBlockMarker(Material material, double offsetX, double offsetY, double offsetZ) { 25 | this(material,offsetX, offsetY, offsetZ, 1); 26 | } 27 | 28 | public ParticleBlockMarker(double offsetX, double offsetY, double offsetZ) { 29 | this(Material.BARRIER, offsetX, offsetY, offsetZ, 1); 30 | } 31 | 32 | public ParticleBlockMarker(Material material, int count) { 33 | this(material, 0, 0, 0, count); 34 | } 35 | 36 | public ParticleBlockMarker(Material material) { 37 | this(material, 0, 0, 0, 1); 38 | } 39 | 40 | public ParticleBlockMarker(int count) { 41 | this(Material.BARRIER, 0, 0, 0, count); 42 | } 43 | 44 | public ParticleBlockMarker() { 45 | this(Material.BARRIER, 0, 0, 0, 1); 46 | } 47 | 48 | @Override 49 | public ParticleBlockMarker inherit(Particle particle) { 50 | super.inherit(particle); 51 | 52 | if (particle instanceof MaterialParticle) { 53 | setMaterial(((MaterialParticle) particle).getMaterial()); 54 | } 55 | 56 | return this; 57 | } 58 | 59 | @Override 60 | public ParticleBlockMarker clone() { 61 | return new ParticleBlockMarker().inherit(this); 62 | } 63 | 64 | public void setMaterial(Material material) { 65 | Validate.notNull(material, "Material cannot be null!"); 66 | Validate.isTrue(material.isBlock(), "Material must be a block!"); 67 | 68 | particle = new ParticleParamBlock((net.minecraft.core.particles.Particle) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "block_marker")), ((CraftBlockData) material.createBlockData()).getState()); 69 | } 70 | 71 | public Material getMaterial() { 72 | return CraftMagicNumbers.getMaterial(((ParticleParamBlock) particle).b().b()); 73 | } 74 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleBubble.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | /** 9 | * this particle almost instantly disappears when displayed out of water, which can be displeasing to the eyes 10 | */ 11 | public class ParticleBubble extends TravellingParticle { 12 | /**@see ParticleBubble*/ 13 | public ParticleBubble(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("bubble", false, 0.755, null, toGo, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | /**@see ParticleBubble*/ 18 | public ParticleBubble(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 19 | super("bubble", false, 0.755, velocity, null, offsetX, offsetY, offsetZ, count); 20 | } 21 | 22 | /**@see ParticleBubble*/ 23 | public ParticleBubble(Location toGo, double offsetX, double offsetY, double offsetZ) { 24 | this(toGo, offsetX, offsetY, offsetZ, 1); 25 | } 26 | 27 | /**@see ParticleBubble*/ 28 | public ParticleBubble(Vector velocity, double offsetX, double offsetY, double offsetZ) { 29 | this(velocity, offsetX, offsetY, offsetZ, 1); 30 | } 31 | 32 | /**@see ParticleBubble*/ 33 | public ParticleBubble(double offsetX, double offsetY, double offsetZ, int count) { 34 | this((Location) null, offsetX, offsetY, offsetZ, count); 35 | } 36 | 37 | /**@see ParticleBubble*/ 38 | public ParticleBubble(double offsetX, double offsetY, double offsetZ) { 39 | this((Location) null, offsetX, offsetY, offsetZ, 1); 40 | } 41 | 42 | /**@see ParticleBubble*/ 43 | public ParticleBubble(int count) { 44 | this((Location) null, 0, 0, 0, count); 45 | } 46 | 47 | /**@see ParticleBubble*/ 48 | public ParticleBubble(Location toGo) { 49 | this(toGo, 0, 0, 0, 1); 50 | } 51 | 52 | /**@see ParticleBubble*/ 53 | public ParticleBubble(Vector velocity) { 54 | this(velocity, 0, 0, 0, 1); 55 | } 56 | 57 | /**@see ParticleBubble*/ 58 | public ParticleBubble() { 59 | this((Location) null, 0, 0, 0, 1); 60 | } 61 | 62 | @Override 63 | public ParticleBubble inherit(Particle particle) { 64 | super.inherit(particle); 65 | 66 | return this; 67 | } 68 | 69 | @Override 70 | public ParticleBubble clone() { 71 | return new ParticleBubble().inherit(this); 72 | } 73 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleBubblePop.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleBubblePop extends TravellingParticle { 9 | public ParticleBubblePop(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("bubble_pop", false, 0.26, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleBubblePop(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("bubble_pop", false, 0.26, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleBubblePop(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleBubblePop(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleBubblePop(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleBubblePop(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleBubblePop(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleBubblePop(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleBubblePop(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleBubblePop() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleBubblePop inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleBubblePop clone() { 58 | return new ParticleBubblePop().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleCampfireCosy.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleCampfireCosy extends TravellingParticle { 9 | public ParticleCampfireCosy(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("campfire_cosy_smoke", false, 0.009, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleCampfireCosy(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("campfire_cosy_smoke", false, 0.009, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleCampfireCosy(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleCampfireCosy(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleCampfireCosy(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleCampfireCosy(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleCampfireCosy(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleCampfireCosy(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleCampfireCosy(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleCampfireCosy() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleCampfireCosy inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleCampfireCosy clone() { 58 | return new ParticleCampfireCosy().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleCampfireSignal.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleCampfireSignal extends TravellingParticle { 9 | public ParticleCampfireSignal(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("campfire_signal_smoke", false, 0.003, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleCampfireSignal(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("campfire_signal_smoke", false, 0.003, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleCampfireSignal(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleCampfireSignal(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleCampfireSignal(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleCampfireSignal(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleCampfireSignal(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleCampfireSignal(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleCampfireSignal(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleCampfireSignal() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleCampfireSignal inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleCampfireSignal clone() { 58 | return new ParticleCampfireSignal().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleCherryLeaves.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleCherryLeaves extends Particle { 6 | public ParticleCherryLeaves(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("cherry_leaves", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleCherryLeaves(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleCherryLeaves(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleCherryLeaves() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleCherryLeaves inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleCherryLeaves clone() { 31 | return new ParticleCherryLeaves().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleCloud.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleCloud extends TravellingParticle { 9 | public ParticleCloud(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("cloud", false, 0.05, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleCloud(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("cloud", false, 0.05, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleCloud(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleCloud(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleCloud(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleCloud(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleCloud(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleCloud(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleCloud(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleCloud() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleCloud inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleCloud clone() { 58 | return new ParticleCloud().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleCrimsonSpore.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleCrimsonSpore extends Particle { 6 | public ParticleCrimsonSpore(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("crimson_spore", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleCrimsonSpore(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleCrimsonSpore(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleCrimsonSpore() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleCrimsonSpore inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleCrimsonSpore clone() { 31 | return new ParticleCrimsonSpore().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleCrit.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleCrit extends TravellingParticle { 9 | public ParticleCrit(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("crit", false, 0.82, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleCrit(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("crit", false, 0.82, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleCrit(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleCrit(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleCrit(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleCrit(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleCrit(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleCrit(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleCrit(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleCrit() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleCrit inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleCrit clone() { 58 | return new ParticleCrit().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleCurrentDown.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | /** 6 | * this particle almost instantly disappears when displayed out of water, which can be displeasing to the eyes 7 | */ 8 | public class ParticleCurrentDown extends Particle { 9 | /** @see ParticleCurrentDown */ 10 | public ParticleCurrentDown(double offsetX, double offsetY, double offsetZ, int count) { 11 | super("current_down", offsetX, offsetY, offsetZ, count); 12 | } 13 | 14 | /** @see ParticleCurrentDown */ 15 | public ParticleCurrentDown(double offsetX, double offsetY, double offsetZ) { 16 | this(offsetX, offsetY, offsetZ, 1); 17 | } 18 | 19 | /** @see ParticleCurrentDown */ 20 | public ParticleCurrentDown(int count) { 21 | this(0, 0, 0, count); 22 | } 23 | 24 | /** @see ParticleCurrentDown */ 25 | public ParticleCurrentDown() { 26 | this(0, 0, 0, 1); 27 | } 28 | 29 | @Override 30 | public ParticleCurrentDown inherit(Particle particle) { 31 | super.inherit(particle); 32 | 33 | return this; 34 | } 35 | 36 | @Override 37 | public ParticleCurrentDown clone() { 38 | return new ParticleCurrentDown().inherit(this); 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleDamage.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleDamage extends TravellingParticle { 9 | public ParticleDamage(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("damage_indicator", false, 0.69, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleDamage(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("damage_indicator", false, 0.69, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleDamage(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleDamage(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleDamage(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleDamage(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleDamage(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleDamage(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleDamage(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleDamage() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleDamage inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleDamage clone() { 58 | return new ParticleDamage().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleDragonBreath.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleDragonBreath extends TravellingParticle { 9 | public ParticleDragonBreath(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("dragon_breath", false, 0.025, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleDragonBreath(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("dragon_breath", false, 0.025, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleDragonBreath(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleDragonBreath(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleDragonBreath(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleDragonBreath(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleDragonBreath(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleDragonBreath(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleDragonBreath(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleDragonBreath() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleDragonBreath inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleDragonBreath clone() { 58 | return new ParticleDragonBreath().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleDustColored.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.ColorableParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.particles.parents.SizeableParticle; 6 | import hm.zelha.particlesfx.util.Color; 7 | import net.minecraft.core.particles.ParticleParamRedstone; 8 | import net.minecraft.util.MathHelper; 9 | import org.bukkit.Location; 10 | import org.bukkit.craftbukkit.v1_21_R5.entity.CraftPlayer; 11 | 12 | import javax.annotation.Nullable; 13 | import java.util.List; 14 | 15 | public class ParticleDustColored extends Particle implements SizeableParticle, ColorableParticle { 16 | 17 | protected final Color colorHelper = new Color(rng.nextInt(0xffffff)); 18 | protected Color color; 19 | protected double size; 20 | 21 | public ParticleDustColored(@Nullable Color color, double size, double offsetX, double offsetY, double offsetZ, int count) { 22 | super("", offsetX, offsetY, offsetZ, count); 23 | 24 | particle = new ParticleParamRedstone((color == null) ? rng.nextInt(0xffffff) : color.getRGB(), (float) size); 25 | 26 | if (color != null) colorHelper.setRGB(color.getRGB()); 27 | 28 | setColor(color); 29 | setSize(size); 30 | } 31 | 32 | public ParticleDustColored(double size, double offsetX, double offsetY, double offsetZ, int count) { 33 | this(null, size, offsetX, offsetY, offsetZ, count); 34 | } 35 | 36 | public ParticleDustColored(@Nullable Color color, double offsetX, double offsetY, double offsetZ, int count) { 37 | this(color, 1, offsetX, offsetY, offsetZ, count); 38 | } 39 | 40 | public ParticleDustColored(double offsetX, double offsetY, double offsetZ, int count) { 41 | this(null, 1, offsetX, offsetY, offsetZ, count); 42 | } 43 | 44 | public ParticleDustColored(@Nullable Color color, double offsetX, double offsetY, double offsetZ) { 45 | this(color, 1, offsetX, offsetY, offsetZ, 1); 46 | } 47 | 48 | public ParticleDustColored(double size, double offsetX, double offsetY, double offsetZ) { 49 | this(null, size, offsetX, offsetY, offsetZ, 1); 50 | } 51 | 52 | public ParticleDustColored(double offsetX, double offsetY, double offsetZ) { 53 | this(null, 1, offsetX, offsetY, offsetZ, 1); 54 | } 55 | 56 | public ParticleDustColored(@Nullable Color color, double size, int count) { 57 | this(color, size, 0, 0, 0, count); 58 | } 59 | 60 | public ParticleDustColored(@Nullable Color color, double size) { 61 | this(color, size, 0, 0, 0, 1); 62 | } 63 | 64 | public ParticleDustColored(@Nullable Color color) { 65 | this(color, 1, 0, 0, 0, 1); 66 | } 67 | 68 | public ParticleDustColored(int count) { 69 | this(null, 1, 0, 0, 0, count); 70 | } 71 | 72 | public ParticleDustColored(double size) { 73 | this(null, size, 0, 0, 0, 1); 74 | } 75 | 76 | public ParticleDustColored() { 77 | this(null, 1, 0, 0, 0, 1); 78 | } 79 | 80 | @Override 81 | public ParticleDustColored inherit(Particle particle) { 82 | super.inherit(particle); 83 | 84 | if (particle instanceof ColorableParticle) { 85 | setColor(((ColorableParticle) particle).getColor()); 86 | } 87 | 88 | if (particle instanceof SizeableParticle) { 89 | setSize(((SizeableParticle) particle).getSize()); 90 | } 91 | 92 | return this; 93 | } 94 | 95 | @Override 96 | public ParticleDustColored clone() { 97 | return new ParticleDustColored().inherit(this); 98 | } 99 | 100 | @Override 101 | protected void display(Location location, List players) { 102 | if (particle instanceof ParticleParamRedstone) { 103 | if (color == null) { 104 | particle = new ParticleParamRedstone(rng.nextInt(0xffffff), (float) size); 105 | } else if (!colorHelper.equals(color) || MathHelper.a(size, 0.01F, 4.0F) != ((ParticleParamRedstone) particle).d()) { 106 | particle = new ParticleParamRedstone(color.getRGB(), (float) size); 107 | 108 | colorHelper.setRGB(color.getRGB()); 109 | } 110 | } 111 | 112 | super.display(location, players); 113 | } 114 | 115 | public void setColor(@Nullable Color color) { 116 | this.color = color; 117 | } 118 | 119 | public void setColor(int red, int green, int blue) { 120 | if (color != null && !color.isLocked()) { 121 | color.setRed(red); 122 | color.setGreen(green); 123 | color.setBlue(blue); 124 | } else { 125 | this.color = new Color(red, green, blue); 126 | } 127 | } 128 | 129 | /** only changes between 0 and 4. */ 130 | @Override 131 | public void setSize(double size) { 132 | this.size = size; 133 | } 134 | 135 | @Nullable 136 | public Color getColor() { 137 | return color; 138 | } 139 | 140 | /** only changes between 0 and 4. */ 141 | @Override 142 | public double getSize() { 143 | return size; 144 | } 145 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleDustMulticolored.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.ColorableParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.particles.parents.SizeableParticle; 6 | import hm.zelha.particlesfx.util.Color; 7 | import net.minecraft.core.particles.DustColorTransitionOptions; 8 | import net.minecraft.core.particles.DustParticleOptionsBase; 9 | import net.minecraft.util.MathHelper; 10 | import org.bukkit.Location; 11 | import org.bukkit.craftbukkit.v1_21_R5.entity.CraftPlayer; 12 | 13 | import javax.annotation.Nullable; 14 | import java.util.List; 15 | 16 | public class ParticleDustMulticolored extends ParticleDustColored implements SizeableParticle, ColorableParticle { 17 | 18 | protected final Color colorHelper2 = new Color(rng.nextInt(0xffffff)); 19 | private Color transition = null; 20 | 21 | public ParticleDustMulticolored(@Nullable Color color, double size, double offsetX, double offsetY, double offsetZ, int count) { 22 | super(color, size, offsetX, offsetY, offsetZ, count); 23 | 24 | particle = new DustColorTransitionOptions((color == null) ? rng.nextInt(0xffffff) : color.getRGB(), (transition == null) ? rng.nextInt(0xffffff) : transition.getRGB(), (float) size); 25 | } 26 | 27 | public ParticleDustMulticolored(double size, double offsetX, double offsetY, double offsetZ, int count) { 28 | this(null, size, offsetX, offsetY, offsetZ, count); 29 | } 30 | 31 | public ParticleDustMulticolored(@Nullable Color color, double offsetX, double offsetY, double offsetZ, int count) { 32 | this(color, 1, offsetX, offsetY, offsetZ, count); 33 | } 34 | 35 | public ParticleDustMulticolored(double offsetX, double offsetY, double offsetZ, int count) { 36 | this(null, 1, offsetX, offsetY, offsetZ, count); 37 | } 38 | 39 | public ParticleDustMulticolored(@Nullable Color color, double offsetX, double offsetY, double offsetZ) { 40 | this(color, 1, offsetX, offsetY, offsetZ, 1); 41 | } 42 | 43 | public ParticleDustMulticolored(double size, double offsetX, double offsetY, double offsetZ) { 44 | this(null, size, offsetX, offsetY, offsetZ, 1); 45 | } 46 | 47 | public ParticleDustMulticolored(double offsetX, double offsetY, double offsetZ) { 48 | this(null, 1, offsetX, offsetY, offsetZ, 1); 49 | } 50 | 51 | public ParticleDustMulticolored(@Nullable Color color, double size, int count) { 52 | this(color, size, 0, 0, 0, count); 53 | } 54 | 55 | public ParticleDustMulticolored(@Nullable Color color, double size) { 56 | this(color, size, 0, 0, 0, 1); 57 | } 58 | 59 | public ParticleDustMulticolored(@Nullable Color color) { 60 | this(color, 1, 0, 0, 0, 1); 61 | } 62 | 63 | public ParticleDustMulticolored(int count) { 64 | this(null, 1, 0, 0, 0, count); 65 | } 66 | 67 | public ParticleDustMulticolored(double size) { 68 | this(null, size, 0, 0, 0, 1); 69 | } 70 | 71 | public ParticleDustMulticolored() { 72 | this(null, 1, 0, 0, 0, 1); 73 | } 74 | 75 | @Override 76 | public ParticleDustMulticolored inherit(Particle particle) { 77 | super.inherit(particle); 78 | 79 | if (particle instanceof ParticleDustMulticolored) { 80 | this.transition = ((ParticleDustMulticolored) particle).transition; 81 | } 82 | 83 | return this; 84 | } 85 | 86 | @Override 87 | public ParticleDustMulticolored clone() { 88 | return new ParticleDustMulticolored().inherit(this); 89 | } 90 | 91 | @Override 92 | protected void display(Location location, List players) { 93 | if (color == null || transition == null) { 94 | particle = new DustColorTransitionOptions((color == null) ? rng.nextInt(0xffffff) : color.getRGB(), (transition == null) ? rng.nextInt(0xffffff) : transition.getRGB(), (float) size); 95 | } else if (!colorHelper.equals(color) || !colorHelper2.equals(transition) || MathHelper.a(size, 0.01F, 4.0F) != ((DustParticleOptionsBase) particle).d()) { 96 | particle = new DustColorTransitionOptions(color.getRGB(), transition.getRGB(), (float) size); 97 | 98 | colorHelper.setRGB(color.getRGB()); 99 | colorHelper2.setRGB(transition.getRGB()); 100 | } 101 | 102 | super.display(location, players); 103 | } 104 | 105 | /** 106 | * @param transition the color this particle will transition to as it fades. 107 | */ 108 | public ParticleDustMulticolored setTransitionColor(@Nullable Color transition) { 109 | this.transition = transition; 110 | 111 | return this; 112 | } 113 | 114 | /** 115 | * @return the color this particle will transition to as it fades. 116 | */ 117 | public Color getTransitionColor() { 118 | return transition; 119 | } 120 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleDustPlume.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleDustPlume extends TravellingParticle { 9 | public ParticleDustPlume(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("dust_plume", false, 0.235, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleDustPlume(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("dust_plume", false, 0.235, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleDustPlume(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleDustPlume(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleDustPlume(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleDustPlume(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleDustPlume(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleDustPlume(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleDustPlume(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleDustPlume() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleDustPlume inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleDustPlume clone() { 58 | return new ParticleDustPlume().inherit(this); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleEffect.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleEffect extends Particle { 6 | public ParticleEffect(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("effect", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleEffect(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleEffect(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleEffect() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleEffect inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleEffect clone() { 31 | return new ParticleEffect().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleEffectColored.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.ColorableParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.util.Color; 6 | import net.minecraft.core.particles.ColorParticleOption; 7 | import net.minecraft.core.registries.BuiltInRegistries; 8 | import net.minecraft.resources.MinecraftKey; 9 | import org.bukkit.Location; 10 | import org.bukkit.craftbukkit.v1_21_R5.entity.CraftPlayer; 11 | 12 | import javax.annotation.Nullable; 13 | import java.util.List; 14 | 15 | public class ParticleEffectColored extends Particle implements ColorableParticle { 16 | 17 | private final net.minecraft.core.particles.Particle registryParticle = (net.minecraft.core.particles.Particle) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "entity_effect")); 18 | protected Color color; 19 | private int transparency = 255; 20 | 21 | public ParticleEffectColored(@Nullable Color color, int transparency, double offsetX, double offsetY, double offsetZ, int count) { 22 | super("", offsetX, offsetY, offsetZ, count); 23 | 24 | particle = ColorParticleOption.a(registryParticle, transparency << 24 | ((color != null) ? color.getRGB() : Color.WHITE.getRGB())); 25 | 26 | setTransparency(transparency); 27 | setColor(color); 28 | } 29 | 30 | public ParticleEffectColored(int transparency, double offsetX, double offsetY, double offsetZ, int count) { 31 | this(null, transparency, offsetX, offsetY, offsetZ, count); 32 | } 33 | 34 | public ParticleEffectColored(@Nullable Color color, double offsetX, double offsetY, double offsetZ) { 35 | this(color, 255, offsetX, offsetY, offsetZ, 1); 36 | } 37 | 38 | public ParticleEffectColored(int transparency, double offsetX, double offsetY, double offsetZ) { 39 | this(null, transparency, offsetX, offsetY, offsetZ, 1); 40 | } 41 | 42 | public ParticleEffectColored(double offsetX, double offsetY, double offsetZ, int count) { 43 | this(null, 255, offsetX, offsetY, offsetZ, count); 44 | } 45 | 46 | public ParticleEffectColored(double offsetX, double offsetY, double offsetZ) { 47 | this(null, 255, offsetX, offsetY, offsetZ, 1); 48 | } 49 | 50 | public ParticleEffectColored(@Nullable Color color) { 51 | this(color, 255, 0, 0, 0, 1); 52 | } 53 | 54 | public ParticleEffectColored(int count) { 55 | this(null, 255, 0, 0, 0, count); 56 | } 57 | 58 | public ParticleEffectColored() { 59 | this(null, 255, 0, 0, 0, 1); 60 | } 61 | 62 | @Override 63 | public ParticleEffectColored inherit(Particle particle) { 64 | super.inherit(particle); 65 | 66 | if (particle instanceof ColorableParticle) { 67 | color = ((ColorableParticle) particle).getColor(); 68 | } 69 | 70 | if (particle instanceof ParticleEffectColored) { 71 | transparency = ((ParticleEffectColored) particle).transparency; 72 | } 73 | 74 | return this; 75 | } 76 | 77 | @Override 78 | public ParticleEffectColored clone() { 79 | return new ParticleEffectColored().inherit(this); 80 | } 81 | 82 | @Override 83 | protected void display(Location location, List players) { 84 | ColorParticleOption p = (ColorParticleOption) particle; 85 | 86 | if (color == null) { 87 | particle = ColorParticleOption.a(registryParticle, transparency << 24 | rng.nextInt(0xffffff)); 88 | } else if (p.b() * 255 != color.getRed() || p.c() * 255 != color.getGreen() || p.d() * 255 != color.getBlue() || p.e() * 255 != transparency) { 89 | particle = ColorParticleOption.a(registryParticle, transparency << 24 | color.getRGB()); 90 | } 91 | 92 | super.display(location, players); 93 | } 94 | 95 | public void setColor(@Nullable Color color) { 96 | this.color = color; 97 | } 98 | 99 | public void setColor(int red, int green, int blue) { 100 | if (color != null && !color.isLocked()) { 101 | color.setRed(red); 102 | color.setGreen(green); 103 | color.setBlue(blue); 104 | } else { 105 | this.color = new Color(red, green, blue); 106 | } 107 | } 108 | 109 | /** 110 | * @param transparency the transparency of the particle, from 0 to 255 111 | * @return this object 112 | */ 113 | public ParticleEffectColored setTransparency(int transparency) { 114 | this.transparency = Math.min(Math.max(0, transparency), 255); 115 | 116 | return this; 117 | } 118 | 119 | @Nullable 120 | public Color getColor() { 121 | return color; 122 | } 123 | 124 | /** 125 | * @return the transparency of the particle, from 0 to 255 126 | */ 127 | public int getTransparency() { 128 | return transparency; 129 | } 130 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleEnchant.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleEnchant extends TravellingParticle { 9 | public ParticleEnchant(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("enchant", true, 0, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleEnchant(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("enchant", true, 0, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleEnchant(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleEnchant(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleEnchant(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleEnchant(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleEnchant(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleEnchant(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleEnchant(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleEnchant() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleEnchant inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleEnchant clone() { 58 | return new ParticleEnchant().inherit(this); 59 | } 60 | 61 | @Override 62 | protected Vector getXYZ(Location location) { 63 | Vector vec = super.getXYZ(location); 64 | 65 | return vec.setY(vec.getY() + 1.2); 66 | } 67 | 68 | @Override 69 | protected Vector getOffsets(Location location) { 70 | Vector vec = super.getOffsets(location); 71 | 72 | return vec.setY(vec.getY() - 1.2); 73 | } 74 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleEnchantedHit.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleEnchantedHit extends TravellingParticle { 9 | public ParticleEnchantedHit(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("enchanted_hit", false, 0.83, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleEnchantedHit(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("enchanted_hit", false, 0.83, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleEnchantedHit(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleEnchantedHit(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleEnchantedHit(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleEnchantedHit(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleEnchantedHit(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleEnchantedHit(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleEnchantedHit(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleEnchantedHit() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleEnchantedHit inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleEnchantedHit clone() { 58 | return new ParticleEnchantedHit().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleEndRod.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleEndRod extends TravellingParticle { 9 | public ParticleEndRod(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("end_rod", false, 0.093, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleEndRod(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("end_rod", false, 0.093, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleEndRod(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleEndRod(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleEndRod(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleEndRod(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleEndRod(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleEndRod(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleEndRod(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleEndRod() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleEndRod inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleEndRod clone() { 58 | return new ParticleEndRod().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleEnderSignal.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import net.minecraft.core.BlockPosition; 5 | import net.minecraft.network.protocol.Packet; 6 | import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent; 7 | import org.bukkit.Effect; 8 | import org.bukkit.Location; 9 | 10 | /** 11 | * while this effect is really cool, it summons around 30 particles per effect. 12 | *

13 | * since Effect.ENDER_SIGNAL is Type.VISUAL, the radius, speed, and offsets are unused internally, and the default radius is quite small. 14 | *

15 | * Type.VISUAL effects are also locked to specific coordinates of the block they're played on because their packet uses BlockPosition 16 | */ 17 | public class ParticleEnderSignal extends Particle { 18 | 19 | private final BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition(0, 0, 0); 20 | 21 | /**@see ParticleEnderSignal*/ 22 | public ParticleEnderSignal(int count) { 23 | super("", 0, 0, 0, count); 24 | } 25 | 26 | /**@see ParticleEnderSignal*/ 27 | public ParticleEnderSignal() { 28 | this(1); 29 | } 30 | 31 | @Override 32 | public ParticleEnderSignal inherit(Particle particle) { 33 | super.inherit(particle); 34 | 35 | return this; 36 | } 37 | 38 | @Override 39 | public ParticleEnderSignal clone() { 40 | return new ParticleEnderSignal().inherit(this); 41 | } 42 | 43 | @Override 44 | protected Packet getStrangePacket(Location location) { 45 | return new PacketPlayOutWorldEvent( 46 | Effect.ENDER_SIGNAL.getId(), pos.d(location.getBlockX(), location.getBlockY(), location.getBlockZ()), 47 | Effect.ENDER_SIGNAL.getId(), false 48 | ); 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleExplosion.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.SizeableParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleExplosion extends Particle implements SizeableParticle { 9 | 10 | protected double size; 11 | 12 | public ParticleExplosion(double size, double offsetX, double offsetY, double offsetZ, int count) { 13 | super("explosion", offsetX, offsetY, offsetZ, count); 14 | 15 | setSize(size); 16 | } 17 | 18 | public ParticleExplosion(double size, double offsetX, double offsetY, double offsetZ) { 19 | this(size, offsetX, offsetY, offsetZ, 1); 20 | } 21 | 22 | public ParticleExplosion(double offsetX, double offsetY, double offsetZ, int count) { 23 | this(1, offsetX, offsetY, offsetZ, count); 24 | } 25 | 26 | public ParticleExplosion(double offsetX, double offsetY, double offsetZ) { 27 | this(1, offsetX, offsetY, offsetZ, 1); 28 | } 29 | 30 | public ParticleExplosion(double size, int count) { 31 | this(size, 0, 0, 0, count); 32 | } 33 | 34 | public ParticleExplosion(double size) { 35 | this(size, 0, 0, 0, 1); 36 | } 37 | 38 | public ParticleExplosion(int count) { 39 | this(1, 0, 0, 0, count); 40 | } 41 | 42 | public ParticleExplosion() { 43 | this(1, 0, 0, 0, 1); 44 | } 45 | 46 | @Override 47 | public ParticleExplosion inherit(Particle particle) { 48 | super.inherit(particle); 49 | 50 | if (particle instanceof SizeableParticle) { 51 | setSize(((SizeableParticle) particle).getSize()); 52 | } 53 | 54 | return this; 55 | } 56 | 57 | @Override 58 | public ParticleExplosion clone() { 59 | return new ParticleExplosion().inherit(this); 60 | } 61 | 62 | @Override 63 | protected Vector getXYZ(Location location) { 64 | return super.getXYZ(location).add(generateFakeOffset()); 65 | } 66 | 67 | @Override 68 | protected Vector getOffsets(Location location) { 69 | return super.getOffsets(location).zero().setX(-(size) + 2); 70 | } 71 | 72 | @Override 73 | protected float getPacketSpeed() { 74 | return 1; 75 | } 76 | 77 | @Override 78 | protected int getPacketCount() { 79 | return 0; 80 | } 81 | 82 | @Override 83 | public void setSize(double size) { 84 | this.size = size; 85 | } 86 | 87 | @Override 88 | public double getSize() { 89 | return size; 90 | } 91 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleExplosionEmitter.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleExplosionEmitter extends Particle { 6 | public ParticleExplosionEmitter(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("explosion_emitter", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleExplosionEmitter(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleExplosionEmitter(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleExplosionEmitter() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleExplosionEmitter inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleExplosionEmitter clone() { 31 | return new ParticleExplosionEmitter().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleFirefly.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleFirefly extends Particle { 6 | public ParticleFirefly(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("firefly", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleFirefly(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleFirefly(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleFirefly() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleFirefly inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleFirefly clone() { 31 | return new ParticleFirefly().inherit(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleFirework.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleFirework extends TravellingParticle { 9 | public ParticleFirework(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("firework", false, 0.103, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleFirework(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("firework", false, 0.103, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleFirework(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleFirework(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleFirework(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleFirework(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleFirework(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleFirework(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleFirework(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleFirework() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleFirework inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleFirework clone() { 58 | return new ParticleFirework().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleFishing.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleFishing extends TravellingParticle { 9 | public ParticleFishing(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("fishing", false, 0.05, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleFishing(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("fishing", false, 0.05, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleFishing(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleFishing(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleFishing(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleFishing(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleFishing(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleFishing(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleFishing(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleFishing() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleFishing inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleFishing clone() { 58 | return new ParticleFishing().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleFlame.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleFlame extends TravellingParticle { 9 | public ParticleFlame(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("flame", false, 0.07, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleFlame(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("flame", false, 0.07, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleFlame(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleFlame(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleFlame(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleFlame(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleFlame(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleFlame(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleFlame(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleFlame() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleFlame inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleFlame clone() { 58 | return new ParticleFlame().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleFlameSmall.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleFlameSmall extends TravellingParticle { 9 | public ParticleFlameSmall(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("small_flame", false, 0.07, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleFlameSmall(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("small_flame", false, 0.07, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleFlameSmall(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleFlameSmall(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleFlameSmall(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleFlameSmall(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleFlameSmall(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleFlameSmall(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleFlameSmall(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleFlameSmall() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleFlameSmall inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleFlameSmall clone() { 58 | return new ParticleFlameSmall().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleFlameSoul.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleFlameSoul extends TravellingParticle { 9 | public ParticleFlameSoul(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("soul_fire_flame", false, 0.07, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleFlameSoul(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("soul_fire_flame", false, 0.07, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleFlameSoul(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleFlameSoul(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleFlameSoul(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleFlameSoul(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleFlameSoul(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleFlameSoul(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleFlameSoul(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleFlameSoul() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleFlameSoul inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleFlameSoul clone() { 58 | return new ParticleFlameSoul().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleFlash.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleFlash extends Particle { 6 | public ParticleFlash(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("flash", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleFlash(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleFlash(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleFlash() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleFlash inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleFlash clone() { 31 | return new ParticleFlash().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleGlow.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleGlow extends Particle { 6 | public ParticleGlow(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("glow", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleGlow(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleGlow(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleGlow() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleGlow inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleGlow clone() { 31 | return new ParticleGlow().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleGlowInk.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleGlowInk extends TravellingParticle { 9 | public ParticleGlowInk(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("glow_squid_ink", false, 0.099, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleGlowInk(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("glow_squid_ink", false, 0.099, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleGlowInk(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleGlowInk(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleGlowInk(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleGlowInk(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleGlowInk(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleGlowInk(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleGlowInk(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleGlowInk() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleGlowInk inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleGlowInk clone() { 58 | return new ParticleGlowInk().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleGust.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleGust extends Particle { 6 | public ParticleGust(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("gust", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleGust(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleGust(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleGust() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleGust inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleGust clone() { 31 | return new ParticleGust().inherit(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleGustEmitterLarge.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleGustEmitterLarge extends Particle { 6 | public ParticleGustEmitterLarge(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("gust_emitter_large", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleGustEmitterLarge(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleGustEmitterLarge(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleGustEmitterLarge() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleGustEmitterLarge inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleGustEmitterLarge clone() { 31 | return new ParticleGustEmitterLarge().inherit(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleGustEmitterSmall.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleGustEmitterSmall extends Particle { 6 | public ParticleGustEmitterSmall(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("gust_emitter_small", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleGustEmitterSmall(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleGustEmitterSmall(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleGustEmitterSmall() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleGustEmitterSmall inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleGustEmitterSmall clone() { 31 | return new ParticleGustEmitterSmall().inherit(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleGustSmall.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleGustSmall extends Particle { 6 | public ParticleGustSmall(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("small_gust", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleGustSmall(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleGustSmall(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleGustSmall() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleGustSmall inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleGustSmall clone() { 31 | return new ParticleGustSmall().inherit(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleHappy.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleHappy extends Particle { 6 | public ParticleHappy(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("happy_villager", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleHappy(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleHappy(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleHappy() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleHappy inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleHappy clone() { 31 | return new ParticleHappy().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleHeart.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleHeart extends Particle { 6 | public ParticleHeart(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("heart", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleHeart(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleHeart(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleHeart() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleHeart inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleHeart clone() { 31 | return new ParticleHeart().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleHoney.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.LiquidParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.util.LiquidParticleState; 6 | import net.minecraft.core.particles.ParticleType; 7 | import net.minecraft.core.registries.BuiltInRegistries; 8 | import net.minecraft.resources.MinecraftKey; 9 | 10 | import java.util.Locale; 11 | 12 | public class ParticleHoney extends Particle implements LiquidParticle { 13 | 14 | private LiquidParticleState state = LiquidParticleState.DRIPPING; 15 | 16 | public ParticleHoney(double offsetX, double offsetY, double offsetZ, int count) { 17 | super("dripping_honey", offsetX, offsetY, offsetZ, count); 18 | } 19 | 20 | public ParticleHoney(double offsetX, double offsetY, double offsetZ) { 21 | this(offsetX, offsetY, offsetZ, 1); 22 | } 23 | 24 | public ParticleHoney(int count) { 25 | this(0, 0, 0, count); 26 | } 27 | 28 | public ParticleHoney() { 29 | this(0, 0, 0, 1); 30 | } 31 | 32 | @Override 33 | public ParticleHoney inherit(Particle particle) { 34 | super.inherit(particle); 35 | 36 | if (particle instanceof LiquidParticle) { 37 | setLiquidState(((LiquidParticle) particle).getLiquidState()); 38 | } 39 | 40 | return this; 41 | } 42 | 43 | @Override 44 | public ParticleHoney clone() { 45 | return new ParticleHoney().inherit(this); 46 | } 47 | 48 | @Override 49 | public ParticleHoney setLiquidState(LiquidParticleState state) { 50 | particle = (ParticleType) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", state.name().toLowerCase(Locale.ROOT) + "_honey")); 51 | this.state = state; 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public LiquidParticleState getLiquidState() { 58 | return state; 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleInfested.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleInfested extends Particle { 6 | public ParticleInfested(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("infested", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleInfested(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleInfested(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleInfested() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleInfested inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleInfested clone() { 31 | return new ParticleInfested().inherit(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleInstantEffect.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleInstantEffect extends Particle { 6 | public ParticleInstantEffect(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("instant_effect", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleInstantEffect(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleInstantEffect(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleInstantEffect() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleInstantEffect inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleInstantEffect clone() { 31 | return new ParticleInstantEffect().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleLava.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.LiquidParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.util.LiquidParticleState; 6 | import net.minecraft.core.particles.ParticleType; 7 | import net.minecraft.core.registries.BuiltInRegistries; 8 | import net.minecraft.resources.MinecraftKey; 9 | 10 | import java.util.Locale; 11 | 12 | public class ParticleLava extends Particle implements LiquidParticle { 13 | 14 | private LiquidParticleState state = LiquidParticleState.DRIPPING; 15 | 16 | public ParticleLava(double offsetX, double offsetY, double offsetZ, int count) { 17 | super("dripping_lava", offsetX, offsetY, offsetZ, count); 18 | } 19 | 20 | public ParticleLava(double offsetX, double offsetY, double offsetZ) { 21 | this(offsetX, offsetY, offsetZ, 1); 22 | } 23 | 24 | public ParticleLava(int count) { 25 | this(0, 0, 0, count); 26 | } 27 | 28 | public ParticleLava() { 29 | this(0, 0, 0, 1); 30 | } 31 | 32 | @Override 33 | public ParticleLava inherit(Particle particle) { 34 | super.inherit(particle); 35 | 36 | if (particle instanceof LiquidParticle) { 37 | setLiquidState(((LiquidParticle) particle).getLiquidState()); 38 | } 39 | 40 | return this; 41 | } 42 | 43 | @Override 44 | public ParticleLava clone() { 45 | return new ParticleLava().inherit(this); 46 | } 47 | 48 | @Override 49 | public ParticleLava setLiquidState(LiquidParticleState state) { 50 | particle = (ParticleType) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", state.name().toLowerCase(Locale.ROOT) + "_lava")); 51 | this.state = state; 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public LiquidParticleState getLiquidState() { 58 | return state; 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleLavaPop.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleLavaPop extends Particle { 6 | public ParticleLavaPop(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("lava", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleLavaPop(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleLavaPop(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleLavaPop() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleLavaPop inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleLavaPop clone() { 31 | return new ParticleLavaPop().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleMycelium.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleMycelium extends Particle { 6 | public ParticleMycelium(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("mycelium", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleMycelium(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleMycelium(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleMycelium() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleMycelium inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleMycelium clone() { 31 | return new ParticleMycelium().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleNautilus.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleNautilus extends TravellingParticle { 9 | public ParticleNautilus(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("nautilus", true, 0, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleNautilus(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("nautilus", true, 0, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleNautilus(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleNautilus(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleNautilus(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleNautilus(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleNautilus(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleNautilus(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleNautilus(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleNautilus() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleNautilus inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleNautilus clone() { 58 | return new ParticleNautilus().inherit(this); 59 | } 60 | 61 | @Override 62 | protected Vector getXYZ(Location location) { 63 | Vector vec = super.getXYZ(location); 64 | 65 | return vec.setY(vec.getY() + 1.2); 66 | } 67 | 68 | @Override 69 | protected Vector getOffsets(Location location) { 70 | Vector vec = super.getOffsets(location); 71 | 72 | return vec.setY(vec.getY() - 1.2); 73 | } 74 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleNectar.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.LiquidParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.util.LiquidParticleState; 6 | import net.minecraft.core.particles.ParticleType; 7 | import net.minecraft.core.registries.BuiltInRegistries; 8 | import net.minecraft.resources.MinecraftKey; 9 | 10 | import java.util.Locale; 11 | 12 | public class ParticleNectar extends Particle implements LiquidParticle { 13 | 14 | private LiquidParticleState state = LiquidParticleState.FALLING; 15 | 16 | public ParticleNectar(double offsetX, double offsetY, double offsetZ, int count) { 17 | super("falling_nectar", offsetX, offsetY, offsetZ, count); 18 | } 19 | 20 | public ParticleNectar(double offsetX, double offsetY, double offsetZ) { 21 | this(offsetX, offsetY, offsetZ, 1); 22 | } 23 | 24 | public ParticleNectar(int count) { 25 | this(0, 0, 0, count); 26 | } 27 | 28 | public ParticleNectar() { 29 | this(0, 0, 0, 1); 30 | } 31 | 32 | @Override 33 | public ParticleNectar inherit(Particle particle) { 34 | super.inherit(particle); 35 | 36 | if (particle instanceof LiquidParticle) { 37 | setLiquidState(((LiquidParticle) particle).getLiquidState()); 38 | } 39 | 40 | return this; 41 | } 42 | 43 | @Override 44 | public ParticleNectar clone() { 45 | return new ParticleNectar().inherit(this); 46 | } 47 | 48 | @Override 49 | public ParticleNectar setLiquidState(LiquidParticleState state) { 50 | if (state == LiquidParticleState.DRIPPING) throw new IllegalArgumentException("The \"DRIPPING\" state doesn't exist for this particle!"); 51 | if (state == LiquidParticleState.LANDING) throw new IllegalArgumentException("The \"LANDING\" state doesn't exist for this particle!"); 52 | 53 | particle = (ParticleType) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", state.name().toLowerCase(Locale.ROOT) + "_nectar")); 54 | this.state = state; 55 | 56 | return this; 57 | } 58 | 59 | @Override 60 | public LiquidParticleState getLiquidState() { 61 | return state; 62 | } 63 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleNote.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleNote extends Particle { 6 | public ParticleNote(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("note", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleNote(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleNote(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleNote() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleNote inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleNote clone() { 31 | return new ParticleNote().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleNull.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.shapers.parents.ParticleShaper; 5 | import org.bukkit.Location; 6 | import org.bukkit.craftbukkit.v1_21_R5.entity.CraftPlayer; 7 | import org.bukkit.entity.Player; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Display does nothing in this class. it's meant to be used in {@link ParticleShaper#addParticle(Particle, int)} 13 | * to allow for certain spots to display nothing 14 | */ 15 | public class ParticleNull extends Particle { 16 | /**@see ParticleNull*/ 17 | public ParticleNull() { 18 | super("", 0, 0, 0, 0); 19 | } 20 | 21 | @Override 22 | public void displayForPlayers(Location location, Player... players) { 23 | } 24 | 25 | @Override 26 | public void display(Location location) { 27 | } 28 | 29 | @Override 30 | protected void display(Location location, List players) { 31 | } 32 | 33 | @Override 34 | public ParticleNull inherit(Particle particle) { 35 | super.inherit(particle); 36 | 37 | return this; 38 | } 39 | 40 | @Override 41 | public ParticleNull clone() { 42 | return new ParticleNull().inherit(this); 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleObsidianTear.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.LiquidParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.util.LiquidParticleState; 6 | import net.minecraft.core.particles.ParticleType; 7 | import net.minecraft.core.registries.BuiltInRegistries; 8 | import net.minecraft.resources.MinecraftKey; 9 | 10 | import java.util.Locale; 11 | 12 | public class ParticleObsidianTear extends Particle implements LiquidParticle { 13 | 14 | private LiquidParticleState state = LiquidParticleState.DRIPPING; 15 | 16 | public ParticleObsidianTear(double offsetX, double offsetY, double offsetZ, int count) { 17 | super("dripping_obsidian_tear", offsetX, offsetY, offsetZ, count); 18 | } 19 | 20 | public ParticleObsidianTear(double offsetX, double offsetY, double offsetZ) { 21 | this(offsetX, offsetY, offsetZ, 1); 22 | } 23 | 24 | public ParticleObsidianTear(int count) { 25 | this(0, 0, 0, count); 26 | } 27 | 28 | public ParticleObsidianTear() { 29 | this(0, 0, 0, 1); 30 | } 31 | 32 | @Override 33 | public ParticleObsidianTear inherit(Particle particle) { 34 | super.inherit(particle); 35 | 36 | if (particle instanceof LiquidParticle) { 37 | setLiquidState(((LiquidParticle) particle).getLiquidState()); 38 | } 39 | 40 | return this; 41 | } 42 | 43 | @Override 44 | public ParticleObsidianTear clone() { 45 | return new ParticleObsidianTear().inherit(this); 46 | } 47 | 48 | @Override 49 | public ParticleObsidianTear setLiquidState(LiquidParticleState state) { 50 | particle = (ParticleType) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", state.name().toLowerCase(Locale.ROOT) + "_obsidian_tear")); 51 | this.state = state; 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public LiquidParticleState getLiquidState() { 58 | return state; 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleOmenRaid.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleOmenRaid extends Particle { 6 | public ParticleOmenRaid(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("raid_omen", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleOmenRaid(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleOmenRaid(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleOmenRaid() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleOmenRaid inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleOmenRaid clone() { 31 | return new ParticleOmenRaid().inherit(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleOmenTrial.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleOmenTrial extends Particle { 6 | public ParticleOmenTrial(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("trial_omen", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleOmenTrial(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleOmenTrial(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleOmenTrial() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleOmenTrial inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleOmenTrial clone() { 31 | return new ParticleOmenTrial().inherit(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleOminous.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleOminous extends TravellingParticle { 9 | public ParticleOminous(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("ominous_spawning", true, 0, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleOminous(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("ominous_spawning", true, 0, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleOminous(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleOminous(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleOminous(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleOminous(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleOminous(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleOminous(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleOminous(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleOminous() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleOminous inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleOminous clone() { 58 | return new ParticleOminous().inherit(this); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticlePaleOakLeaves.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticlePaleOakLeaves extends Particle { 6 | public ParticlePaleOakLeaves(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("pale_oak_leaves", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticlePaleOakLeaves(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticlePaleOakLeaves(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticlePaleOakLeaves() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticlePaleOakLeaves inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticlePaleOakLeaves clone() { 31 | return new ParticlePaleOakLeaves().inherit(this); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticlePoof.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticlePoof extends TravellingParticle { 9 | public ParticlePoof(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("poof", false, 0.085, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticlePoof(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("poof", false, 0.085, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticlePoof(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticlePoof(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticlePoof(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticlePoof(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticlePoof(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticlePoof(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticlePoof(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticlePoof() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticlePoof inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticlePoof clone() { 58 | return new ParticlePoof().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticlePortal.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import net.minecraft.core.particles.ParticleType; 6 | import net.minecraft.core.registries.BuiltInRegistries; 7 | import net.minecraft.resources.MinecraftKey; 8 | import org.bukkit.Location; 9 | import org.bukkit.util.Vector; 10 | 11 | public class ParticlePortal extends TravellingParticle { 12 | public ParticlePortal(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 13 | super("reverse_portal", false, 0.032, null, toGo, offsetX, offsetY, offsetZ, count); 14 | } 15 | 16 | public ParticlePortal(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 17 | super("reverse_portal", false, 0.032, velocity, null, offsetX, offsetY, offsetZ, count); 18 | } 19 | 20 | public ParticlePortal(Location toGo, double offsetX, double offsetY, double offsetZ) { 21 | this(toGo, offsetX, offsetY, offsetZ, 1); 22 | } 23 | 24 | public ParticlePortal(Vector velocity, double offsetX, double offsetY, double offsetZ) { 25 | this(velocity, offsetX, offsetY, offsetZ, 1); 26 | } 27 | 28 | public ParticlePortal(double offsetX, double offsetY, double offsetZ, int count) { 29 | this((Location) null, offsetX, offsetY, offsetZ, count); 30 | } 31 | 32 | public ParticlePortal(double offsetX, double offsetY, double offsetZ) { 33 | this((Location) null, offsetX, offsetY, offsetZ, 1); 34 | } 35 | 36 | public ParticlePortal(int count) { 37 | this((Location) null, 0, 0, 0, count); 38 | } 39 | 40 | public ParticlePortal(Location toGo) { 41 | this(toGo, 0, 0, 0, 1); 42 | } 43 | 44 | public ParticlePortal(Vector velocity) { 45 | this(velocity, 0, 0, 0, 1); 46 | } 47 | 48 | public ParticlePortal() { 49 | this((Location) null, 0, 0, 0, 1); 50 | } 51 | 52 | @Override 53 | public ParticlePortal inherit(Particle particle) { 54 | super.inherit(particle); 55 | 56 | if (particle instanceof ParticlePortal) { 57 | this.particle = ((ParticlePortal) particle).particle; 58 | this.inverse = ((ParticlePortal) particle).inverse; 59 | } 60 | 61 | return this; 62 | } 63 | 64 | @Override 65 | public ParticlePortal clone() { 66 | return new ParticlePortal().inherit(this); 67 | } 68 | 69 | @Override 70 | protected Vector getOffsets(Location location) { 71 | Vector vec = super.getOffsets(location); 72 | 73 | if (inverse) { 74 | vec.setY(vec.getY() - 1); 75 | } 76 | 77 | return vec; 78 | } 79 | 80 | /** 81 | * @param inverse whether this class uses REVERSE_PORTAL or PORTAL, default false (REVERSE_PORTAL) 82 | */ 83 | public ParticlePortal setInverse(boolean inverse) { 84 | this.inverse = inverse; 85 | 86 | if (inverse) { 87 | particle = (ParticleType) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "portal")); 88 | } else { 89 | particle = (ParticleType) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "reverse_portal")); 90 | } 91 | 92 | return this; 93 | } 94 | 95 | /** 96 | * @return whether this class uses REVERSE_PORTAL or PORTAL, default false (REVERSE_PORTAL) 97 | */ 98 | public boolean isInverse() { 99 | return inverse; 100 | } 101 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleScrape.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleScrape extends TravellingParticle { 9 | public ParticleScrape(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("scrape", false, 5.25, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleScrape(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("scrape", false, 5.25, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleScrape(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleScrape(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleScrape(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleScrape(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleScrape(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleScrape(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleScrape(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleScrape() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleScrape inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleScrape clone() { 58 | return new ParticleScrape().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSculkCharge.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import net.minecraft.core.particles.SculkChargeParticleOptions; 6 | import org.bukkit.Location; 7 | import org.bukkit.util.Vector; 8 | 9 | public class ParticleSculkCharge extends TravellingParticle { 10 | public ParticleSculkCharge(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 11 | super("", false, 0.08, null, toGo, offsetX, offsetY, offsetZ, count); 12 | 13 | setRoll(0); 14 | } 15 | 16 | public ParticleSculkCharge(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 17 | super("", false, 0.08, velocity, null, offsetX, offsetY, offsetZ, count); 18 | 19 | setRoll(0); 20 | } 21 | 22 | public ParticleSculkCharge(Location toGo, double offsetX, double offsetY, double offsetZ) { 23 | this(toGo, offsetX, offsetY, offsetZ, 1); 24 | } 25 | 26 | public ParticleSculkCharge(Vector velocity, double offsetX, double offsetY, double offsetZ) { 27 | this(velocity, offsetX, offsetY, offsetZ, 1); 28 | } 29 | 30 | public ParticleSculkCharge(double offsetX, double offsetY, double offsetZ, int count) { 31 | this((Location) null, offsetX, offsetY, offsetZ, count); 32 | } 33 | 34 | public ParticleSculkCharge(double offsetX, double offsetY, double offsetZ) { 35 | this((Location) null, offsetX, offsetY, offsetZ, 1); 36 | } 37 | 38 | public ParticleSculkCharge(int count) { 39 | this((Location) null, 0, 0, 0, count); 40 | } 41 | 42 | public ParticleSculkCharge(Location toGo) { 43 | this(toGo, 0, 0, 0, 1); 44 | } 45 | 46 | public ParticleSculkCharge(Vector velocity) { 47 | this(velocity, 0, 0, 0, 1); 48 | } 49 | 50 | public ParticleSculkCharge() { 51 | this((Location) null, 0, 0, 0, 1); 52 | } 53 | 54 | @Override 55 | public ParticleSculkCharge inherit(Particle particle) { 56 | super.inherit(particle); 57 | 58 | if (particle instanceof ParticleSculkCharge) { 59 | this.particle = ((ParticleSculkCharge) particle).particle; 60 | } 61 | 62 | return this; 63 | } 64 | 65 | @Override 66 | public ParticleSculkCharge clone() { 67 | return new ParticleSculkCharge().inherit(this); 68 | } 69 | 70 | /** 71 | * @param degrees how much this particle should be rotated in the Z axis 72 | */ 73 | public ParticleSculkCharge setRoll(double degrees) { 74 | particle = new SculkChargeParticleOptions((float) Math.toRadians(degrees)); 75 | 76 | return this; 77 | } 78 | 79 | /** 80 | * @return how much this particle is rotated in the Z axis 81 | */ 82 | public double getRoll() { 83 | return Math.toDegrees(((SculkChargeParticleOptions) particle).b()); 84 | } 85 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSculkChargePop.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSculkChargePop extends TravellingParticle { 9 | public ParticleSculkChargePop(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("sculk_charge_pop", false, 0.13, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleSculkChargePop(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("sculk_charge_pop", false, 0.13, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleSculkChargePop(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleSculkChargePop(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleSculkChargePop(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleSculkChargePop(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleSculkChargePop(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleSculkChargePop(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleSculkChargePop(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleSculkChargePop() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleSculkChargePop inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleSculkChargePop clone() { 58 | return new ParticleSculkChargePop().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleShriek.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import net.minecraft.core.particles.ShriekParticleOption; 5 | 6 | public class ParticleShriek extends Particle { 7 | public ParticleShriek(double offsetX, double offsetY, double offsetZ, int count) { 8 | super("", offsetX, offsetY, offsetZ, count); 9 | 10 | setDelay(0); 11 | } 12 | 13 | public ParticleShriek(double offsetX, double offsetY, double offsetZ) { 14 | this(offsetX, offsetY, offsetZ, 1); 15 | } 16 | 17 | public ParticleShriek(int count) { 18 | this(0, 0, 0, count); 19 | } 20 | 21 | public ParticleShriek() { 22 | this(0, 0, 0, 1); 23 | } 24 | 25 | @Override 26 | public ParticleShriek inherit(Particle particle) { 27 | super.inherit(particle); 28 | 29 | if (particle instanceof ParticleShriek) { 30 | this.particle = ((ParticleShriek) particle).particle; 31 | } 32 | 33 | return this; 34 | } 35 | 36 | @Override 37 | public ParticleShriek clone() { 38 | return new ParticleShriek().inherit(this); 39 | } 40 | 41 | /** 42 | * @param delay amount of ticks before this particle displays 43 | */ 44 | public ParticleShriek setDelay(int delay) { 45 | particle = new ShriekParticleOption(delay); 46 | 47 | return this; 48 | } 49 | 50 | /** 51 | * @return amount of ticks before this particle displays 52 | */ 53 | public int getDelay() { 54 | return ((ShriekParticleOption) particle).b(); 55 | } 56 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSmoke.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSmoke extends TravellingParticle { 9 | public ParticleSmoke(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("smoke", false, 0.075, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleSmoke(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("smoke", false, 0.075, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleSmoke(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleSmoke(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleSmoke(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleSmoke(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleSmoke(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleSmoke(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleSmoke(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleSmoke() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleSmoke inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleSmoke clone() { 58 | return new ParticleSmoke().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSmokeLarge.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSmokeLarge extends TravellingParticle { 9 | public ParticleSmokeLarge(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("large_smoke", false, 0.05, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleSmokeLarge(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("large_smoke", false, 0.05, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleSmokeLarge(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleSmokeLarge(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleSmokeLarge(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleSmokeLarge(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleSmokeLarge(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleSmokeLarge(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleSmokeLarge(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleSmokeLarge() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleSmokeLarge inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleSmokeLarge clone() { 58 | return new ParticleSmokeLarge().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSmokeWhite.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSmokeWhite extends TravellingParticle { 9 | public ParticleSmokeWhite(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("white_smoke", false, 0.075, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleSmokeWhite(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("white_smoke", false, 0.075, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleSmokeWhite(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleSmokeWhite(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleSmokeWhite(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleSmokeWhite(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleSmokeWhite(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleSmokeWhite(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleSmokeWhite(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleSmokeWhite() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleSmokeWhite inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleSmokeWhite clone() { 58 | return new ParticleSmokeWhite().inherit(this); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSneeze.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSneeze extends TravellingParticle { 9 | public ParticleSneeze(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("sneeze", false, 0.05, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleSneeze(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("sneeze", false, 0.05, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleSneeze(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleSneeze(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleSneeze(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleSneeze(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleSneeze(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleSneeze(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleSneeze(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleSneeze() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleSneeze inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleSneeze clone() { 58 | return new ParticleSneeze().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSnowflake.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSnowflake extends TravellingParticle { 9 | public ParticleSnowflake(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("snowflake", false, 0.12, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleSnowflake(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("snowflake", false, 0.12, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleSnowflake(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleSnowflake(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleSnowflake(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleSnowflake(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleSnowflake(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleSnowflake(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleSnowflake(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleSnowflake() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleSnowflake inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleSnowflake clone() { 58 | return new ParticleSnowflake().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSonicBoom.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleSonicBoom extends Particle { 6 | public ParticleSonicBoom(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("sonic_boom", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleSonicBoom(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleSonicBoom(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleSonicBoom() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleSonicBoom inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleSonicBoom clone() { 31 | return new ParticleSonicBoom().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSoul.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSoul extends TravellingParticle { 9 | public ParticleSoul(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("soul", false, 0.06, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleSoul(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("soul", false, 0.06, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleSoul(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleSoul(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleSoul(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleSoul(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleSoul(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleSoul(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleSoul(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleSoul() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleSoul inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleSoul clone() { 58 | return new ParticleSoul().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSoulSculk.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSoulSculk extends TravellingParticle { 9 | public ParticleSoulSculk(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("sculk_soul", false, 0.06, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleSoulSculk(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("sculk_soul", false, 0.06, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleSoulSculk(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleSoulSculk(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleSoulSculk(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleSoulSculk(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleSoulSculk(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleSoulSculk(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleSoulSculk(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleSoulSculk() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleSoulSculk inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleSoulSculk clone() { 58 | return new ParticleSoulSculk().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSpit.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import net.minecraft.core.IRegistry; 6 | import net.minecraft.core.particles.ParticleType; 7 | import net.minecraft.resources.MinecraftKey; 8 | import org.bukkit.Location; 9 | import org.bukkit.util.Vector; 10 | 11 | public class ParticleSpit extends TravellingParticle { 12 | public ParticleSpit(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 13 | super("spit", false, 0.14, null, toGo, offsetX, offsetY, offsetZ, count); 14 | } 15 | 16 | public ParticleSpit(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 17 | super("spit", false, 0.14, velocity, null, offsetX, offsetY, offsetZ, count); 18 | } 19 | 20 | public ParticleSpit(Location toGo, double offsetX, double offsetY, double offsetZ) { 21 | this(toGo, offsetX, offsetY, offsetZ, 1); 22 | } 23 | 24 | public ParticleSpit(Vector velocity, double offsetX, double offsetY, double offsetZ) { 25 | this(velocity, offsetX, offsetY, offsetZ, 1); 26 | } 27 | 28 | public ParticleSpit(double offsetX, double offsetY, double offsetZ, int count) { 29 | this((Location) null, offsetX, offsetY, offsetZ, count); 30 | } 31 | 32 | public ParticleSpit(double offsetX, double offsetY, double offsetZ) { 33 | this((Location) null, offsetX, offsetY, offsetZ, 1); 34 | } 35 | 36 | public ParticleSpit(int count) { 37 | this((Location) null, 0, 0, 0, count); 38 | } 39 | 40 | public ParticleSpit(Location toGo) { 41 | this(toGo, 0, 0, 0, 1); 42 | } 43 | 44 | public ParticleSpit(Vector velocity) { 45 | this(velocity, 0, 0, 0, 1); 46 | } 47 | 48 | public ParticleSpit() { 49 | this((Location) null, 0, 0, 0, 1); 50 | } 51 | 52 | @Override 53 | public ParticleSpit inherit(Particle particle) { 54 | super.inherit(particle); 55 | 56 | return this; 57 | } 58 | 59 | @Override 60 | public ParticleSpit clone() { 61 | return new ParticleSpit().inherit(this); 62 | } 63 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSplash.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleSplash extends Particle { 6 | public ParticleSplash(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("splash", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleSplash(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleSplash(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleSplash() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleSplash inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleSplash clone() { 31 | return new ParticleSplash().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSporeBlossom.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.LiquidParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.util.LiquidParticleState; 6 | import net.minecraft.core.particles.ParticleType; 7 | import net.minecraft.core.registries.BuiltInRegistries; 8 | import net.minecraft.resources.MinecraftKey; 9 | 10 | public class ParticleSporeBlossom extends Particle implements LiquidParticle { 11 | 12 | private LiquidParticleState state = LiquidParticleState.DRIPPING; 13 | 14 | public ParticleSporeBlossom(double offsetX, double offsetY, double offsetZ, int count) { 15 | super("spore_blossom_air", offsetX, offsetY, offsetZ, count); 16 | } 17 | 18 | public ParticleSporeBlossom(double offsetX, double offsetY, double offsetZ) { 19 | this(offsetX, offsetY, offsetZ, 1); 20 | } 21 | 22 | public ParticleSporeBlossom(int count) { 23 | this(0, 0, 0, count); 24 | } 25 | 26 | public ParticleSporeBlossom() { 27 | this(0, 0, 0, 1); 28 | } 29 | 30 | @Override 31 | public ParticleSporeBlossom inherit(Particle particle) { 32 | super.inherit(particle); 33 | 34 | if (particle instanceof LiquidParticle) { 35 | setLiquidState(((LiquidParticle) particle).getLiquidState()); 36 | } 37 | 38 | return this; 39 | } 40 | 41 | @Override 42 | public ParticleSporeBlossom clone() { 43 | return new ParticleSporeBlossom().inherit(this); 44 | } 45 | 46 | @Override 47 | public ParticleSporeBlossom setLiquidState(LiquidParticleState state) { 48 | if (state == LiquidParticleState.LANDING) throw new IllegalArgumentException("The \"LANDING\" state doesn't exist for this particle!"); 49 | 50 | if (state == LiquidParticleState.DRIPPING) { 51 | particle = (ParticleType) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "spore_blossom_air")); 52 | } else { 53 | particle = (ParticleType) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "falling_spore_blossom")); 54 | } 55 | 56 | this.state = state; 57 | 58 | return this; 59 | } 60 | 61 | @Override 62 | public LiquidParticleState getLiquidState() { 63 | return state; 64 | } 65 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSquidInk.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSquidInk extends TravellingParticle { 9 | public ParticleSquidInk(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("squid_ink", false, 0.099, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleSquidInk(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("squid_ink", false, 0.099, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleSquidInk(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleSquidInk(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleSquidInk(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleSquidInk(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleSquidInk(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleSquidInk(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleSquidInk(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleSquidInk() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleSquidInk inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleSquidInk clone() { 58 | return new ParticleSquidInk().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleSweepAttack.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.SizeableParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleSweepAttack extends Particle implements SizeableParticle { 9 | 10 | protected double size; 11 | 12 | public ParticleSweepAttack(double size, double offsetX, double offsetY, double offsetZ, int count) { 13 | super("sweep_attack", offsetX, offsetY, offsetZ, count); 14 | 15 | setSize(size); 16 | } 17 | 18 | public ParticleSweepAttack(double size, double offsetX, double offsetY, double offsetZ) { 19 | this(size, offsetX, offsetY, offsetZ, 1); 20 | } 21 | 22 | public ParticleSweepAttack(double offsetX, double offsetY, double offsetZ, int count) { 23 | this(1, offsetX, offsetY, offsetZ, count); 24 | } 25 | 26 | public ParticleSweepAttack(double offsetX, double offsetY, double offsetZ) { 27 | this(1, offsetX, offsetY, offsetZ, 1); 28 | } 29 | 30 | public ParticleSweepAttack(double size, int count) { 31 | this(size, 0, 0, 0, count); 32 | } 33 | 34 | public ParticleSweepAttack(double size) { 35 | this(size, 0, 0, 0, 1); 36 | } 37 | 38 | public ParticleSweepAttack(int count) { 39 | this(1, 0, 0, 0, count); 40 | } 41 | 42 | public ParticleSweepAttack() { 43 | this(1, 0, 0, 0, 1); 44 | } 45 | 46 | @Override 47 | public ParticleSweepAttack inherit(Particle particle) { 48 | super.inherit(particle); 49 | 50 | if (particle instanceof SizeableParticle) { 51 | setSize(((SizeableParticle) particle).getSize()); 52 | } 53 | 54 | return this; 55 | } 56 | 57 | @Override 58 | public ParticleSweepAttack clone() { 59 | return new ParticleSweepAttack().inherit(this); 60 | } 61 | 62 | @Override 63 | protected Vector getXYZ(Location location) { 64 | return super.getXYZ(location).add(generateFakeOffset()); 65 | } 66 | 67 | @Override 68 | protected Vector getOffsets(Location location) { 69 | return super.getOffsets(location).zero().setX(-(size) + 2); 70 | } 71 | 72 | @Override 73 | protected float getPacketSpeed() { 74 | return 1; 75 | } 76 | 77 | @Override 78 | protected int getPacketCount() { 79 | return 0; 80 | } 81 | 82 | @Override 83 | public void setSize(double size) { 84 | this.size = size; 85 | } 86 | 87 | @Override 88 | public double getSize() { 89 | return size; 90 | } 91 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleTintedLeaves.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.ColorableParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.util.Color; 6 | import net.minecraft.core.particles.ColorParticleOption; 7 | import net.minecraft.core.registries.BuiltInRegistries; 8 | import net.minecraft.resources.MinecraftKey; 9 | import org.bukkit.Location; 10 | import org.bukkit.craftbukkit.v1_21_R5.entity.CraftPlayer; 11 | 12 | import javax.annotation.Nullable; 13 | import java.util.List; 14 | 15 | public class ParticleTintedLeaves extends Particle implements ColorableParticle { 16 | 17 | private final net.minecraft.core.particles.Particle registryParticle = (net.minecraft.core.particles.Particle) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", "tinted_leaves")); 18 | protected Color color; 19 | 20 | public ParticleTintedLeaves(@Nullable Color color, double offsetX, double offsetY, double offsetZ, int count) { 21 | super("", offsetX, offsetY, offsetZ, count); 22 | 23 | particle = ColorParticleOption.a(registryParticle, 255 << 24 | ((color != null) ? color.getRGB() : Color.WHITE.getRGB())); 24 | 25 | setColor(color); 26 | } 27 | 28 | public ParticleTintedLeaves(@Nullable Color color, double offsetX, double offsetY, double offsetZ) { 29 | this(color, offsetX, offsetY, offsetZ, 1); 30 | } 31 | 32 | public ParticleTintedLeaves(@Nullable Color color, int count) { 33 | this(color, 0, 0, 0, count); 34 | } 35 | 36 | public ParticleTintedLeaves(double offsetX, double offsetY, double offsetZ, int count) { 37 | this(null, offsetX, offsetY, offsetZ, count); 38 | } 39 | 40 | public ParticleTintedLeaves(double offsetX, double offsetY, double offsetZ) { 41 | this(null, offsetX, offsetY, offsetZ, 1); 42 | } 43 | 44 | public ParticleTintedLeaves(@Nullable Color color) { 45 | this(color, 0, 0, 0, 1); 46 | } 47 | 48 | public ParticleTintedLeaves(int count) { 49 | this(null, 0, 0, 0, count); 50 | } 51 | 52 | public ParticleTintedLeaves() { 53 | this(null, 0, 0, 0, 1); 54 | } 55 | 56 | @Override 57 | public ParticleTintedLeaves inherit(Particle particle) { 58 | super.inherit(particle); 59 | 60 | if (particle instanceof ColorableParticle) { 61 | color = ((ColorableParticle) particle).getColor(); 62 | } 63 | 64 | return this; 65 | } 66 | 67 | @Override 68 | public ParticleTintedLeaves clone() { 69 | return new ParticleTintedLeaves().inherit(this); 70 | } 71 | 72 | @Override 73 | protected void display(Location location, List players) { 74 | ColorParticleOption p = (ColorParticleOption) particle; 75 | 76 | if (color == null) { 77 | particle = ColorParticleOption.a(registryParticle, 255 << 24 | rng.nextInt(0xffffff)); 78 | } else if (p.b() * 255 != color.getRed() || p.c() * 255 != color.getGreen() || p.d() * 255 != color.getBlue()) { 79 | particle = ColorParticleOption.a(registryParticle, 255 << 24 | color.getRGB()); 80 | } 81 | 82 | super.display(location, players); 83 | } 84 | 85 | public void setColor(@Nullable Color color) { 86 | this.color = color; 87 | } 88 | 89 | public void setColor(int red, int green, int blue) { 90 | if (color != null && !color.isLocked()) { 91 | color.setRed(red); 92 | color.setGreen(green); 93 | color.setBlue(blue); 94 | } else { 95 | this.color = new Color(red, green, blue); 96 | } 97 | } 98 | 99 | @Nullable 100 | public Color getColor() { 101 | return color; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleTotem.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleTotem extends TravellingParticle { 9 | public ParticleTotem(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("totem_of_undying", false, 0.44, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleTotem(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("totem_of_undying", false, 0.44, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleTotem(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleTotem(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleTotem(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleTotem(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleTotem(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleTotem(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleTotem(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleTotem() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleTotem inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleTotem clone() { 58 | return new ParticleTotem().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleTrialOminous.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleTrialOminous extends TravellingParticle { 9 | public ParticleTrialOminous(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("trial_spawner_detection_ominous", false, 0.075, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleTrialOminous(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("trial_spawner_detection_ominous", false, 0.075, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleTrialOminous(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleTrialOminous(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleTrialOminous(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleTrialOminous(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleTrialOminous(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleTrialOminous(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleTrialOminous(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleTrialOminous() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleTrialOminous inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleTrialOminous clone() { 58 | return new ParticleTrialOminous().inherit(this); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleTrialSpawner.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleTrialSpawner extends TravellingParticle { 9 | public ParticleTrialSpawner(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("trial_spawner_detection", false, 0.075, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleTrialSpawner(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("trial_spawner_detection", false, 0.075, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleTrialSpawner(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleTrialSpawner(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleTrialSpawner(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleTrialSpawner(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleTrialSpawner(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleTrialSpawner(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleTrialSpawner(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleTrialSpawner() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleTrialSpawner inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleTrialSpawner clone() { 58 | return new ParticleTrialSpawner().inherit(this); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleUnderwater.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | /** 6 | * NOTE: only visible underwater 7 | */ 8 | public class ParticleUnderwater extends Particle { 9 | /**@see ParticleUnderwater */ 10 | public ParticleUnderwater(double offsetX, double offsetY, double offsetZ, int count) { 11 | super("underwater", offsetX, offsetY, offsetZ, count); 12 | } 13 | 14 | /**@see ParticleUnderwater */ 15 | public ParticleUnderwater(double offsetX, double offsetY, double offsetZ) { 16 | this(offsetX, offsetY, offsetZ, 1); 17 | } 18 | 19 | /**@see ParticleUnderwater */ 20 | public ParticleUnderwater(int count) { 21 | this(0, 0, 0, count); 22 | } 23 | 24 | /**@see ParticleUnderwater */ 25 | public ParticleUnderwater() { 26 | this(0, 0, 0, 1); 27 | } 28 | 29 | @Override 30 | public ParticleUnderwater inherit(Particle particle) { 31 | super.inherit(particle); 32 | 33 | return this; 34 | } 35 | 36 | @Override 37 | public ParticleUnderwater clone() { 38 | return new ParticleUnderwater().inherit(this); 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleVault.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleVault extends TravellingParticle { 9 | public ParticleVault(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("vault_connection", true, 0, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleVault(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("vault_connection", true, 0, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleVault(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleVault(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleVault(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleVault(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleVault(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleVault(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleVault(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleVault() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleVault inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleVault clone() { 58 | return new ParticleVault().inherit(this); 59 | } 60 | 61 | @Override 62 | protected Vector getXYZ(Location location) { 63 | Vector vec = super.getXYZ(location); 64 | 65 | return vec.setY(vec.getY() + 1.2); 66 | } 67 | 68 | @Override 69 | protected Vector getOffsets(Location location) { 70 | Vector vec = super.getOffsets(location); 71 | 72 | return vec.setY(vec.getY() - 1.2).multiply(1.5); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleWarpedSpore.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import net.minecraft.core.particles.Particles; 5 | 6 | public class ParticleWarpedSpore extends Particle { 7 | public ParticleWarpedSpore(double offsetX, double offsetY, double offsetZ, int count) { 8 | super("warped_spore", offsetX, offsetY, offsetZ, count); 9 | } 10 | 11 | public ParticleWarpedSpore(double offsetX, double offsetY, double offsetZ) { 12 | this(offsetX, offsetY, offsetZ, 1); 13 | } 14 | 15 | public ParticleWarpedSpore(int count) { 16 | this(0, 0, 0, count); 17 | } 18 | 19 | public ParticleWarpedSpore() { 20 | this(0, 0, 0, 1); 21 | } 22 | 23 | @Override 24 | public ParticleWarpedSpore inherit(Particle particle) { 25 | super.inherit(particle); 26 | 27 | return this; 28 | } 29 | 30 | @Override 31 | public ParticleWarpedSpore clone() { 32 | return new ParticleWarpedSpore().inherit(this); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleWater.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.LiquidParticle; 4 | import hm.zelha.particlesfx.particles.parents.Particle; 5 | import hm.zelha.particlesfx.util.LiquidParticleState; 6 | import net.minecraft.core.particles.ParticleType; 7 | import net.minecraft.core.registries.BuiltInRegistries; 8 | import net.minecraft.resources.MinecraftKey; 9 | 10 | import java.util.Locale; 11 | 12 | public class ParticleWater extends Particle implements LiquidParticle { 13 | 14 | private LiquidParticleState state = LiquidParticleState.DRIPPING; 15 | 16 | public ParticleWater(double offsetX, double offsetY, double offsetZ, int count) { 17 | super("dripping_water", offsetX, offsetY, offsetZ, count); 18 | } 19 | 20 | public ParticleWater(double offsetX, double offsetY, double offsetZ) { 21 | this(offsetX, offsetY, offsetZ, 1); 22 | } 23 | 24 | public ParticleWater(int count) { 25 | this(0, 0, 0, count); 26 | } 27 | 28 | public ParticleWater() { 29 | this(0, 0, 0, 1); 30 | } 31 | 32 | @Override 33 | public ParticleWater inherit(Particle particle) { 34 | super.inherit(particle); 35 | 36 | if (particle instanceof LiquidParticle) { 37 | setLiquidState(((LiquidParticle) particle).getLiquidState()); 38 | } 39 | 40 | return this; 41 | } 42 | 43 | @Override 44 | public ParticleWater clone() { 45 | return new ParticleWater().inherit(this); 46 | } 47 | 48 | @Override 49 | public ParticleWater setLiquidState(LiquidParticleState state) { 50 | if (state == LiquidParticleState.LANDING) throw new IllegalArgumentException("The \"LANDING\" state doesn't exist for this particle!"); 51 | 52 | particle = (ParticleType) BuiltInRegistries.i.a(MinecraftKey.a("minecraft", state.name().toLowerCase(Locale.ROOT) + "_water")); 53 | this.state = state; 54 | 55 | return this; 56 | } 57 | 58 | @Override 59 | public LiquidParticleState getLiquidState() { 60 | return state; 61 | } 62 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleWaxOff.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleWaxOff extends TravellingParticle { 9 | public ParticleWaxOff(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("wax_off", false, 5.25, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleWaxOff(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("wax_off", false, 5.25, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleWaxOff(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleWaxOff(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleWaxOff(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleWaxOff(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleWaxOff(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleWaxOff(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleWaxOff(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleWaxOff() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleWaxOff inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleWaxOff clone() { 58 | return new ParticleWaxOff().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleWaxOn.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.particles.parents.TravellingParticle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public class ParticleWaxOn extends TravellingParticle { 9 | public ParticleWaxOn(Location toGo, double offsetX, double offsetY, double offsetZ, int count) { 10 | super("wax_on", false, 5.25, null, toGo, offsetX, offsetY, offsetZ, count); 11 | } 12 | 13 | public ParticleWaxOn(Vector velocity, double offsetX, double offsetY, double offsetZ, int count) { 14 | super("wax_on", false, 5.25, velocity, null, offsetX, offsetY, offsetZ, count); 15 | } 16 | 17 | public ParticleWaxOn(Location toGo, double offsetX, double offsetY, double offsetZ) { 18 | this(toGo, offsetX, offsetY, offsetZ, 1); 19 | } 20 | 21 | public ParticleWaxOn(Vector velocity, double offsetX, double offsetY, double offsetZ) { 22 | this(velocity, offsetX, offsetY, offsetZ, 1); 23 | } 24 | 25 | public ParticleWaxOn(double offsetX, double offsetY, double offsetZ, int count) { 26 | this((Location) null, offsetX, offsetY, offsetZ, count); 27 | } 28 | 29 | public ParticleWaxOn(double offsetX, double offsetY, double offsetZ) { 30 | this((Location) null, offsetX, offsetY, offsetZ, 1); 31 | } 32 | 33 | public ParticleWaxOn(int count) { 34 | this((Location) null, 0, 0, 0, count); 35 | } 36 | 37 | public ParticleWaxOn(Location toGo) { 38 | this(toGo, 0, 0, 0, 1); 39 | } 40 | 41 | public ParticleWaxOn(Vector velocity) { 42 | this(velocity, 0, 0, 0, 1); 43 | } 44 | 45 | public ParticleWaxOn() { 46 | this((Location) null, 0, 0, 0, 1); 47 | } 48 | 49 | @Override 50 | public ParticleWaxOn inherit(Particle particle) { 51 | super.inherit(particle); 52 | 53 | return this; 54 | } 55 | 56 | @Override 57 | public ParticleWaxOn clone() { 58 | return new ParticleWaxOn().inherit(this); 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/ParticleWitch.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | 5 | public class ParticleWitch extends Particle { 6 | public ParticleWitch(double offsetX, double offsetY, double offsetZ, int count) { 7 | super("witch", offsetX, offsetY, offsetZ, count); 8 | } 9 | 10 | public ParticleWitch(double offsetX, double offsetY, double offsetZ) { 11 | this(offsetX, offsetY, offsetZ, 1); 12 | } 13 | 14 | public ParticleWitch(int count) { 15 | this(0, 0, 0, count); 16 | } 17 | 18 | public ParticleWitch() { 19 | this(0, 0, 0, 1); 20 | } 21 | 22 | @Override 23 | public ParticleWitch inherit(Particle particle) { 24 | super.inherit(particle); 25 | 26 | return this; 27 | } 28 | 29 | @Override 30 | public ParticleWitch clone() { 31 | return new ParticleWitch().inherit(this); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/parents/ColorableParticle.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles.parents; 2 | 3 | import hm.zelha.particlesfx.util.Color; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | public interface ColorableParticle extends IParticle { 8 | ColorableParticle inherit(Particle particle); 9 | 10 | ColorableParticle clone(); 11 | 12 | /** 13 | * @param color color to set, null if you want random coloring 14 | */ 15 | void setColor(@Nullable Color color); 16 | 17 | void setColor(int red, int green, int blue); 18 | 19 | /** 20 | * nullable to allow for randomly colored particles without being complicated 21 | * 22 | * @return color this particle is using 23 | */ 24 | @Nullable 25 | Color getColor(); 26 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/parents/IParticle.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles.parents; 2 | 3 | import org.bukkit.Location; 4 | import org.bukkit.entity.Player; 5 | 6 | import java.util.List; 7 | import java.util.UUID; 8 | 9 | public interface IParticle { 10 | void display(Location location); 11 | 12 | void displayForPlayers(Location location, Player... players); 13 | 14 | void displayForPlayers(Location location, List players); 15 | 16 | /** 17 | * @param particle particle for this object to copy data from 18 | * @return this object 19 | */ 20 | IParticle inherit(Particle particle); 21 | 22 | IParticle clone(); 23 | 24 | void setOffset(double x, double y, double z); 25 | 26 | void setOffsetX(double offsetX); 27 | 28 | void setOffsetY(double offsetY); 29 | 30 | void setOffsetZ(double offsetZ); 31 | 32 | Particle setSpeed(double speed); 33 | 34 | void setCount(int count); 35 | 36 | Particle setRadius(int radius); 37 | 38 | double getOffsetX(); 39 | 40 | double getOffsetY(); 41 | 42 | double getOffsetZ(); 43 | 44 | double getSpeed(); 45 | 46 | int getCount(); 47 | 48 | int getRadius(); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/parents/LiquidParticle.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles.parents; 2 | 3 | import hm.zelha.particlesfx.util.LiquidParticleState; 4 | 5 | public interface LiquidParticle extends IParticle { 6 | LiquidParticle inherit(Particle particle); 7 | 8 | LiquidParticle clone(); 9 | 10 | /** 11 | * @param state The type of liquid particle this object represents, keep in mind some LiquidParticles don't support all states. 12 | * @return this object 13 | */ 14 | LiquidParticle setLiquidState(LiquidParticleState state); 15 | 16 | /** 17 | * @return The type of liquid particle this object represents, keep in mind some LiquidParticles don't support all states. 18 | */ 19 | LiquidParticleState getLiquidState(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/parents/MaterialParticle.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles.parents; 2 | 3 | import org.bukkit.Material; 4 | 5 | public interface MaterialParticle extends IParticle { 6 | MaterialParticle inherit(Particle particle); 7 | 8 | MaterialParticle clone(); 9 | 10 | void setMaterial(Material material); 11 | 12 | Material getMaterial(); 13 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/particles/parents/SizeableParticle.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.particles.parents; 2 | 3 | public interface SizeableParticle extends IParticle { 4 | SizeableParticle inherit(Particle particle); 5 | 6 | SizeableParticle clone(); 7 | 8 | void setSize(double size); 9 | 10 | double getSize(); 11 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/shapers/ParticleCircleFilled.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.shapers; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.shapers.parents.ParticleShaper; 5 | import hm.zelha.particlesfx.util.LocationSafe; 6 | import hm.zelha.particlesfx.util.ParticleShapeCompound; 7 | import hm.zelha.particlesfx.util.ShapeDisplayMechanic; 8 | 9 | public class ParticleCircleFilled extends ParticleCircle { 10 | 11 | private int iterations = 0; 12 | 13 | public ParticleCircleFilled(Particle particle, LocationSafe center, double xRadius, double zRadius, double pitch, double yaw, double roll, int particleFrequency) { 14 | super(particle, center, xRadius, zRadius, pitch, yaw, roll, particleFrequency); 15 | } 16 | 17 | public ParticleCircleFilled(Particle particle, LocationSafe center, double xRadius, double zRadius, double pitch, double yaw, double roll) { 18 | this(particle, center, xRadius, zRadius, pitch, yaw, roll, 150); 19 | } 20 | 21 | public ParticleCircleFilled(Particle particle, LocationSafe center, double xRadius, double zRadius, int particleFrequency) { 22 | this(particle, center, xRadius, zRadius, 0, 0, 0, particleFrequency); 23 | } 24 | 25 | public ParticleCircleFilled(Particle particle, LocationSafe center, double xRadius, double zRadius) { 26 | this(particle, center, xRadius, zRadius, 0, 0, 0, 150); 27 | } 28 | 29 | public ParticleCircleFilled(Particle particle, LocationSafe center, double radius) { 30 | this(particle, center, radius, radius, 0, 0, 0, 150); 31 | } 32 | 33 | //https://medium.com/@vagnerseibert/distributing-points-on-a-sphere-6b593cc05b42 34 | @Override 35 | public void display() { 36 | boolean hasRan = false; 37 | boolean trackCount = particlesPerDisplay > 0; 38 | int count = (int) (particleFrequency * 100 / (100 - limit)); 39 | 40 | for (; iterations < count; iterations++) { 41 | //radian = PI * PHI * 2 * i 42 | //PHI = golden ratio = (1 + Math.sqrt(5)) / 2 43 | double radian = Math.PI * (1 + Math.sqrt(5)) * iterations; 44 | 45 | if (radian - ((int) (radian / (Math.PI * 2))) * (Math.PI * 2) < (Math.PI * 2 * limit / 100)) continue; 46 | 47 | if (limitInverse) { 48 | radian = -radian; 49 | } 50 | 51 | Particle particle = getCurrentParticle(); 52 | double r = Math.sqrt((double) iterations / count); 53 | 54 | locationHelper.zero().add(getCenter()); 55 | vectorHelper.setX(xRadius * r * Math.cos(radian)); 56 | vectorHelper.setY(0); 57 | vectorHelper.setZ(zRadius * r * Math.sin(radian)); 58 | 59 | if (overallCount == 0) applyMechanics(ShapeDisplayMechanic.Phase.BEFORE_DISPLAY_FULL, particle, locationHelper, vectorHelper); 60 | if (currentCount == 0) applyMechanics(ShapeDisplayMechanic.Phase.BEFORE_DISPLAY, particle, locationHelper, vectorHelper); 61 | 62 | applyMechanics(ShapeDisplayMechanic.Phase.BEFORE_ROTATION, particle, locationHelper, vectorHelper); 63 | rot.apply(vectorHelper); 64 | 65 | for (ParticleShapeCompound compound : compounds) { 66 | rotHelper.inherit(compound).apply(vectorHelper); 67 | } 68 | 69 | applyMechanics(ShapeDisplayMechanic.Phase.AFTER_ROTATION, particle, locationHelper, vectorHelper); 70 | locationHelper.add(vectorHelper); 71 | 72 | if (!players.isEmpty()) { 73 | particle.displayForPlayers(locationHelper, players); 74 | } else { 75 | particle.display(locationHelper); 76 | } 77 | 78 | overallCount++; 79 | currentCount++; 80 | 81 | applyMechanics(ShapeDisplayMechanic.Phase.AFTER_DISPLAY_PARTICLE, particle, locationHelper, vectorHelper); 82 | 83 | if (trackCount && currentCount >= particlesPerDisplay) { 84 | currentCount = 0; 85 | hasRan = true; 86 | 87 | break; 88 | } 89 | } 90 | 91 | if (!trackCount || hasRan) { 92 | applyMechanics(ShapeDisplayMechanic.Phase.AFTER_DISPLAY, particle, locationHelper, vectorHelper); 93 | } 94 | 95 | if (!trackCount || !hasRan) { 96 | applyMechanics(ShapeDisplayMechanic.Phase.AFTER_DISPLAY_FULL, particle, locationHelper, vectorHelper); 97 | 98 | overallCount = 0; 99 | iterations = 0; 100 | 101 | if (trackCount) { 102 | display(); 103 | 104 | return; 105 | } 106 | 107 | currentCount = 0; 108 | } 109 | } 110 | 111 | @Override 112 | public ParticleCircleFilled clone() { 113 | ParticleCircleFilled clone = (ParticleCircleFilled) super.clone(); 114 | clone.iterations = iterations; 115 | 116 | return clone; 117 | } 118 | 119 | @Override 120 | protected ParticleShaper cloneConstructor() { 121 | return new ParticleCircleFilled(particle, locations.get(0).clone(), xRadius, zRadius, getPitch(), getYaw(), getRoll(), particleFrequency); 122 | } 123 | 124 | @Override 125 | public void setDisplayPosition(int position) { 126 | iterations = (int) ((int) (particleFrequency * 100 / (100 - limit)) * ((double) overallCount / particleFrequency)); 127 | 128 | super.setDisplayPosition(position); 129 | } 130 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/shapers/ParticleLine.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.shapers; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.shapers.parents.ParticleShaper; 5 | import hm.zelha.particlesfx.util.LVMath; 6 | import hm.zelha.particlesfx.util.LocationSafe; 7 | import hm.zelha.particlesfx.util.ShapeDisplayMechanic; 8 | import org.apache.commons.lang.Validate; 9 | import org.bukkit.Location; 10 | 11 | public class ParticleLine extends ParticleShaper { 12 | public ParticleLine(Particle particle, int particleFrequency, LocationSafe... locations) { 13 | super(particle, particleFrequency); 14 | 15 | Validate.isTrue(locations.length >= 2, "Line must have 2 or more locations!"); 16 | 17 | for (LocationSafe location : locations) { 18 | addLocation(location); 19 | } 20 | 21 | setWorld(super.locations.get(0).getWorld()); 22 | start(); 23 | } 24 | 25 | public ParticleLine(Particle particle, LocationSafe... locations) { 26 | this(particle, locations.length * 25, locations); 27 | } 28 | 29 | @Override 30 | public void display() { 31 | double control = getTotalDistance() / particleFrequency; 32 | boolean hasRan = false; 33 | boolean trackCount = particlesPerDisplay > 0; 34 | int current = overallCount; 35 | 36 | main: 37 | for (int i = 0; i < locations.size() - 1; i++) { 38 | Location start = locations.get(i); 39 | Location end = locations.get(i + 1); 40 | int particleAmount = (int) Math.max(start.distance(end) / control, 1); 41 | 42 | if (current >= particleAmount) { 43 | current -= particleAmount; 44 | 45 | continue; 46 | } 47 | 48 | locationHelper.zero().add(start); 49 | LVMath.subtractToVector(vectorHelper, end, start).normalize().multiply(control); 50 | locationHelper.add(vectorHelper.getX() * current, vectorHelper.getY() * current, vectorHelper.getZ() * current); 51 | 52 | for (int k = current; k < particleAmount; k++) { 53 | Particle particle = getCurrentParticle(); 54 | 55 | if (overallCount == 0) applyMechanics(ShapeDisplayMechanic.Phase.BEFORE_DISPLAY_FULL, particle, locationHelper, vectorHelper); 56 | if (currentCount == 0) applyMechanics(ShapeDisplayMechanic.Phase.BEFORE_DISPLAY, particle, locationHelper, vectorHelper); 57 | 58 | applyMechanics(ShapeDisplayMechanic.Phase.BEFORE_ROTATION, particle, locationHelper, vectorHelper); 59 | 60 | if (!players.isEmpty()) { 61 | particle.displayForPlayers(locationHelper, players); 62 | } else { 63 | particle.display(locationHelper); 64 | } 65 | 66 | overallCount++; 67 | currentCount++; 68 | 69 | locationHelper.add(vectorHelper); 70 | applyMechanics(ShapeDisplayMechanic.Phase.AFTER_DISPLAY_PARTICLE, particle, locationHelper, vectorHelper); 71 | 72 | if (trackCount && currentCount >= particlesPerDisplay) { 73 | currentCount = 0; 74 | hasRan = true; 75 | 76 | break main; 77 | } 78 | } 79 | 80 | current = 0; 81 | } 82 | 83 | if (!trackCount || hasRan) { 84 | applyMechanics(ShapeDisplayMechanic.Phase.AFTER_DISPLAY, particle, locationHelper, vectorHelper); 85 | } 86 | 87 | if (!trackCount || !hasRan) { 88 | applyMechanics(ShapeDisplayMechanic.Phase.AFTER_DISPLAY_FULL, particle, locationHelper, vectorHelper); 89 | 90 | overallCount = 0; 91 | 92 | if (trackCount) { 93 | display(); 94 | 95 | return; 96 | } 97 | 98 | currentCount = 0; 99 | } 100 | } 101 | 102 | @Override 103 | public ParticleLine clone() { 104 | return (ParticleLine) super.clone(); 105 | } 106 | 107 | @Override 108 | protected ParticleShaper cloneConstructor() { 109 | LocationSafe[] locations = new LocationSafe[this.locations.size()]; 110 | 111 | for (int i = 0; i < getLocationAmount(); i++) { 112 | locations[i] = this.locations.get(i).clone(); 113 | } 114 | 115 | return new ParticleLine(particle, particleFrequency, locations); 116 | } 117 | 118 | public void addLocation(int index, LocationSafe location) { 119 | Validate.notNull(location, "Location can't be null!"); 120 | Validate.notNull(location.getWorld(), "Locations can't have null worlds!"); 121 | 122 | if (locations.size() != 0) { 123 | Validate.isTrue(location.getWorld().equals(locations.get(0).getWorld()), "Locations can't have different worlds!"); 124 | } 125 | 126 | locations.add(index, location); 127 | origins.add(index, location.clone()); 128 | location.setChanged(true); 129 | } 130 | 131 | public void addLocation(LocationSafe location) { 132 | addLocation(locations.size(), location); 133 | } 134 | 135 | public void removeLocation(int index) { 136 | Validate.isTrue(locations.size() - 1 >= 2, "List must contain 2 or more locations!"); 137 | 138 | locations.remove(index); 139 | origins.remove(index); 140 | locations.get(0).setChanged(true); 141 | } 142 | 143 | public Location getLocation(int index) { 144 | return locations.get(index); 145 | } 146 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/ArrayListSafe.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | import hm.zelha.particlesfx.shapers.parents.RotationHandler; 4 | 5 | import java.util.ArrayList; 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | /** 10 | * only meant to be used in ParticleSFX internals

11 | * 12 | * if you're wondering what this does, it's meant to handle the indexing and everything related to keeping 13 | * ParticleShapeCompound working properly, it's nothing you should worry about unless youre trying to create things that 14 | * extend RotationHandler or ParticleShaper and want to allow them to be inside a ParticleShapeCompound.

15 | * 16 | * even if thats the case, i doubt theres any way you could screw it up.

17 | * 18 | * if you're wondering why i did it this way, its because i didnt want anyone potentially messing with any public methods 19 | * i might make in order to accomplish this, so i made it really hard to mess with haha 20 | */ 21 | public class ArrayListSafe extends ArrayList { 22 | 23 | private final Map addMechanics = new HashMap<>(); 24 | private final Map removeMechanics = new HashMap<>(); 25 | private final RotationHandler owner; 26 | 27 | /**@see ArrayListSafe*/ 28 | public ArrayListSafe(RotationHandler owner) { 29 | this.owner = owner; 30 | } 31 | 32 | @Override 33 | public boolean add(L l) { 34 | boolean b = super.add(l); 35 | 36 | for (addMechanic mechanic : addMechanics.values()) { 37 | mechanic.accept(owner, l); 38 | } 39 | 40 | return b; 41 | } 42 | 43 | @Override 44 | public void add(int index, L element) { 45 | super.add(index, element); 46 | 47 | for (addMechanic mechanic : addMechanics.values()) { 48 | mechanic.accept(owner, element); 49 | } 50 | } 51 | 52 | @Override 53 | public L remove(int index) { 54 | L generic = super.remove(index); 55 | 56 | for (removeMechanic mechanic : removeMechanics.values()) { 57 | mechanic.accept(owner, index); 58 | } 59 | 60 | return generic; 61 | } 62 | 63 | public void addAddMechanics(ParticleShapeCompound owner, addMechanic mechanic) { 64 | addMechanics.put(owner, mechanic); 65 | } 66 | 67 | public void addRemoveMechanics(ParticleShapeCompound owner, removeMechanic mechanic) { 68 | removeMechanics.put(owner, mechanic); 69 | } 70 | 71 | public void removeMechanics(ParticleShapeCompound owner) { 72 | addMechanics.remove(owner); 73 | removeMechanics.remove(owner); 74 | } 75 | 76 | 77 | public interface addMechanic { 78 | public void accept(RotationHandler owner, LocationSafe added); 79 | } 80 | 81 | 82 | public interface removeMechanic { 83 | public void accept(RotationHandler owner, int index); 84 | } 85 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/CircleInfo.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | import org.apache.commons.lang.Validate; 4 | import org.bukkit.Location; 5 | 6 | public class CircleInfo { 7 | 8 | private LocationSafe center = null; 9 | private boolean modified = false; 10 | private double pitch; 11 | private double yaw; 12 | private double roll; 13 | private double xRadius; 14 | private double zRadius; 15 | 16 | public CircleInfo(LocationSafe center, double xRadius, double zRadius, double pitch, double yaw, double roll) { 17 | setCenter(center); 18 | setPitch(pitch); 19 | setYaw(yaw); 20 | setRoll(roll); 21 | setXRadius(xRadius); 22 | setZRadius(zRadius); 23 | } 24 | 25 | public CircleInfo(LocationSafe center, double radius, double pitch, double yaw, double roll) { 26 | this(center, radius, radius, pitch, yaw, roll); 27 | } 28 | 29 | public CircleInfo(LocationSafe center, double xRadius, double zRadius) { 30 | this(center, xRadius, zRadius, 0, 0, 0); 31 | } 32 | 33 | public CircleInfo(LocationSafe center, double radius) { 34 | this(center, radius, radius, 0, 0, 0); 35 | } 36 | 37 | /** 38 | * @param other CircleInfo for this object to copy data from 39 | * @return this object 40 | */ 41 | public CircleInfo inherit(CircleInfo other) { 42 | setPitch(other.pitch); 43 | setYaw(other.yaw); 44 | setRoll(other.roll); 45 | setXRadius(other.xRadius); 46 | setZRadius(other.zRadius); 47 | 48 | center.setWorld(other.getCenter().getWorld()); 49 | center.zero().add(other.getCenter()); 50 | 51 | return this; 52 | } 53 | 54 | public CircleInfo clone() { 55 | return new CircleInfo(center.clone(), xRadius, zRadius, pitch, yaw, roll); 56 | } 57 | 58 | public void setCenter(LocationSafe center) { 59 | Validate.notNull(center, "Location cannot be null!"); 60 | Validate.notNull(center.getWorld(), "Location's world cannot be null!"); 61 | 62 | if (this.center != null) { 63 | center.setChanged(true); 64 | } 65 | 66 | this.center = center; 67 | } 68 | 69 | public void setXRadius(double xRadius) { 70 | this.xRadius = xRadius; 71 | modified = true; 72 | } 73 | 74 | public void setZRadius(double zRadius) { 75 | this.zRadius = zRadius; 76 | modified = true; 77 | } 78 | 79 | public void setPitch(double pitch) { 80 | this.pitch = pitch; 81 | } 82 | 83 | public void setYaw(double yaw) { 84 | this.yaw = yaw; 85 | } 86 | 87 | public void setRoll(double roll) { 88 | this.roll = roll; 89 | } 90 | 91 | public void setModified(boolean modified) { 92 | this.modified = modified; 93 | } 94 | 95 | public Location getCenter() { 96 | return center; 97 | } 98 | 99 | public double getXRadius() { 100 | return xRadius; 101 | } 102 | 103 | public double getZRadius() { 104 | return zRadius; 105 | } 106 | 107 | public double getPitch() { 108 | return pitch; 109 | } 110 | 111 | public double getYaw() { 112 | return yaw; 113 | } 114 | 115 | public double getRoll() { 116 | return roll; 117 | } 118 | 119 | public boolean isModified() { 120 | return modified; 121 | } 122 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/Color.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | import org.apache.commons.lang.Validate; 4 | 5 | public class Color { 6 | 7 | public static final Color WHITE = new Color(0xFFFFFF).lock(); 8 | public static final Color SILVER = new Color(0xC0C0C0).lock(); 9 | public static final Color GRAY = new Color(0x808080).lock(); 10 | public static final Color DARK_GRAY = new Color(0x404040).lock(); 11 | public static final Color BLACK = new Color(0x000000).lock(); 12 | public static final Color RED = new Color(0xFF0000).lock(); 13 | public static final Color PINK = new Color(0xFFAFAF).lock(); 14 | public static final Color MAROON = new Color(0x800000).lock(); 15 | public static final Color YELLOW = new Color(0xFFFF00).lock(); 16 | public static final Color OLIVE = new Color(0x808000).lock(); 17 | public static final Color LIME = new Color(0x00FF00).lock(); 18 | public static final Color GREEN = new Color(0x008000).lock(); 19 | public static final Color AQUA = new Color(0x00FFFF).lock(); 20 | public static final Color TEAL = new Color(0x008080).lock(); 21 | public static final Color BLUE = new Color(0x0000FF).lock(); 22 | public static final Color NAVY = new Color(0x000080).lock(); 23 | public static final Color MAGENTA = new Color(0xFF00FF).lock(); 24 | public static final Color PURPLE = new Color(0x800080).lock(); 25 | public static final Color ORANGE = new Color(0xFFA500).lock(); 26 | private int red; 27 | private int green; 28 | private int blue; 29 | private boolean locked = false; 30 | 31 | public Color(int red, int green, int blue) { 32 | setRed(red); 33 | setGreen(green); 34 | setBlue(blue); 35 | } 36 | 37 | public Color(int rgb) { 38 | setRGB(rgb); 39 | } 40 | 41 | @Override 42 | public boolean equals(Object o) { 43 | if (this == o) return true; 44 | if (!(o instanceof Color)) return false; 45 | 46 | Color color = (Color) o; 47 | 48 | return red == color.red && green == color.green && blue == color.blue; 49 | } 50 | 51 | public Color clone() { 52 | return new Color(red, green, blue); 53 | } 54 | 55 | /** 56 | * makes this object unmodifiable 57 | * 58 | * @return this object 59 | */ 60 | public Color lock() { 61 | locked = true; 62 | 63 | return this; 64 | } 65 | 66 | public void setRGB(int rgb) { 67 | if (locked) throw new UnsupportedOperationException("Cannot modify locked Colors!"); 68 | 69 | Validate.isTrue((rgb >> 24) == 0, "Extrenuous data in: ", rgb); 70 | 71 | setRed(rgb >> 16 & 0xFF); 72 | setGreen(rgb >> 8 & 0xFF); 73 | setBlue(rgb & 0xFF); 74 | } 75 | 76 | public void setRed(int red) { 77 | if (locked) throw new UnsupportedOperationException("Cannot modify locked Colors!"); 78 | 79 | Validate.isTrue(red >= 0 && red <= 255, "Red is not between 0-255: ", red); 80 | 81 | this.red = red; 82 | } 83 | 84 | public void setGreen(int green) { 85 | if (locked) throw new UnsupportedOperationException("Cannot modify locked Colors!"); 86 | 87 | Validate.isTrue(green >= 0 && green <= 255, "Green is not between 0-255: ", green); 88 | 89 | this.green = green; 90 | } 91 | 92 | public void setBlue(int blue) { 93 | if (locked) throw new UnsupportedOperationException("Cannot modify locked Colors!"); 94 | 95 | Validate.isTrue(blue >= 0 && blue <= 255, "Blue is not between 0-255: ", blue); 96 | 97 | this.blue = blue; 98 | } 99 | 100 | public int getRGB() { 101 | return red << 16 | green << 8 | blue; 102 | } 103 | 104 | public int getRed() { 105 | return red; 106 | } 107 | 108 | public int getGreen() { 109 | return green; 110 | } 111 | 112 | public int getBlue() { 113 | return blue; 114 | } 115 | 116 | /** 117 | * @return whether this object can be modified 118 | */ 119 | public boolean isLocked() { 120 | return locked; 121 | } 122 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/Corner.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | import org.apache.commons.lang.Validate; 4 | import org.bukkit.Location; 5 | import org.bukkit.World; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | public class Corner { 11 | 12 | private final List connections = new ArrayList<>(); 13 | private LocationSafe location; 14 | 15 | public Corner(LocationSafe location) { 16 | setLocation(location); 17 | } 18 | 19 | public Corner(World world, double x, double y, double z) { 20 | setLocation(new LocationSafe(world, x, y, z)); 21 | } 22 | 23 | public Corner clone() { 24 | Corner corner = new Corner(location.clone()); 25 | 26 | corner.connections.addAll(connections); 27 | 28 | return corner; 29 | } 30 | 31 | /** 32 | * @param index index for the given corner to be added to this corner's connection list 33 | * @param corner corner to connect to 34 | */ 35 | public void connect(int index, Corner corner) { 36 | Validate.notNull(corner, "Connection can't be null!"); 37 | Validate.isTrue(corner != this, "Corners cant connect to themselves!"); 38 | 39 | connections.add(index, corner); 40 | } 41 | 42 | /** 43 | * @param corner corner to connect to 44 | */ 45 | public void connect(Corner corner) { 46 | connect(connections.size(), corner); 47 | } 48 | 49 | /** 50 | * @param index index of connection to be removed from this corner's list 51 | */ 52 | public void disconnect(int index) { 53 | connections.remove(index); 54 | } 55 | 56 | /** 57 | * @param corner connection to be removed from this corner's list 58 | */ 59 | public void disconnect(Corner corner) { 60 | connections.remove(corner); 61 | } 62 | 63 | /** 64 | * @param index index to set 65 | * @param corner connection to replace the corner at index 66 | */ 67 | public void setConnection(int index, Corner corner) { 68 | Validate.notNull(corner, "Connection can't be null!"); 69 | Validate.isTrue(corner != this, "Corners cant connect to themselves!"); 70 | 71 | connections.set(index, corner); 72 | } 73 | 74 | public void setLocation(LocationSafe location) { 75 | Validate.notNull(location, "Location cannot be null!"); 76 | Validate.notNull(location.getWorld(), "Location's world cannot be null!"); 77 | 78 | if (this.location != null) { 79 | location.setChanged(true); 80 | } 81 | 82 | this.location = location; 83 | } 84 | 85 | public Corner getConnection(int index) { 86 | return connections.get(index); 87 | } 88 | 89 | public Location getLocation() { 90 | return location; 91 | } 92 | 93 | public int getConnectionAmount() { 94 | return connections.size(); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/CurveInfo.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | import org.apache.commons.lang.Validate; 4 | 5 | public class CurveInfo { 6 | 7 | private double height; 8 | private double length; 9 | private double apexPosition; 10 | private double pitch; 11 | private double yaw; 12 | private double roll; 13 | 14 | public CurveInfo(double height, double length, double apexPosition, double pitch, double yaw, double roll) { 15 | setHeight(height); 16 | setLength(length); 17 | setApexPosition(apexPosition); 18 | setPitch(pitch); 19 | setYaw(yaw); 20 | setRoll(roll); 21 | } 22 | 23 | public CurveInfo(double height, double length, double apexPosition) { 24 | this(height, length, apexPosition, 0, 0, 0); 25 | } 26 | 27 | public CurveInfo(double height, double length) { 28 | this(height, length, length / 2, 0, 0, 0); 29 | } 30 | 31 | public CurveInfo clone() { 32 | return new CurveInfo(height, length, apexPosition, pitch, yaw, roll); 33 | } 34 | 35 | public void setHeight(double height) { 36 | this.height = height; 37 | } 38 | 39 | public void setLength(double length) { 40 | Validate.isTrue(length > 0, "Length must be greater than 0!"); 41 | 42 | this.length = length; 43 | } 44 | 45 | /** 46 | * @param apexPosition where the highest point of the curve should be, must be less than length and greater than 0 47 | */ 48 | public void setApexPosition(double apexPosition) { 49 | Validate.isTrue(apexPosition < length && apexPosition >= 0, "Apex must be within the line!"); 50 | 51 | this.apexPosition = apexPosition; 52 | } 53 | 54 | public void setPitch(double pitch) { 55 | this.pitch = pitch; 56 | } 57 | 58 | public void setYaw(double yaw) { 59 | this.yaw = yaw; 60 | } 61 | 62 | public void setRoll(double roll) { 63 | this.roll = roll; 64 | } 65 | 66 | public double getHeight() { 67 | return height; 68 | } 69 | 70 | public double getLength() { 71 | return length; 72 | } 73 | 74 | /** 75 | * @return where the highest point of the curve should be 76 | */ 77 | public double getApexPosition() { 78 | return apexPosition; 79 | } 80 | 81 | public double getPitch() { 82 | return pitch; 83 | } 84 | 85 | public double getYaw() { 86 | return yaw; 87 | } 88 | 89 | public double getRoll() { 90 | return roll; 91 | } 92 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/LVMath.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | import org.bukkit.Location; 4 | import org.bukkit.util.Vector; 5 | 6 | /** location and vector math utils for cleaner code, not meant to be used outside ParticleSFX internals */ 7 | public final class LVMath { 8 | 9 | private LVMath() { 10 | } 11 | 12 | /** 13 | * @param vector vector to get absolute sum from 14 | * @return the sum of the absolute values of the X, Y, and Z of the given vector 15 | */ 16 | public static double getAbsoluteSum(Vector vector) { 17 | return Math.abs(vector.getX()) + Math.abs(vector.getY()) + Math.abs(vector.getZ()); 18 | } 19 | 20 | /** 21 | * @param vector vector to copy the given location's info to 22 | * @param location the location to copy 23 | * @return the given vector 24 | */ 25 | public static Vector toVector(Vector vector, Location location) { 26 | return vector.setX(location.getX()).setY(location.getY()).setZ(location.getZ()); 27 | } 28 | 29 | /** 30 | * @param vector vector to divide 31 | * @param dividend number to divide the given vector's X, Y, and Z coordinates by 32 | * @return the given vector, with its coordinates divided by the given dividend or zeroed if the dividend is 0 or not finite. 33 | */ 34 | public static Vector divide(Vector vector, double dividend) { 35 | if (dividend == 0 || !Double.isFinite(dividend)) return vector.zero(); 36 | 37 | return vector.multiply(1 / dividend); 38 | } 39 | 40 | /** 41 | * @param toSet vector to modify 42 | * @param location location to be subtracted from 43 | * @param subtrahend location to be subtracted 44 | * @return the given vector 45 | */ 46 | public static Vector subtractToVector(Vector toSet, Location location, Location subtrahend) { 47 | toSet.setX(location.getX() - subtrahend.getX()); 48 | toSet.setY(location.getY() - subtrahend.getY()); 49 | toSet.setZ(location.getZ() - subtrahend.getZ()); 50 | 51 | return toSet; 52 | } 53 | 54 | /** 55 | * @param toSet location to modify 56 | * @param toAddTo location to be added to 57 | * @param addend vector to add 58 | * @param causedByCompound whether this was caused by a {@link ParticleShapeCompound} 59 | * @return the location that was modified 60 | */ 61 | public static Location additionToLocation(Location toSet, Location toAddTo, Vector addend, boolean causedByCompound) { 62 | if (toSet instanceof LocationSafe) { 63 | ((LocationSafe) toSet).setUnsafely(toAddTo.getX() + addend.getX(), toAddTo.getY() + addend.getY(), toAddTo.getZ() + addend.getZ(), causedByCompound); 64 | } else { 65 | toSet.setX(toAddTo.getX() + addend.getX()); 66 | toSet.setY(toAddTo.getY() + addend.getY()); 67 | toSet.setZ(toAddTo.getZ() + addend.getZ()); 68 | } 69 | 70 | return toSet; 71 | } 72 | 73 | /** 74 | * @param toSet location to modify 75 | * @param toAddTo location to be added to 76 | * @param addend vector to add 77 | * @return the location that was modified 78 | */ 79 | public static Location additionToLocation(Location toSet, Location toAddTo, Vector addend) { 80 | return additionToLocation(toSet, toAddTo, addend, false); 81 | } 82 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/LiquidParticleState.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | public enum LiquidParticleState { 4 | DRIPPING, 5 | FALLING, 6 | LANDING 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/LocationSafe.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | import org.bukkit.Location; 4 | import org.bukkit.World; 5 | import org.bukkit.util.Vector; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.function.Consumer; 10 | 11 | /** 12 | * This class is meant to allow me to keep locations mutable without shapes going completely bonkers if they're modified

13 | * 14 | * This class also extends {@link Location} so you can use it in the same way as that class 15 | */ 16 | public class LocationSafe extends Location { 17 | 18 | private final Map> recalcMechanics = new HashMap<>(); 19 | private boolean changed = false; 20 | 21 | /**@see LocationSafe*/ 22 | public LocationSafe(World world, double x, double y, double z) { 23 | super(world, x, y, z); 24 | } 25 | 26 | /**@see LocationSafe*/ 27 | public LocationSafe(Location location) { 28 | super(location.getWorld(), location.getX(), location.getY(), location.getZ()); 29 | } 30 | 31 | /** 32 | * only meant to be used in {@link LVMath}, use at own risk 33 | * 34 | * @param x x coordinate 35 | * @param y y coordinate 36 | * @param z z coordinate 37 | * @param causedByCompound whether this was caused by a {@link ParticleShapeCompound} 38 | */ 39 | public void setUnsafely(double x, double y, double z, boolean causedByCompound) { 40 | super.setX(x); 41 | super.setY(y); 42 | super.setZ(z); 43 | 44 | if (causedByCompound) { 45 | this.changed = true; 46 | } else { 47 | for (Consumer mechanic : recalcMechanics.values()) { 48 | mechanic.accept(this); 49 | } 50 | } 51 | } 52 | 53 | /** 54 | * only meant to be used in {@link ParticleShapeCompound} 55 | * 56 | * @param owner the owner of the shape that owns this location 57 | * @param mechanic mechanic to be ran when this location is modified 58 | */ 59 | public void addRecalcMechanic(ParticleShapeCompound owner, Consumer mechanic) { 60 | recalcMechanics.put(owner, mechanic); 61 | } 62 | 63 | /** 64 | * only meant to be used in {@link ParticleShapeCompound} 65 | * 66 | * @param owner the owner of the shape that owns this location 67 | */ 68 | public void removeRecalcMechanic(ParticleShapeCompound owner) { 69 | recalcMechanics.remove(owner); 70 | } 71 | 72 | @Override 73 | public LocationSafe clone() { 74 | return new LocationSafe(getWorld(), getX(), getY(), getZ()); 75 | } 76 | 77 | @Override 78 | public void setX(double x) { 79 | super.setX(x); 80 | setChanged(true); 81 | } 82 | 83 | @Override 84 | public void setY(double y) { 85 | super.setY(y); 86 | setChanged(true); 87 | } 88 | 89 | @Override 90 | public void setZ(double z) { 91 | super.setZ(z); 92 | setChanged(true); 93 | } 94 | 95 | @Override 96 | public LocationSafe add(Vector vec) { 97 | super.add(vec); 98 | setChanged(true); 99 | 100 | return this; 101 | } 102 | 103 | @Override 104 | public LocationSafe add(Location vec) { 105 | super.add(vec); 106 | setChanged(true); 107 | 108 | return this; 109 | } 110 | 111 | @Override 112 | public LocationSafe add(double x, double y, double z) { 113 | super.add(x, y, z); 114 | setChanged(true); 115 | 116 | return this; 117 | } 118 | 119 | @Override 120 | public LocationSafe subtract(Vector vec) { 121 | super.subtract(vec); 122 | setChanged(true); 123 | 124 | return this; 125 | } 126 | 127 | @Override 128 | public LocationSafe subtract(Location vec) { 129 | super.subtract(vec); 130 | setChanged(true); 131 | 132 | return this; 133 | } 134 | 135 | @Override 136 | public LocationSafe subtract(double x, double y, double z) { 137 | super.subtract(x, y, z); 138 | setChanged(true); 139 | 140 | return this; 141 | } 142 | 143 | @Override 144 | public LocationSafe multiply(double m) { 145 | super.multiply(m); 146 | setChanged(true); 147 | 148 | return this; 149 | } 150 | 151 | @Override 152 | public LocationSafe zero() { 153 | super.zero(); 154 | setChanged(true); 155 | 156 | return this; 157 | } 158 | 159 | public void setChanged(boolean changed) { 160 | this.changed = changed; 161 | 162 | if (changed) { 163 | for (Consumer mechanic : recalcMechanics.values()) { 164 | mechanic.accept(this); 165 | } 166 | } 167 | } 168 | 169 | public boolean isChanged() { 170 | return changed; 171 | } 172 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/Pair.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | public class Pair { 4 | 5 | private final K key; 6 | private final V value; 7 | 8 | public Pair(K key, V value) { 9 | this.key = key; 10 | this.value = value; 11 | } 12 | 13 | public K getKey() { return key; } 14 | 15 | public V getValue() { return value; } 16 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/PolygonLayer.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | import org.apache.commons.lang.Validate; 4 | 5 | /** 6 | * only used in one of ParticlePolygon's constructors for more customizability 7 | */ 8 | public class PolygonLayer { 9 | 10 | private int cornerAmount; 11 | private double xRadius; 12 | private double zRadius; 13 | private double yPosition; 14 | private double pitch; 15 | private double yaw; 16 | private double roll; 17 | 18 | /**@see PolygonLayer*/ 19 | public PolygonLayer(int cornerAmount, double xRadius, double zRadius, double yPosition, double pitch, double yaw, double roll) { 20 | setCornerAmount(cornerAmount); 21 | setXRadius(xRadius); 22 | setZRadius(zRadius); 23 | setYPosition(yPosition); 24 | setPitch(pitch); 25 | setYaw(yaw); 26 | setRoll(roll); 27 | } 28 | 29 | /**@see PolygonLayer*/ 30 | public PolygonLayer(int cornerAmount, double xRadius, double zRadius, double yPosition, double yaw) { 31 | this(cornerAmount, xRadius, zRadius, yPosition, 0, yaw, 0); 32 | } 33 | 34 | /**@see PolygonLayer*/ 35 | public PolygonLayer(int cornerAmount, double xRadius, double zRadius, double yPosition) { 36 | this(cornerAmount, xRadius, zRadius, yPosition, 0, 0, 0); 37 | } 38 | 39 | /**@see PolygonLayer*/ 40 | public PolygonLayer(int cornerAmount, double radius, double yPosition) { 41 | this(cornerAmount, radius, radius, yPosition, 0, 0, 0); 42 | } 43 | 44 | /**@see PolygonLayer*/ 45 | public PolygonLayer(int cornerAmount, double radius) { 46 | this(cornerAmount, radius, radius, 0, 0 ,0, 0); 47 | } 48 | 49 | public void setCornerAmount(int cornerAmount) { 50 | Validate.isTrue(cornerAmount > 0, "Cant have less than 1 corner!"); 51 | 52 | this.cornerAmount = cornerAmount; 53 | } 54 | 55 | public void setXRadius(double xRadius) { 56 | this.xRadius = xRadius; 57 | } 58 | 59 | public void setZRadius(double zRadius) { 60 | this.zRadius = zRadius; 61 | } 62 | 63 | public void setYPosition(double yPosition) { 64 | this.yPosition = yPosition; 65 | } 66 | 67 | public void setPitch(double pitch) { 68 | this.pitch = pitch; 69 | } 70 | 71 | public void setYaw(double yaw) { 72 | this.yaw = yaw; 73 | } 74 | 75 | public void setRoll(double roll) { 76 | this.roll = roll; 77 | } 78 | 79 | public int getCornerAmount() { 80 | return cornerAmount; 81 | } 82 | 83 | public double getXRadius() { 84 | return xRadius; 85 | } 86 | 87 | public double getZRadius() { 88 | return zRadius; 89 | } 90 | 91 | public double getYPosition() { 92 | return yPosition; 93 | } 94 | 95 | public double getPitch() { 96 | return pitch; 97 | } 98 | 99 | public double getYaw() { 100 | return yaw; 101 | } 102 | 103 | public double getRoll() { 104 | return roll; 105 | } 106 | } -------------------------------------------------------------------------------- /src/main/java/hm/zelha/particlesfx/util/ShapeDisplayMechanic.java: -------------------------------------------------------------------------------- 1 | package hm.zelha.particlesfx.util; 2 | 3 | import hm.zelha.particlesfx.particles.parents.Particle; 4 | import hm.zelha.particlesfx.shapers.ParticleCircle; 5 | import org.bukkit.Location; 6 | import org.bukkit.util.Vector; 7 | 8 | public interface ShapeDisplayMechanic { 9 | 10 | /** 11 | * @param particle particle to be displayed

12 | * @param current the location the vector will be/has been added to, in some cases 13 | * this is the last position the particle was displayed, in others it is the center of the shape

14 | * @param addition the vector that will be/has been added to the location before the particle is displayed

15 | * @param count current amount of particles that have been displayed (set back to 0 once the entire shape is displayed) 16 | */ 17 | void apply(Particle particle, Location current, Vector addition, int count); 18 | 19 | enum Phase { 20 | /** 21 | * Ran before any particles are displayed on every call of the display() method. 22 | */ 23 | BEFORE_DISPLAY, 24 | /** 25 | * Ran before any particles are displayed on every full display of the shape. 26 | */ 27 | BEFORE_DISPLAY_FULL, 28 | /** 29 | * Ran before rotation is applied to the location the particle will be displayed to.

30 | * Always ran before the particle is displayed regardless of if rotation is applied in this class or not. 31 | */ 32 | BEFORE_ROTATION, 33 | /** 34 | * Ran after rotation is applied to the location the particle will be displayed to.

35 | * Only ran if rotation is applied in this class. (ex. {@link ParticleCircle}) 36 | */ 37 | AFTER_ROTATION, 38 | /** 39 | * Ran after a particle is displayed at the current location. 40 | */ 41 | AFTER_DISPLAY_PARTICLE, 42 | /** 43 | * Ran after all particles are displayed on every call of the display() method. 44 | */ 45 | AFTER_DISPLAY, 46 | /** 47 | * Ran after all particles are displayed on every full display of the shape. 48 | */ 49 | AFTER_DISPLAY_FULL 50 | } 51 | } --------------------------------------------------------------------------------