Item: allow describing type data to a reader as well as a writer

we don't currently need this, but it's better to have it in case we need it after PM5 release.

This is also now consistent with blocks.
This commit is contained in:
Dylan K. Taylor
2022-08-27 19:18:30 +01:00
parent 5c5d96d00b
commit d5762d3f44
8 changed files with 17 additions and 9 deletions

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\block\utils\DyeColor;
use pocketmine\data\runtime\RuntimeDataReader;
use pocketmine\data\runtime\RuntimeDataWriter;
class Dye extends Item{
@ -34,7 +35,7 @@ class Dye extends Item{
parent::__construct($identifier, $name);
}
protected function encodeType(RuntimeDataWriter $w) : void{
protected function describeType(RuntimeDataReader|RuntimeDataWriter $w) : void{
$w->dyeColor($this->color);
}