Compare commits

...

21 Commits

Author SHA1 Message Date
755ca1af9b Release 4.3.2 2022-05-10 00:57:50 +01:00
7d78b9cb2c Bump build/php from f5d7b45 to 0b5760b (#5023)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `f5d7b45` to `0b5760b`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](f5d7b45990...0b5760bb3b)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-10 00:55:07 +01:00
91f802ac7a Bump phpstan/phpstan from 1.6.3 to 1.6.7 (#5015)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.6.3 to 1.6.7.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.7.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.6.3...1.6.7)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-05 11:49:27 +01:00
a6299b0927 pocketmine.yml: moar docs for command aliases hidden features 2022-05-01 16:16:32 +01:00
6e372d9e36 Entity: fixed setNameTagVisible not having immediately visible effect 2022-05-01 14:54:41 +01:00
ad8132ae11 Bump build/php from 7b357f8 to f5d7b45 (#5004)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `7b357f8` to `f5d7b45`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](7b357f8cf9...f5d7b45990)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-01 14:04:38 +01:00
cf15a0913d World: fixed a corner case assertion failure in generation system
This required the following:
- A generation task (taskA) to already be running for any chunk (chunkA)
- A chunk (chunkB) is requested for generation, and the task (taskB) to do the generation
  is commenced immediately
- chunkB generation promise is aborted (e.g. due to chunk unload) and
  taskB is orphaned
- chunkB is subsequently re-requested, but ends up in the generation
  queue because taskB is still running
- taskA completes and drains the generation queue
- chunkB attempts to be populated a second time, but taskB has not yet
  been collected, resulting in an assertion failure.

This bug has been appearing intermittently ever since PM 4.0 release.
For most users there is no obvious effect since production servers don't
have assertions enabled; however, it's unclear what kind of weird side
effects this bug may have had.
2022-04-28 20:23:23 +01:00
33cf085692 PHPStan 1.6.3 2022-04-28 16:06:20 +01:00
223893fd5c PlayerChangeSkinEvent: remove obsolete doc comment 2022-04-24 21:56:49 +01:00
a58551af5b 4.3.2 is next 2022-04-23 16:03:15 +01:00
f7dce4af88 Release 4.3.1 2022-04-23 16:03:14 +01:00
dff5c30172 Updated BedrockProtocol to 9.0.1 2022-04-23 16:01:08 +01:00
e8994dbc17 Bump build/php from 1fae6b8 to 7b357f8 (#4987)
Bumps [build/php](https://github.com/pmmp/php-build-scripts) from `1fae6b8` to `7b357f8`.
- [Release notes](https://github.com/pmmp/php-build-scripts/releases)
- [Commits](1fae6b8d4a...7b357f8cf9)

---
updated-dependencies:
- dependency-name: build/php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-23 14:20:47 +01:00
aaba8a2a9a Bump phpstan/phpstan from 1.5.6 to 1.5.7 (#4975)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.5.6 to 1.5.7.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.6.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.5.6...1.5.7)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-21 16:45:16 +01:00
27056b6c37 Player: creative players should not be damaged by the void (#4978) 2022-04-21 16:39:36 +01:00
9930de01b9 Bump phpstan/phpstan-phpunit from 1.1.0 to 1.1.1 (#4979)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.1.0...1.1.1)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-21 16:38:36 +01:00
cd021f49cd 4.3.1 is next 2022-04-20 14:15:12 +01:00
e4ce467c0b Release 4.3.0 2022-04-20 14:15:06 +01:00
6b4687a36b RuntimeBlockMapping: unseal constructor to facilitate easier testing of new versions 2022-04-20 14:00:20 +01:00
c085bf0db4 Changes for 1.18.30 2022-04-20 13:59:50 +01:00
e0d4bd985e 4.2.11 is next 2022-04-20 13:03:25 +01:00
15 changed files with 111 additions and 60 deletions

32
changelogs/4.3.md Normal file
View File

@ -0,0 +1,32 @@
**For Minecraft: Bedrock Edition 1.18.30**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.x.y version will also run on these releases and do not need API bumps.
Plugin developers should **only** update their required API to this version if you need the changes in this build.
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
# 4.3.0
Released 20th April 2022.
## General
- Added support for Minecraft: Bedrock Edition 1.18.30.
- Removed support for older versions.
# 4.3.1
Released 23rd April 2022.
## Fixes
- Updated BedrockProtocol dependency to fix incorrect command argument types.
- Creative players no longer die in the void.
# 4.3.2
Released 10th May 2022.
## Fixes
- Fixed an assertion failure in certain edge cases during world generation.
- Fixed `Entity::setNameTagVisible()` not immediately showing results to players already online.
## Documentation
- Added more documentation in the template `pocketmine.yml` for the `aliases` config section.
- Removed useless doc comment in `PlayerChangeSkinEvent`.

View File

@ -34,8 +34,8 @@
"adhocore/json-comment": "^1.1",
"fgrosse/phpasn1": "^2.3",
"netresearch/jsonmapper": "^4.0",
"pocketmine/bedrock-data": "~1.6.0+bedrock-1.18.10",
"pocketmine/bedrock-protocol": "~8.0.2+bedrock-1.18.10",
"pocketmine/bedrock-data": "~1.7.0+bedrock-1.18.30",
"pocketmine/bedrock-protocol": "~9.0.0+bedrock-1.18.30",
"pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2",
"pocketmine/classloader": "^0.2.0",
@ -53,9 +53,9 @@
"webmozart/path-util": "^2.3"
},
"require-dev": {
"phpstan/phpstan": "1.5.6",
"phpstan/phpstan": "1.6.7",
"phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.0.0",
"phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^9.2"
},
"autoload": {

75
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b20ae069f5f467084bcbaae90c893bc9",
"content-hash": "6a8998cdfb7158f5f7caf6d2202070ee",
"packages": [
{
"name": "adhocore/json-comment",
@ -249,42 +249,42 @@
},
{
"name": "pocketmine/bedrock-data",
"version": "1.6.0+bedrock-1.18.10",
"version": "1.7.0+bedrock-1.18.30",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockData.git",
"reference": "e98c511584a7bd58a95986374d2df4b04c6a2ba0"
"reference": "c8f323ff0cbdb36a5d95e7e4a23969f562445be0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/e98c511584a7bd58a95986374d2df4b04c6a2ba0",
"reference": "e98c511584a7bd58a95986374d2df4b04c6a2ba0",
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/c8f323ff0cbdb36a5d95e7e4a23969f562445be0",
"reference": "c8f323ff0cbdb36a5d95e7e4a23969f562445be0",
"shasum": ""
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
"CC0-1.0"
],
"description": "Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP",
"support": {
"issues": "https://github.com/pmmp/BedrockData/issues",
"source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.18.10"
"source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.18.30"
},
"time": "2022-02-08T19:13:47+00:00"
"time": "2022-04-20T12:40:59+00:00"
},
{
"name": "pocketmine/bedrock-protocol",
"version": "8.0.2+bedrock-1.18.10",
"version": "9.0.1+bedrock-1.18.30",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "d1f1afdbb4ea61ea52eb511a79ee1ca561da349c"
"reference": "9d3cc87c4d26c002dd42aa9af20c0cd47a72018e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/d1f1afdbb4ea61ea52eb511a79ee1ca561da349c",
"reference": "d1f1afdbb4ea61ea52eb511a79ee1ca561da349c",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/9d3cc87c4d26c002dd42aa9af20c0cd47a72018e",
"reference": "9d3cc87c4d26c002dd42aa9af20c0cd47a72018e",
"shasum": ""
},
"require": {
@ -298,7 +298,7 @@
"ramsey/uuid": "^4.1"
},
"require-dev": {
"phpstan/phpstan": "1.5.3",
"phpstan/phpstan": "1.5.7",
"phpstan/phpstan-phpunit": "^1.0.0",
"phpstan/phpstan-strict-rules": "^1.0.0",
"phpunit/phpunit": "^9.5"
@ -316,9 +316,9 @@
"description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP",
"support": {
"issues": "https://github.com/pmmp/BedrockProtocol/issues",
"source": "https://github.com/pmmp/BedrockProtocol/tree/8.0.2+bedrock-1.18.10"
"source": "https://github.com/pmmp/BedrockProtocol/tree/9.0.1+bedrock-1.18.30"
},
"time": "2022-04-01T21:55:10+00:00"
"time": "2022-04-23T14:48:16+00:00"
},
{
"name": "pocketmine/binaryutils",
@ -1819,16 +1819,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.5.6",
"version": "1.6.7",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "799dd8c2d2c9c704bb55d2078078cb970cf0f6d1"
"reference": "d41c39cb2e487663bce9bbd97c660e244b73abad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/799dd8c2d2c9c704bb55d2078078cb970cf0f6d1",
"reference": "799dd8c2d2c9c704bb55d2078078cb970cf0f6d1",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/d41c39cb2e487663bce9bbd97c660e244b73abad",
"reference": "d41c39cb2e487663bce9bbd97c660e244b73abad",
"shasum": ""
},
"require": {
@ -1854,7 +1854,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.5.6"
"source": "https://github.com/phpstan/phpstan/tree/1.6.7"
},
"funding": [
{
@ -1874,20 +1874,20 @@
"type": "tidelift"
}
],
"time": "2022-04-15T11:13:37+00:00"
"time": "2022-05-04T22:55:41+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
"version": "1.1.0",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-phpunit.git",
"reference": "09133ce914f1388a8bb8c7f8573aaa3723cff52a"
"reference": "4a3c437c09075736285d1cabb5c75bf27ed0bc84"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/09133ce914f1388a8bb8c7f8573aaa3723cff52a",
"reference": "09133ce914f1388a8bb8c7f8573aaa3723cff52a",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/4a3c437c09075736285d1cabb5c75bf27ed0bc84",
"reference": "4a3c437c09075736285d1cabb5c75bf27ed0bc84",
"shasum": ""
},
"require": {
@ -1924,27 +1924,27 @@
"description": "PHPUnit extensions and rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-phpunit/issues",
"source": "https://github.com/phpstan/phpstan-phpunit/tree/1.1.0"
"source": "https://github.com/phpstan/phpstan-phpunit/tree/1.1.1"
},
"time": "2022-03-28T09:20:49+00:00"
"time": "2022-04-20T15:24:25+00:00"
},
{
"name": "phpstan/phpstan-strict-rules",
"version": "1.1.0",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-strict-rules.git",
"reference": "e12d55f74a8cca18c6e684c6450767e055ba7717"
"reference": "f3ca6464eae640a556c69a02b3b77a2507475d2f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/e12d55f74a8cca18c6e684c6450767e055ba7717",
"reference": "e12d55f74a8cca18c6e684c6450767e055ba7717",
"url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/f3ca6464eae640a556c69a02b3b77a2507475d2f",
"reference": "f3ca6464eae640a556c69a02b3b77a2507475d2f",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0",
"phpstan/phpstan": "^1.2.0"
"php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.6.3"
},
"require-dev": {
"nikic/php-parser": "^4.13.0",
@ -1954,9 +1954,6 @@
},
"type": "phpstan-extension",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
},
"phpstan": {
"includes": [
"rules.neon"
@ -1975,9 +1972,9 @@
"description": "Extra strict and opinionated rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-strict-rules/issues",
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.1.0"
"source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.2.1"
},
"time": "2021-11-18T09:30:29+00:00"
"time": "2022-04-28T07:20:18+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -3452,5 +3449,5 @@
"platform-overrides": {
"php": "8.0.0"
},
"plugin-api-version": "2.2.0"
"plugin-api-version": "2.3.0"
}

View File

@ -195,6 +195,12 @@ aliases:
#kill: [suicide, say "I tried to kill $1"] ## `kill alex` -> `suicide` + `say "I tried to kill alex"`
#giverandom: [give $1 $2, say "Someone has just received a $2!"] ## `giverandom alex diamond` -> `give alex diamond` + `say "Someone has just received a diamond!"`
##To make arguments mandatory (so that the command fails if they are not provided), use $$, e.g. $$1, $$2:
#makeadmin: [op $$1] ## `makeadmin alex` -> `op alex`, `makeadmin` with no arguments = error
##To pass through a range of arguments, put a - (hyphen) after the index:
#tpalias: [tp $1-] ## `tpalias 256 70 256` -> `tp 256 70 256` - this passes arguments 1 and everything after it to the `tp` command
##To change an existing command alias and make it do something else:
#tp: [suicide]

View File

@ -31,7 +31,7 @@ use function str_repeat;
final class VersionInfo{
public const NAME = "PocketMine-MP";
public const BASE_VERSION = "4.2.10";
public const BASE_VERSION = "4.3.2";
public const IS_DEVELOPMENT_BUILD = false;
public const BUILD_CHANNEL = "stable";

View File

@ -282,6 +282,7 @@ abstract class Entity{
public function setNameTagVisible(bool $value = true) : void{
$this->nameTagVisible = $value;
$this->networkPropertiesDirty = true;
}
public function setNameTagAlwaysVisible(bool $value = true) : void{

View File

@ -55,6 +55,7 @@ use pocketmine\network\mcpe\protocol\types\DeviceOS;
use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
use pocketmine\network\mcpe\protocol\types\entity\StringMetadataProperty;
use pocketmine\network\mcpe\protocol\types\GameMode;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper;
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
use pocketmine\player\Player;
@ -473,6 +474,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
$this->location->yaw,
$this->location->yaw, //TODO: head yaw
ItemStackWrapper::legacy(TypeConverter::getInstance()->coreItemStackToNet($this->getInventory()->getItemInHand())),
GameMode::SURVIVAL,
$this->getAllNetworkData(),
AdventureSettingsPacket::create(0, 0, 0, 0, 0, $this->getId()), //TODO
[], //TODO: entity links

View File

@ -53,9 +53,6 @@ class PlayerChangeSkinEvent extends PlayerEvent implements Cancellable{
return $this->newSkin;
}
/**
* @throws \InvalidArgumentException if the specified skin is not valid
*/
public function setNewSkin(Skin $skin) : void{
$this->newSkin = $skin;
}

View File

@ -48,9 +48,16 @@ final class RuntimeBlockMapping{
/** @var CompoundTag[] */
private $bedrockKnownStates;
private function __construct(){
private static function make() : self{
return new self(
Path::join(\pocketmine\BEDROCK_DATA_PATH, "canonical_block_states.nbt"),
Path::join(\pocketmine\BEDROCK_DATA_PATH, "r12_to_current_block_map.bin")
);
}
public function __construct(string $canonicalBlockStatesFile, string $r12ToCurrentBlockMapFile){
$stream = PacketSerializer::decoder(
Utils::assumeNotFalse(file_get_contents(Path::join(\pocketmine\BEDROCK_DATA_PATH, "canonical_block_states.nbt")), "Missing required resource file"),
Utils::assumeNotFalse(file_get_contents($canonicalBlockStatesFile), "Missing required resource file"),
0,
new PacketSerializerContext(GlobalItemTypeDictionary::getInstance()->getDictionary())
);
@ -60,15 +67,15 @@ final class RuntimeBlockMapping{
}
$this->bedrockKnownStates = $list;
$this->setupLegacyMappings();
$this->setupLegacyMappings($r12ToCurrentBlockMapFile);
}
private function setupLegacyMappings() : void{
private function setupLegacyMappings(string $r12ToCurrentBlockMapFile) : void{
$legacyIdMap = LegacyBlockIdToStringIdMap::getInstance();
/** @var R12ToCurrentBlockMapEntry[] $legacyStateMap */
$legacyStateMap = [];
$legacyStateMapReader = PacketSerializer::decoder(
Utils::assumeNotFalse(file_get_contents(Path::join(\pocketmine\BEDROCK_DATA_PATH, "r12_to_current_block_map.bin")), "Missing required resource file"),
Utils::assumeNotFalse(file_get_contents($r12ToCurrentBlockMapFile), "Missing required resource file"),
0,
new PacketSerializerContext(GlobalItemTypeDictionary::getInstance()->getDictionary())
);

View File

@ -78,7 +78,7 @@ final class ChunkSerializer{
//TODO: right now we don't support 3D natively, so we just 3Dify our 2D biomes so they fill the column
$encodedBiomePalette = self::serializeBiomesAsPalette($chunk);
$stream->put(str_repeat($encodedBiomePalette, 25));
$stream->put(str_repeat($encodedBiomePalette, 24));
$stream->putByte(0); //border block array count
//Border block entry format: 1 byte (4 bits X, 4 bits Z). These are however useless since they crash the regular client.

View File

@ -174,7 +174,7 @@ class UPnP{
'/upnp:controlURL'
), "xpath query is borked");
if(count($xpathResult) === 0){
if($xpathResult === null || count($xpathResult) === 0){
throw new UPnPException("Your router does not support portforwarding");
}
$controlURL = (string) $xpathResult[0];

View File

@ -2315,7 +2315,6 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
if($this->isCreative()
&& $source->getCause() !== EntityDamageEvent::CAUSE_SUICIDE
&& $source->getCause() !== EntityDamageEvent::CAUSE_VOID
){
$source->cancel();
}elseif($this->allowFlight && $source->getCause() === EntityDamageEvent::CAUSE_FALL){

View File

@ -2653,8 +2653,13 @@ class World implements ChunkManager{
unset($this->changedBlocks[$chunkHash]);
if(array_key_exists($chunkHash, $this->chunkPopulationRequestMap)){
$this->logger->debug("Rejecting population promise for chunk $x $z");
$this->chunkPopulationRequestMap[$chunkHash]->reject();
unset($this->chunkPopulationRequestMap[$chunkHash]);
if(isset($this->activeChunkPopulationTasks[$chunkHash])){
$this->logger->debug("Marking population task for chunk $x $z as orphaned");
$this->activeChunkPopulationTasks[$chunkHash] = false;
}
}
$this->timings->doChunkUnload->stopTiming();
@ -2830,7 +2835,7 @@ class World implements ChunkManager{
unset($this->chunkPopulationRequestQueueIndex[$nextChunkHash]);
World::getXZ($nextChunkHash, $nextChunkX, $nextChunkZ);
if(isset($this->chunkPopulationRequestMap[$nextChunkHash])){
assert(!isset($this->activeChunkPopulationTasks[$nextChunkHash]), "Population for chunk $nextChunkX $nextChunkZ already running");
assert(!($this->activeChunkPopulationTasks[$nextChunkHash] ?? false), "Population for chunk $nextChunkX $nextChunkZ already running");
if(
!$this->orderChunkPopulation($nextChunkX, $nextChunkZ, null)->isResolved() &&
!isset($this->activeChunkPopulationTasks[$nextChunkHash])
@ -2999,10 +3004,13 @@ class World implements ChunkManager{
}
$index = World::chunkHash($x, $z);
if(!isset($this->chunkPopulationRequestMap[$index])){
$this->logger->debug("Discarding population result for chunk x=$x,z=$z - promise was already broken");
if(!isset($this->activeChunkPopulationTasks[$index])){
throw new AssumptionFailedError("This should always be set, regardless of whether the task was orphaned or not");
}
if(!$this->activeChunkPopulationTasks[$index]){
$this->logger->debug("Discarding orphaned population result for chunk x=$x,z=$z");
unset($this->activeChunkPopulationTasks[$index]);
}elseif(isset($this->activeChunkPopulationTasks[$index])){
}else{
if($dirtyChunks === 0){
$oldChunk = $this->loadChunk($x, $z);
$this->setChunk($x, $z, $chunk);

View File

@ -36,6 +36,7 @@ use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataFlags;
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
use pocketmine\network\mcpe\protocol\types\entity\FloatMetadataProperty;
use pocketmine\network\mcpe\protocol\types\entity\LongMetadataProperty;
use pocketmine\network\mcpe\protocol\types\GameMode;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStack;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper;
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
@ -117,6 +118,7 @@ class FloatingTextParticle implements Particle{
0,
0,
ItemStackWrapper::legacy(ItemStack::null()),
GameMode::SURVIVAL,
$actorMetadata,
AdventureSettingsPacket::create(0, 0, 0, 0, 0, $this->entityId),
[],