mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 12:04:46 +00:00
(Splash)Potion: do not assume that META == potion ID
it probably will be, but meta might not be accessible anymore soon.
This commit is contained in:
@@ -30,13 +30,21 @@ use pocketmine\player\Player;
|
||||
|
||||
class SplashPotion extends ProjectileItem{
|
||||
|
||||
/** @var int */
|
||||
private $potionId;
|
||||
|
||||
public function __construct(int $id, int $variant, string $name, int $potionId){
|
||||
parent::__construct($id, $variant, $name);
|
||||
$this->potionId = $potionId;
|
||||
}
|
||||
|
||||
public function getMaxStackSize() : int{
|
||||
return 1;
|
||||
}
|
||||
|
||||
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
||||
$projectile = new SplashPotionEntity($location, $thrower);
|
||||
$projectile->setPotionId($this->meta);
|
||||
$projectile->setPotionId($this->potionId);
|
||||
return $projectile;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user