@@ -1612,20 +1612,33 @@ public String docs() {
1612
1612
+ " array defining the characteristics of the particle to be spawned. The array requires the"
1613
1613
+ " particle name under the key \" particle\" . ----"
1614
1614
+ " Possible particle types: " + StringUtils .Join (MCParticle .types (), ", " , ", or " , " or " ) + "."
1615
- + " <br><br>Some particles have more specific keys and/or special behavior, but the common keys for"
1616
- + " the particle array are \" count\" (usually the number of particles to be spawned), \" speed\" "
1617
- + " (usually the velocity of the particle), \" xoffset\" , \" yoffset\" , and \" zoffset\" "
1618
- + " (usually the ranges from center within which the particle may be offset on that axis)."
1619
- + " <br><br>BLOCK_DUST, BLOCK_CRACK, BLOCK_CRUMBLE, BLOCK_MARKER, DUST_PILLAR, and FALLING_DUST"
1615
+ + "<br>"
1616
+ + "<br>Some particles have more specific keys and/or special behavior, but the common keys for"
1617
+ + " the particle array are:"
1618
+ + "<br>"
1619
+ + "<br>'''count''' : (int) Usually the number of particles to be spawned. A value of 0 (default)"
1620
+ + " can create different particle data behavior than larger numbers."
1621
+ + "<br>'''speed''' : (double) Usually the velocity of the particle. Can be other things (size for"
1622
+ + " EXPLOSION_LARGE) depending on other values, like the particle type and count."
1623
+ + "<br>'''xoffset''' : (double) Usually the random offset width on the x-axis. An offset can also"
1624
+ + " be other things (velocity vector's x component for SMOKE_NORMAL) depending on other values,"
1625
+ + " like the particle type and count."
1626
+ + "<br>'''yoffset''' : (double) Usually the random offset width on the y-axis."
1627
+ + "<br>'''zoffset''' : (double) Usually the random offset width on the z-axis."
1628
+ + "<br>'''force''' : (boolean) Extends visibility range from 32 to 512 meters and encourages"
1629
+ + " clients to render it despite client settings."
1630
+ + "<br>"
1631
+ + "<br>BLOCK_DUST, BLOCK_CRACK, BLOCK_CRUMBLE, BLOCK_MARKER, DUST_PILLAR, and FALLING_DUST"
1620
1632
+ " particles can take a block type name parameter under the key \" block\" (default: STONE)."
1621
- + " <br>ITEM_CRACK particles can take an item array or name under the key \" item\" (default: STONE)."
1622
- + " <br>REDSTONE and SPELL_MOB particles take an RGB color array (each 0 - 255) or name under the key \" color\" "
1623
- + " (defaults to RED for REDSTONE, WHITE for SPELL_MOB)."
1624
- + " <br>DUST_COLOR_TRANSITION particles take a \" tocolor\" in addition \" color\" ."
1625
- + " <br>VIBRATION particles take a \" destination\" location array or entity UUID."
1626
- + " <br>SCULK_CHARGE particles take an \" angle\" in radians. (defaults to 0.0)"
1627
- + " <br>SHRIEK particles take an integer \" delay\" in ticks before playing. (defaults to 0)"
1628
- + " <br>TRAIL particles take a \" target\" location array, a \" color\" , and a \" duration\" integer in ticks." ;
1633
+ + "<br>ITEM_CRACK particles can take an item array or name under the key \" item\" (default: STONE)."
1634
+ + "<br>REDSTONE and SPELL_MOB particles take an RGB color array (each 0 - 255) or name under the key"
1635
+ + " \" color\" (defaults to RED for REDSTONE, WHITE for SPELL_MOB)."
1636
+ + "<br>DUST_COLOR_TRANSITION particles take a \" tocolor\" in addition \" color\" ."
1637
+ + "<br>VIBRATION particles take a \" destination\" location array or entity UUID."
1638
+ + "<br>SCULK_CHARGE particles take an \" angle\" in radians. (defaults to 0.0)"
1639
+ + "<br>SHRIEK particles take an integer \" delay\" in ticks before playing. (defaults to 0)"
1640
+ + "<br>TRAIL particles take a \" target\" location array, a \" color\" as an RGB array or name, and a"
1641
+ + " \" duration\" integer in ticks." ;
1629
1642
}
1630
1643
1631
1644
@ Override
@@ -1653,6 +1666,7 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment enviro
1653
1666
double offsetY = 0.0 ;
1654
1667
double offsetZ = 0.0 ;
1655
1668
double speed = 0.0 ;
1669
+ boolean force = false ;
1656
1670
Object data = null ;
1657
1671
1658
1672
if (args [1 ].isInstanceOf (CArray .TYPE )) {
@@ -1679,6 +1693,9 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment enviro
1679
1693
if (pa .containsKey ("speed" )) {
1680
1694
speed = ArgumentValidation .getDouble (pa .get ("speed" , t ), t );
1681
1695
}
1696
+ if (pa .containsKey ("force" )) {
1697
+ force = ArgumentValidation .getBooleanObject (pa .get ("force" , t ), t );
1698
+ }
1682
1699
1683
1700
data = ObjectGenerator .GetGenerator ().particleData (p , l , pa , t );
1684
1701
@@ -1699,14 +1716,14 @@ public Mixed exec(Target t, com.laytonsmith.core.environments.Environment enviro
1699
1716
}
1700
1717
for (Mixed playerName : players .asList ()) {
1701
1718
player = Static .GetPlayer (playerName , t );
1702
- player .spawnParticle (l , p , count , offsetX , offsetY , offsetZ , speed , data );
1719
+ player .spawnParticle (l , p , count , offsetX , offsetY , offsetZ , speed , force , data );
1703
1720
}
1704
1721
} else {
1705
1722
player = Static .GetPlayer (args [2 ], t );
1706
- player .spawnParticle (l , p , count , offsetX , offsetY , offsetZ , speed , data );
1723
+ player .spawnParticle (l , p , count , offsetX , offsetY , offsetZ , speed , force , data );
1707
1724
}
1708
1725
} else {
1709
- l .getWorld ().spawnParticle (l , p , count , offsetX , offsetY , offsetZ , speed , data );
1726
+ l .getWorld ().spawnParticle (l , p , count , offsetX , offsetY , offsetZ , speed , force , data );
1710
1727
}
1711
1728
} catch (IllegalArgumentException ex ) {
1712
1729
throw new CREIllegalArgumentException ("Given unsupported data for particle type " + p .name (), t );
0 commit comments