Zero fall distance and null velocity in root target.
In an attempt to fix a potential "instant death" from fall damage when a boss uses the root target ability, this commit makes the ability set the player's fall distance to zero and their velocity to the null vector.
This commit is contained in:
parent
41da54cd0c
commit
8eea08213d
|
@ -9,6 +9,7 @@ import org.bukkit.entity.LivingEntity;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@AbilityInfo(
|
||||
name = "Root Target",
|
||||
|
@ -33,6 +34,8 @@ public class RootTarget implements Ability
|
|||
return;
|
||||
|
||||
Player player = (Player) target;
|
||||
player.setFallDistance(0);
|
||||
player.setVelocity(new Vector(0, 0, 0));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, DURATION, AMPLIFIER));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, DURATION, AMPLIFIER));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, DURATION, -AMPLIFIER));
|
||||
|
|
Loading…
Reference in New Issue