mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Improve documentation of world-related events
This commit is contained in:
parent
1154c7c1ab
commit
351cd4bfd7
@ -27,7 +27,7 @@ use pocketmine\world\format\Chunk;
|
||||
use pocketmine\world\World;
|
||||
|
||||
/**
|
||||
* Called when a Chunk is loaded
|
||||
* Called when a Chunk is loaded or newly created by the world generator.
|
||||
*/
|
||||
class ChunkLoadEvent extends ChunkEvent{
|
||||
/** @var bool */
|
||||
@ -38,6 +38,10 @@ class ChunkLoadEvent extends ChunkEvent{
|
||||
$this->newChunk = $newChunk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the chunk is newly generated.
|
||||
* If false, the chunk was loaded from storage.
|
||||
*/
|
||||
public function isNewChunk() : bool{
|
||||
return $this->newChunk;
|
||||
}
|
||||
|
@ -24,7 +24,8 @@ declare(strict_types=1);
|
||||
namespace pocketmine\event\world;
|
||||
|
||||
/**
|
||||
* Called when a Chunk is populated (after receiving it on the main thread)
|
||||
* Called when a Chunk is fully populated by the world generator.
|
||||
* This means that the terrain has been generated, and all artifacts (e.g. trees, grass, ponds, etc.) have been placed.
|
||||
*/
|
||||
class ChunkPopulateEvent extends ChunkEvent{
|
||||
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
|
||||
/**
|
||||
* Called when a Chunk is unloaded
|
||||
* Called when a Chunk is unloaded from memory.
|
||||
*/
|
||||
class ChunkUnloadEvent extends ChunkEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\event\world;
|
||||
|
||||
/**
|
||||
* Called when a World is initializing
|
||||
* Called when a new world is created/generated.
|
||||
*/
|
||||
class WorldInitEvent extends WorldEvent{
|
||||
|
||||
|
@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\event\world;
|
||||
|
||||
/**
|
||||
* Called when a World is loaded
|
||||
* Called when a world is loaded or newly created/generated.
|
||||
*/
|
||||
class WorldLoadEvent extends WorldEvent{
|
||||
|
||||
|
@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\event\world;
|
||||
|
||||
/**
|
||||
* Called when a World is saved
|
||||
* Called when a world is saved. Saving may be triggered manually (e.g. via commands) or automatically (autosave).
|
||||
*/
|
||||
class WorldSaveEvent extends WorldEvent{
|
||||
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
|
||||
/**
|
||||
* Called when a World is unloaded
|
||||
* Called when a world is unloaded from memory.
|
||||
*/
|
||||
class WorldUnloadEvent extends WorldEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
Loading…
x
Reference in New Issue
Block a user