mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-17 04:06:54 +00:00
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:
@@ -32,6 +32,7 @@ use pocketmine\block\BlockToolType;
|
||||
use pocketmine\block\VanillaBlocks;
|
||||
use pocketmine\data\bedrock\EnchantmentIdMap;
|
||||
use pocketmine\data\bedrock\item\ItemTypeDeserializeException;
|
||||
use pocketmine\data\runtime\RuntimeDataReader;
|
||||
use pocketmine\data\runtime\RuntimeDataWriter;
|
||||
use pocketmine\data\SavedDataLoadingException;
|
||||
use pocketmine\entity\Entity;
|
||||
@@ -435,11 +436,11 @@ class Item implements \JsonSerializable{
|
||||
|
||||
final public function computeTypeData() : int{
|
||||
$writer = new RuntimeDataWriter(16); //TODO: max bits should be a constant instead of being hardcoded all over the place
|
||||
$this->encodeType($writer);
|
||||
$this->describeType($writer);
|
||||
return $writer->getValue();
|
||||
}
|
||||
|
||||
protected function encodeType(RuntimeDataWriter $w) : void{
|
||||
protected function describeType(RuntimeDataReader|RuntimeDataWriter $w) : void{
|
||||
//NOOP
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user