diff --git a/changelogs/4.0.md b/changelogs/4.0.md index b7b66c4a4..08bc18f43 100644 --- a/changelogs/4.0.md +++ b/changelogs/4.0.md @@ -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: diff --git a/src/item/Item.php b/src/item/Item.php index a1b2a6eab..b490ac6b1 100644 --- a/src/item/Item.php +++ b/src/item/Item.php @@ -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){