File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11worlds :
2- - world
2+ - world
3+
4+ particlesAmount : 5000
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ class SnowPlugin extends PluginBase implements Listener
2323 */
2424 private array $ worlds ;
2525
26+ private int $ particlesAmount ;
27+
2628 protected function onEnable (): void
2729 {
2830 $ this ->saveDefaultConfig ();
@@ -31,6 +33,10 @@ protected function onEnable(): void
3133 $ worlds = (array ) $ this ->getConfig ()->get ('worlds ' , []);
3234 $ this ->worlds = $ worlds ;
3335
36+ /** @var int $particlesAmount */
37+ $ particlesAmount = $ this ->getConfig ()->get ('particlesAmount ' , 5000 );
38+ $ this ->particlesAmount = $ particlesAmount ;
39+
3440 $ this ->getServer ()->getPluginManager ()->registerEvents ($ this , $ this );
3541
3642 $ this ->getLogger ()->info (TextFormat::GREEN . 'Snow plugin has been enabled! ' );
@@ -93,7 +99,7 @@ private function handleSetRaining(Player $player): void
9399 if (!in_array ($ player ->getWorld ()->getFolderName (), $ this ->worlds )) {
94100 $ player ->getNetworkSession ()->sendDataPacket (LevelEventPacket::create (
95101 LevelEvent::STOP_RAIN ,
96- 6000000 ,
102+ 0 ,
97103 $ player ->getPosition ()
98104 ));
99105
@@ -102,7 +108,7 @@ private function handleSetRaining(Player $player): void
102108
103109 $ player ->getNetworkSession ()->sendDataPacket (LevelEventPacket::create (
104110 LevelEvent::START_RAIN ,
105- 6000000 ,
111+ $ this -> particlesAmount ,
106112 $ player ->getPosition ()
107113 ));
108114 }), 10 );
You can’t perform that action at this time.
0 commit comments