Ignore armorstands for fleshhook/snowball

This commit is contained in:
samczsun 2017-02-12 03:42:35 -05:00 committed by cnr
parent 16ba7b984b
commit cd387284bf
3 changed files with 8 additions and 1 deletions

View File

@ -50,7 +50,7 @@ public class Constants
if (object.has("properties")) if (object.has("properties"))
profile.getProperties().putAll(context.deserialize(object.get("properties"), PropertyMap.class)); profile.getProperties().putAll(context.deserialize(object.get("properties"), PropertyMap.class));
return profile; return profile;
} }

View File

@ -4,6 +4,7 @@ import org.bukkit.EntityEffect;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Item; import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -69,6 +70,9 @@ public class ItemFleshHook extends ItemGadget implements IThrown
if (Manager.collideEvent(player, this, target)) if (Manager.collideEvent(player, this, target))
return; return;
if (target instanceof ArmorStand)
return;
//Pull //Pull
UtilAction.velocity(target, UtilAction.velocity(target,
UtilAlg.getTrajectory(target.getLocation(), player.getLocation()), UtilAlg.getTrajectory(target.getLocation(), player.getLocation()),

View File

@ -2,6 +2,7 @@ package mineplex.core.gadget.gadgets.item;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Snowball; import org.bukkit.entity.Snowball;
import org.bukkit.event.EventHandler; 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(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)); 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); event.getDamager().getWorld().playSound(event.getDamager().getLocation(), Sound.STEP_SNOW, 1, 0.5f);