mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 12:04:46 +00:00
Move potion types to enum
This commit is contained in:
@@ -30,12 +30,11 @@ use pocketmine\player\Player;
|
||||
|
||||
class SplashPotion extends ProjectileItem{
|
||||
|
||||
/** @var int */
|
||||
private $potionId;
|
||||
private PotionType $potionType;
|
||||
|
||||
public function __construct(ItemIdentifier $identifier, string $name, int $potionId){
|
||||
public function __construct(ItemIdentifier $identifier, string $name, PotionType $potionType){
|
||||
parent::__construct($identifier, $name);
|
||||
$this->potionId = $potionId;
|
||||
$this->potionType = $potionType;
|
||||
}
|
||||
|
||||
public function getMaxStackSize() : int{
|
||||
@@ -43,7 +42,7 @@ class SplashPotion extends ProjectileItem{
|
||||
}
|
||||
|
||||
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
||||
return new SplashPotionEntity($location, $thrower, $this->potionId);
|
||||
return new SplashPotionEntity($location, $thrower, $this->potionType);
|
||||
}
|
||||
|
||||
public function getThrowForce() : float{
|
||||
|
Reference in New Issue
Block a user