mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Merge branch 'next-minor' into next-major
This commit is contained in:
commit
613ce251c5
@ -65,3 +65,28 @@ Released 7th November 2022.
|
|||||||
- Console reader subprocess should now automatically die if the server main process is killed, instead of persisting as a zombie.
|
- Console reader subprocess should now automatically die if the server main process is killed, instead of persisting as a zombie.
|
||||||
- `ConsoleCommandSender` is no longer responsible for relaying broadcast messages to `MainLogger`. A new `BroadcastLoggerForwarder` has been added, which is subscribed to the appropriate server broadcast channels in order to relay messages. This ensures that chat messages and command audit messages are logged.
|
- `ConsoleCommandSender` is no longer responsible for relaying broadcast messages to `MainLogger`. A new `BroadcastLoggerForwarder` has been added, which is subscribed to the appropriate server broadcast channels in order to relay messages. This ensures that chat messages and command audit messages are logged.
|
||||||
- `DelegateInventory` now uses `WeakReference` to track its inventory listener. This allows the delegate to be reused.
|
- `DelegateInventory` now uses `WeakReference` to track its inventory listener. This allows the delegate to be reused.
|
||||||
|
|
||||||
|
# 4.11.0-BETA2
|
||||||
|
Released 13th November 2022.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
- The `chunk-ticking.per-tick` setting is now deprecated, and will be removed in a future release.
|
||||||
|
- The functionality of this setting has been removed, since it caused more problems than it solved.
|
||||||
|
- Setting it to zero will still disable chunk ticking (for now), but this should now be done by setting `chunk-ticking.tick-radius` to `0` instead.
|
||||||
|
|
||||||
|
## Gameplay
|
||||||
|
- Improved chunk random ticking:
|
||||||
|
- Removed the limit on chunks ticked per tick, and its associated config option is no longer respected.
|
||||||
|
- This change significantly improves crop and plant growth with large numbers of players, but may cause higher CPU usage.
|
||||||
|
- This limit was causing a linear decrease in chunk ticking speed with larger numbers of players, leading to worsened gameplay experience.
|
||||||
|
- Every chunk within the configured tick radius of a player will be ticked. Previously, chunks were randomly selected from the radius.
|
||||||
|
- Implemented Darkness effect.
|
||||||
|
|
||||||
|
## API
|
||||||
|
### `pocketmine\world`
|
||||||
|
- The following new API methods have been added:
|
||||||
|
- `public World->getChunkTickRadius() : int` - returns the world's simulation radius
|
||||||
|
- `public World->setChunkTickRadius(int $radius) : void` - sets the world's simulation radius
|
||||||
|
|
||||||
|
## Internals
|
||||||
|
- Non-arrow projectile damage is now unscaled. Scaling according to velocity is only applied to arrows. This currently doesn't cause any observable change in behaviour, but is required for future additions.
|
||||||
|
@ -1127,6 +1127,21 @@ class World implements ChunkManager{
|
|||||||
unset($this->randomTickBlocks[$block->getStateId()]);
|
unset($this->randomTickBlocks[$block->getStateId()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the radius of chunks to be ticked around each ticking chunk loader (usually players). This is referred to
|
||||||
|
* as "simulation distance" in the Minecraft: Bedrock world options screen.
|
||||||
|
*/
|
||||||
|
public function getChunkTickRadius() : int{
|
||||||
|
return $this->chunkTickRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the radius of chunks ticked around each ticking chunk loader (usually players).
|
||||||
|
*/
|
||||||
|
public function setChunkTickRadius(int $radius) : void{
|
||||||
|
$this->chunkTickRadius = $radius;
|
||||||
|
}
|
||||||
|
|
||||||
private function tickChunks() : void{
|
private function tickChunks() : void{
|
||||||
if($this->chunkTickRadius <= 0 || count($this->tickingLoaders) === 0){
|
if($this->chunkTickRadius <= 0 || count($this->tickingLoaders) === 0){
|
||||||
return;
|
return;
|
||||||
@ -1137,12 +1152,23 @@ class World implements ChunkManager{
|
|||||||
/** @var bool[] $chunkTickList chunkhash => dummy */
|
/** @var bool[] $chunkTickList chunkhash => dummy */
|
||||||
$chunkTickList = [];
|
$chunkTickList = [];
|
||||||
|
|
||||||
|
$centerChunks = [];
|
||||||
|
|
||||||
$selector = new ChunkSelector();
|
$selector = new ChunkSelector();
|
||||||
foreach($this->tickingLoaders as $loader){
|
foreach($this->tickingLoaders as $loader){
|
||||||
|
$centerChunkX = (int) floor($loader->getX()) >> Chunk::COORD_BIT_SIZE;
|
||||||
|
$centerChunkZ = (int) floor($loader->getZ()) >> Chunk::COORD_BIT_SIZE;
|
||||||
|
$centerChunkPosHash = World::chunkHash($centerChunkX, $centerChunkZ);
|
||||||
|
if(isset($centerChunks[$centerChunkPosHash])){
|
||||||
|
//we already queued chunks in this radius because of a previous loader on the same chunk
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$centerChunks[$centerChunkPosHash] = true;
|
||||||
|
|
||||||
foreach($selector->selectChunks(
|
foreach($selector->selectChunks(
|
||||||
$this->chunkTickRadius,
|
$this->chunkTickRadius,
|
||||||
(int) floor($loader->getX()) >> Chunk::COORD_BIT_SIZE,
|
$centerChunkX,
|
||||||
(int) floor($loader->getZ()) >> Chunk::COORD_BIT_SIZE
|
$centerChunkZ
|
||||||
) as $hash){
|
) as $hash){
|
||||||
World::getXZ($hash, $chunkX, $chunkZ);
|
World::getXZ($hash, $chunkX, $chunkZ);
|
||||||
if(!isset($chunkTickList[$hash]) && isset($this->chunks[$hash]) && $this->isChunkTickable($chunkX, $chunkZ)){
|
if(!isset($chunkTickList[$hash]) && isset($this->chunks[$hash]) && $this->isChunkTickable($chunkX, $chunkZ)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user