diff --git a/src/data/bedrock/PotionTypeIdMap.php b/src/data/bedrock/PotionTypeIdMap.php index d665b0222..4fcb9b693 100644 --- a/src/data/bedrock/PotionTypeIdMap.php +++ b/src/data/bedrock/PotionTypeIdMap.php @@ -79,6 +79,11 @@ final class PotionTypeIdMap{ $this->register(PotionTypeIds::WEAKNESS, PotionType::WEAKNESS()); $this->register(PotionTypeIds::LONG_WEAKNESS, PotionType::LONG_WEAKNESS()); $this->register(PotionTypeIds::WITHER, PotionType::WITHER()); + $this->register(PotionTypeIds::TURTLE_MASTER, PotionType::TURTLE_MASTER()); + $this->register(PotionTypeIds::LONG_TURTLE_MASTER, PotionType::LONG_TURTLE_MASTER()); + $this->register(PotionTypeIds::STRONG_TURTLE_MASTER, PotionType::STRONG_TURTLE_MASTER()); + $this->register(PotionTypeIds::SLOW_FALLING, PotionType::SLOW_FALLING()); + $this->register(PotionTypeIds::LONG_SLOW_FALLING, PotionType::LONG_SLOW_FALLING()); } private function register(int $id, PotionType $type) : void{ diff --git a/src/data/bedrock/PotionTypeIds.php b/src/data/bedrock/PotionTypeIds.php index 41167c2d6..ebe51de54 100644 --- a/src/data/bedrock/PotionTypeIds.php +++ b/src/data/bedrock/PotionTypeIds.php @@ -61,4 +61,9 @@ final class PotionTypeIds{ public const WEAKNESS = 34; public const LONG_WEAKNESS = 35; public const WITHER = 36; + public const TURTLE_MASTER = 37; + public const LONG_TURTLE_MASTER = 38; + public const STRONG_TURTLE_MASTER = 39; + public const SLOW_FALLING = 40; + public const LONG_SLOW_FALLING = 41; } diff --git a/src/entity/EntityFactory.php b/src/entity/EntityFactory.php index 47e19b9d3..1967b3821 100644 --- a/src/entity/EntityFactory.php +++ b/src/entity/EntityFactory.php @@ -152,7 +152,7 @@ final class EntityFactory{ $this->register(SplashPotion::class, function(World $world, CompoundTag $nbt) : SplashPotion{ $potionType = PotionTypeIdMap::getInstance()->fromId($nbt->getShort("PotionId", PotionTypeIds::WATER)); if($potionType === null){ - $potionType = PotionType::WATER(); //TODO: this should be an error, but we haven't registered all the types yet + throw new \UnexpectedValueException("No such potion type"); } return new SplashPotion(EntityDataHelper::parseLocation($nbt, $world), null, $potionType, $nbt); }, ['ThrownPotion', 'minecraft:potion', 'thrownpotion'], EntityLegacyIds::SPLASH_POTION); diff --git a/src/item/PotionType.php b/src/item/PotionType.php index 533d29724..83ee1b300 100644 --- a/src/item/PotionType.php +++ b/src/item/PotionType.php @@ -46,8 +46,10 @@ use pocketmine\utils\EnumTrait; * @method static PotionType LONG_POISON() * @method static PotionType LONG_REGENERATION() * @method static PotionType LONG_SLOWNESS() + * @method static PotionType LONG_SLOW_FALLING() * @method static PotionType LONG_STRENGTH() * @method static PotionType LONG_SWIFTNESS() + * @method static PotionType LONG_TURTLE_MASTER() * @method static PotionType LONG_WATER_BREATHING() * @method static PotionType LONG_WEAKNESS() * @method static PotionType MUNDANE() @@ -55,6 +57,7 @@ use pocketmine\utils\EnumTrait; * @method static PotionType POISON() * @method static PotionType REGENERATION() * @method static PotionType SLOWNESS() + * @method static PotionType SLOW_FALLING() * @method static PotionType STRENGTH() * @method static PotionType STRONG_HARMING() * @method static PotionType STRONG_HEALING() @@ -63,8 +66,10 @@ use pocketmine\utils\EnumTrait; * @method static PotionType STRONG_REGENERATION() * @method static PotionType STRONG_STRENGTH() * @method static PotionType STRONG_SWIFTNESS() + * @method static PotionType STRONG_TURTLE_MASTER() * @method static PotionType SWIFTNESS() * @method static PotionType THICK() + * @method static PotionType TURTLE_MASTER() * @method static PotionType WATER() * @method static PotionType WATER_BREATHING() * @method static PotionType WEAKNESS() @@ -177,6 +182,21 @@ final class PotionType{ ]), new self("wither", fn() => [ new EffectInstance(VanillaEffects::WITHER(), 800, 1) + ]), + new self("turtle_master", fn() => [ + //TODO + ]), + new self("long_turtle_master", fn() => [ + //TODO + ]), + new self("strong_turtle_master", fn() => [ + //TODO + ]), + new self("slow_falling", fn() => [ + //TODO + ]), + new self("long_slow_falling", fn() => [ + //TODO ]) ); }