diff --git a/Plugins/Mineplex.Core/src/mineplex/core/blood/Blood.java b/Plugins/Mineplex.Core/src/mineplex/core/blood/Blood.java index e5f89c791..8e62d951c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/blood/Blood.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/blood/Blood.java @@ -54,22 +54,28 @@ public class Blood extends MiniPlugin @EventHandler(priority = EventPriority.MONITOR) public void display(BloodEvent event) { - for (int i = 0 ; i < event.getParticles() ; i++) + if(event.isCancelled()) return; + + if(event.getMaterial() != null && event.getMaterial() != Material.AIR) { - Item item = event.getLocation().getWorld().dropItem(event.getLocation(), - new ItemBuilder(event.getMaterial(), 1, event.getMaterialData()).setTitle("" + System.nanoTime()).build()); - - item.setVelocity(new Vector((Math.random() - 0.5)*event.getVelocityMult(),Math.random()*event.getVelocityMult(),(Math.random() - 0.5)*event.getVelocityMult())); - - item.setPickupDelay(999999); - - _blood.put(item, event.getTicks()); + for (int i = 0 ; i < event.getParticles() ; i++) + { + Item item = event.getLocation().getWorld().dropItem(event.getLocation(), + new ItemBuilder(event.getMaterial(), 1, event.getMaterialData()).setTitle("" + System.nanoTime()).build()); + + item.setVelocity(new Vector((Math.random() - 0.5)*event.getVelocityMult(),Math.random()*event.getVelocityMult(),(Math.random() - 0.5)*event.getVelocityMult())); + + item.setPickupDelay(999999); + + _blood.put(item, event.getTicks()); + } } if (event.getBloodStep()) event.getLocation().getWorld().playEffect(event.getLocation(), Effect.STEP_SOUND, 55); - event.getLocation().getWorld().playSound(event.getLocation(), event.getSound(), event.getSoundVolume(), event.getSoundPitch()); + if(event.getSound() != null) + event.getLocation().getWorld().playSound(event.getLocation(), event.getSound(), event.getSoundVolume(), event.getSoundPitch()); } @EventHandler