Implemented strong slowness potion (#5888)

This commit is contained in:
ace
2023-07-13 20:22:01 +08:00
committed by GitHub
parent 0d8a06732a
commit 7132ac0ad3
6 changed files with 30 additions and 20 deletions

View File

@@ -84,6 +84,7 @@ final class PotionTypeIdMap{
$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());
$this->register(PotionTypeIds::STRONG_SLOWNESS, PotionType::STRONG_SLOWNESS());
}
private function register(int $id, PotionType $type) : void{

View File

@@ -66,4 +66,5 @@ final class PotionTypeIds{
public const STRONG_TURTLE_MASTER = 39;
public const SLOW_FALLING = 40;
public const LONG_SLOW_FALLING = 41;
public const STRONG_SLOWNESS = 42;
}

View File

@@ -190,16 +190,17 @@ trait RuntimeEnumDeserializerTrait{
29 => \pocketmine\item\PotionType::STRONG_LEAPING(),
30 => \pocketmine\item\PotionType::STRONG_POISON(),
31 => \pocketmine\item\PotionType::STRONG_REGENERATION(),
32 => \pocketmine\item\PotionType::STRONG_STRENGTH(),
33 => \pocketmine\item\PotionType::STRONG_SWIFTNESS(),
34 => \pocketmine\item\PotionType::STRONG_TURTLE_MASTER(),
35 => \pocketmine\item\PotionType::SWIFTNESS(),
36 => \pocketmine\item\PotionType::THICK(),
37 => \pocketmine\item\PotionType::TURTLE_MASTER(),
38 => \pocketmine\item\PotionType::WATER(),
39 => \pocketmine\item\PotionType::WATER_BREATHING(),
40 => \pocketmine\item\PotionType::WEAKNESS(),
41 => \pocketmine\item\PotionType::WITHER(),
32 => \pocketmine\item\PotionType::STRONG_SLOWNESS(),
33 => \pocketmine\item\PotionType::STRONG_STRENGTH(),
34 => \pocketmine\item\PotionType::STRONG_SWIFTNESS(),
35 => \pocketmine\item\PotionType::STRONG_TURTLE_MASTER(),
36 => \pocketmine\item\PotionType::SWIFTNESS(),
37 => \pocketmine\item\PotionType::THICK(),
38 => \pocketmine\item\PotionType::TURTLE_MASTER(),
39 => \pocketmine\item\PotionType::WATER(),
40 => \pocketmine\item\PotionType::WATER_BREATHING(),
41 => \pocketmine\item\PotionType::WEAKNESS(),
42 => \pocketmine\item\PotionType::WITHER(),
default => throw new InvalidSerializedRuntimeDataException("Invalid serialized value for PotionType")
};
}

View File

@@ -190,16 +190,17 @@ trait RuntimeEnumSerializerTrait{
\pocketmine\item\PotionType::STRONG_LEAPING() => 29,
\pocketmine\item\PotionType::STRONG_POISON() => 30,
\pocketmine\item\PotionType::STRONG_REGENERATION() => 31,
\pocketmine\item\PotionType::STRONG_STRENGTH() => 32,
\pocketmine\item\PotionType::STRONG_SWIFTNESS() => 33,
\pocketmine\item\PotionType::STRONG_TURTLE_MASTER() => 34,
\pocketmine\item\PotionType::SWIFTNESS() => 35,
\pocketmine\item\PotionType::THICK() => 36,
\pocketmine\item\PotionType::TURTLE_MASTER() => 37,
\pocketmine\item\PotionType::WATER() => 38,
\pocketmine\item\PotionType::WATER_BREATHING() => 39,
\pocketmine\item\PotionType::WEAKNESS() => 40,
\pocketmine\item\PotionType::WITHER() => 41,
\pocketmine\item\PotionType::STRONG_SLOWNESS() => 32,
\pocketmine\item\PotionType::STRONG_STRENGTH() => 33,
\pocketmine\item\PotionType::STRONG_SWIFTNESS() => 34,
\pocketmine\item\PotionType::STRONG_TURTLE_MASTER() => 35,
\pocketmine\item\PotionType::SWIFTNESS() => 36,
\pocketmine\item\PotionType::THICK() => 37,
\pocketmine\item\PotionType::TURTLE_MASTER() => 38,
\pocketmine\item\PotionType::WATER() => 39,
\pocketmine\item\PotionType::WATER_BREATHING() => 40,
\pocketmine\item\PotionType::WEAKNESS() => 41,
\pocketmine\item\PotionType::WITHER() => 42,
default => throw new \pocketmine\utils\AssumptionFailedError("All PotionType cases should be covered")
});
}