Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable

This commit is contained in:
Dylan K. Taylor 2022-02-19 19:26:39 +00:00
commit 54db842d16
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 7 additions and 2 deletions

View File

@ -413,6 +413,7 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml`
### Command
- The following classes have been removed:
- `PluginIdentifiableCommand` - use `PluginOwned` and `PluginOwnedTrait`
- `RemoteConsoleCommandSender`
- The following API methods have signature changes:
- `Command->setPermission()` argument is now mandatory (but still nullable).
@ -1054,6 +1055,7 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml`
- `Player->addWindow()`: use `Player->setCurrentWindow()` instead
- `Player->dataPacket()`: replaced by `NetworkSession->sendDataPacket()`
- `Player->getAddress()`: replaced by `NetworkSession->getIp()`
- `Player->getClientId()`: the client ID can be found in `PlayerInfo->getExtraData()`
- `Player->getPing()`: moved to `NetworkSession`
- `Player->getPort()`: moved to `NetworkSession`
- `Player->getWindow()`: use `Player->getCurrentWindow()` instead
@ -1069,6 +1071,8 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml`
- API version checks are now more strict. It is no longer legal to declare multiple minimum versions on the same major version. Doing so will now cause the plugin to fail to load with the message `Multiple minimum API versions found for some major versions`.
- `plugin.yml` YAML commands loading is now internalized inside `PluginBase`.
- `PluginManager->registerEvent()` now has a simpler signature: `registerEvent(string $event, \Closure $handler, int $priority, Plugin $plugin, bool $handleCancelled = false)`. The provided closure must accept the specified event class as its only parameter. See [Event API changes](#event) for more details.
- The following classes have been added:
- `PluginOwned`
- The following classes have been removed:
- `PluginLogger`
- The following constants have been removed:

View File

@ -659,8 +659,9 @@ class Item implements \JsonSerializable{
->setByte("Count", Binary::signByte($this->count))
->setShort("Damage", $this->getMeta());
if($this->hasNamedTag()){
$result->setTag("tag", $this->getNamedTag());
$tag = $this->getNamedTag();
if($tag->count() > 0){
$result->setTag("tag", $tag);
}
if($slot !== -1){