mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 20:35:15 +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;
|
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{
|
class ChunkLoadEvent extends ChunkEvent{
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
@ -38,6 +38,10 @@ class ChunkLoadEvent extends ChunkEvent{
|
|||||||
$this->newChunk = $newChunk;
|
$this->newChunk = $newChunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the chunk is newly generated.
|
||||||
|
* If false, the chunk was loaded from storage.
|
||||||
|
*/
|
||||||
public function isNewChunk() : bool{
|
public function isNewChunk() : bool{
|
||||||
return $this->newChunk;
|
return $this->newChunk;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,8 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\event\world;
|
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{
|
class ChunkPopulateEvent extends ChunkEvent{
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ use pocketmine\event\Cancellable;
|
|||||||
use pocketmine\event\CancellableTrait;
|
use pocketmine\event\CancellableTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a Chunk is unloaded
|
* Called when a Chunk is unloaded from memory.
|
||||||
*/
|
*/
|
||||||
class ChunkUnloadEvent extends ChunkEvent implements Cancellable{
|
class ChunkUnloadEvent extends ChunkEvent implements Cancellable{
|
||||||
use CancellableTrait;
|
use CancellableTrait;
|
||||||
|
@ -24,7 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\event\world;
|
namespace pocketmine\event\world;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a World is initializing
|
* Called when a new world is created/generated.
|
||||||
*/
|
*/
|
||||||
class WorldInitEvent extends WorldEvent{
|
class WorldInitEvent extends WorldEvent{
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\event\world;
|
namespace pocketmine\event\world;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a World is loaded
|
* Called when a world is loaded or newly created/generated.
|
||||||
*/
|
*/
|
||||||
class WorldLoadEvent extends WorldEvent{
|
class WorldLoadEvent extends WorldEvent{
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\event\world;
|
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{
|
class WorldSaveEvent extends WorldEvent{
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ use pocketmine\event\Cancellable;
|
|||||||
use pocketmine\event\CancellableTrait;
|
use pocketmine\event\CancellableTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a World is unloaded
|
* Called when a world is unloaded from memory.
|
||||||
*/
|
*/
|
||||||
class WorldUnloadEvent extends WorldEvent implements Cancellable{
|
class WorldUnloadEvent extends WorldEvent implements Cancellable{
|
||||||
use CancellableTrait;
|
use CancellableTrait;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user