Skip to content

Commit 73053db

Browse files
committed
refactor(particles): Move geyser particle spawn position altering paragraph to an aside note
1 parent 68804b1 commit 73053db

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

src/content/docs/paper/dev/api/particles.mdx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -740,16 +740,13 @@ There are four geyser particles: `GEYSER_BASE`, `GEYSER_POOF`, `GEYSER_PLUME` an
740740

741741
The particle size is calculated as `3.0F + 0.125F * waterBlocks`.
742742

743-
The spawn position of these particles is slightly altered by adding a random offset to each coordinate. The x and z
744-
coordinates are altered by a random value in the range `[-0.25, 0.25]`, while the y coordinate is altered by a random
745-
value in the range `[-0.05, 0.45]`.
746-
747743
They are [directional particles](#directional-particles), but are also affected by the water blocks and burst impulse
748744
parameters. The initial velocity is calculated as follows:
749745
```java
750746
float burstImpulse = burstImpulseBase + 0.25F * waterBlocks;
751747

752748
// xd, yd and zd are the particle velocity's x, y and z components respectively
749+
// In this case they can have a non zero starting value
753750
// xAux, yAux and zAux are the provided velocity vector's x, y and z components respectively
754751
this.xd = this.xd * burstImpulse + xAux;
755752
this.yd = this.yd * burstImpulse + yAux;
@@ -762,6 +759,12 @@ this.yd = Math.abs(this.yd);
762759
Starting values of `xd` and `zd` are in the range `[-0.1, 0.1]`, while `yd` is in the range `[0.0, 0.2]`.
763760
:::
764761

762+
:::note
763+
The spawn position of these particles is slightly altered by adding a random offset to each coordinate. The x and z
764+
coordinates are altered by a random value in the range `[-0.25, 0.25]`, while the y coordinate is altered by a random
765+
value in the range `[-0.05, 0.45]`.
766+
:::
767+
765768
An example of spawning a geyser base particle at `someLocation` with a burst impulse of `1` and 1 water block:
766769
<Tabs syncKey="spawn-type">
767770
<TabItem label="ParticleBuilder">
@@ -787,15 +790,17 @@ An example of spawning a geyser base particle at `someLocation` with a burst imp
787790
### Plume
788791
The `GEYSER_PLUME` particle uses [`Particle.Geyser`](jd:paper:org.bukkit.Particle$Geyser) as its data.
789792

790-
The spawn position of these particles is slightly altered by adding a random offset to each coordinate. The x and z
791-
coordinates are altered by a random value in the range `[-0.1, 0.1]`, while the y coordinate is altered by a random
792-
value in the range `[0, 1]`.
793-
794793
While technically a [directional particle](#directional-particles), the vertical velocity of this particle is set to `0`
795794
and the horizontal velocity is applied only on the first tick.
796795

797796
The height of the plume is calculated as `5 * waterBlocks`.
798797

798+
:::note
799+
The spawn position of these particles is slightly altered by adding a random offset to each coordinate. The x and z
800+
coordinates are altered by a random value in the range `[-0.1, 0.1]`, while the y coordinate is altered by a random
801+
value in the range `[0, 1]`.
802+
:::
803+
799804
An example of spawning a geyser plume particle at `someLocation` with 1 water block:
800805
<Tabs syncKey="spawn-type">
801806
<TabItem label="ParticleBuilder">

0 commit comments

Comments
 (0)