Ignore armorstands for fleshhook/snowball
This commit is contained in:
parent
16ba7b984b
commit
cd387284bf
|
@ -4,6 +4,7 @@ import org.bukkit.EntityEffect;
|
|||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -69,6 +70,9 @@ public class ItemFleshHook extends ItemGadget implements IThrown
|
|||
if (Manager.collideEvent(player, this, target))
|
||||
return;
|
||||
|
||||
if (target instanceof ArmorStand)
|
||||
return;
|
||||
|
||||
//Pull
|
||||
UtilAction.velocity(target,
|
||||
UtilAlg.getTrajectory(target.getLocation(), player.getLocation()),
|
||||
|
|
|
@ -2,6 +2,7 @@ package mineplex.core.gadget.gadgets.item;
|
|||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Snowball;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
@ -56,6 +57,8 @@ public class ItemSnowball extends ItemGadget
|
|||
|
||||
if(Manager.collideEvent(_snowballs.remove(ball), this, event.getEntity())) return;
|
||||
|
||||
if (event.getEntity() instanceof ArmorStand)
|
||||
return;
|
||||
|
||||
UtilAction.velocity(event.getEntity(), event.getDamager().getVelocity().normalize().add(new Vector(0,0.5,0)).multiply(0.5));
|
||||
event.getDamager().getWorld().playSound(event.getDamager().getLocation(), Sound.STEP_SNOW, 1, 0.5f);
|
||||
|
|
Loading…
Reference in New Issue