mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Split up Effects into a bunch of classes
Server-side levitation now works too.
This commit is contained in:
@ -25,6 +25,7 @@ namespace pocketmine\entity\projectile;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockFactory;
|
||||
use pocketmine\entity\effect\InstantEffect;
|
||||
use pocketmine\entity\EffectInstance;
|
||||
use pocketmine\entity\Living;
|
||||
use pocketmine\event\entity\ProjectileHitBlockEvent;
|
||||
@ -101,7 +102,7 @@ class SplashPotion extends Throwable{
|
||||
foreach($this->getPotionEffects() as $effect){
|
||||
//getPotionEffects() is used to get COPIES to avoid accidentally modifying the same effect instance already applied to another entity
|
||||
|
||||
if(!$effect->getType()->isInstantEffect()){
|
||||
if(!($effect->getType() instanceof InstantEffect)){
|
||||
$newDuration = (int) round($effect->getDuration() * 0.75 * $distanceMultiplier);
|
||||
if($newDuration < 20){
|
||||
continue;
|
||||
@ -109,7 +110,7 @@ class SplashPotion extends Throwable{
|
||||
$effect->setDuration($newDuration);
|
||||
$entity->addEffect($effect);
|
||||
}else{
|
||||
$effect->getType()->applyEffect($entity, $effect, $distanceMultiplier, $this, $this->getOwningEntity());
|
||||
$effect->getType()->applyEffect($entity, $effect, $distanceMultiplier, $this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user