mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
Fixed typo on ProjectileItem class (#1431)
This commit is contained in:
parent
f6e30d4225
commit
9cd7f39c03
@ -58,23 +58,23 @@ abstract class ProjectileItem extends Item{
|
|||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$snowball = Entity::createEntity($this->getProjectileEntityType(), $player->getLevel(), $nbt, $player);
|
$projectile = Entity::createEntity($this->getProjectileEntityType(), $player->getLevel(), $nbt, $player);
|
||||||
$snowball->setMotion($snowball->getMotion()->multiply($this->getThrowForce()));
|
$projectile->setMotion($projectile->getMotion()->multiply($this->getThrowForce()));
|
||||||
|
|
||||||
$this->count--;
|
$this->count--;
|
||||||
|
|
||||||
if($snowball instanceof Projectile){
|
if($projectile instanceof Projectile){
|
||||||
$player->getServer()->getPluginManager()->callEvent($projectileEv = new ProjectileLaunchEvent($snowball));
|
$player->getServer()->getPluginManager()->callEvent($projectileEv = new ProjectileLaunchEvent($projectile));
|
||||||
if($projectileEv->isCancelled()){
|
if($projectileEv->isCancelled()){
|
||||||
$snowball->kill();
|
$projectile->kill();
|
||||||
}else{
|
}else{
|
||||||
$snowball->spawnToAll();
|
$projectile->spawnToAll();
|
||||||
$player->getLevel()->addSound(new LaunchSound($player), $player->getViewers());
|
$player->getLevel()->addSound(new LaunchSound($player), $player->getViewers());
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$snowball->spawnToAll();
|
$projectile->spawnToAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user