Exterminate legacy item IDs

This commit is contained in:
Dylan K. Taylor
2022-07-05 15:12:55 +01:00
parent c5282b059b
commit 68cbe46600
19 changed files with 375 additions and 1180 deletions

View File

@@ -23,7 +23,8 @@ declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\data\bedrock\PotionTypeIdMap;
use pocketmine\data\runtime\RuntimeDataWriter;
use pocketmine\data\runtime\RuntimeEnumSerializer;
use pocketmine\entity\Location;
use pocketmine\entity\projectile\SplashPotion as SplashPotionEntity;
use pocketmine\entity\projectile\Throwable;
@@ -38,8 +39,8 @@ class SplashPotion extends ProjectileItem{
parent::__construct($identifier, $name);
}
public function getMeta() : int{
return PotionTypeIdMap::getInstance()->toId($this->potionType);
protected function encodeType(RuntimeDataWriter $w) : void{
RuntimeEnumSerializer::writePotionType($w, $this->potionType);
}
public function getType() : PotionType{ return $this->potionType; }