From d4affc8bb658ad8811e1c474d00cc96d1c197ee7 Mon Sep 17 00:00:00 2001 From: Chiss Date: Sun, 27 Oct 2013 02:53:38 +1100 Subject: [PATCH] paintballs wont change near portals. --- .../src/mineplex/hub/gadget/gadgets/PaintballGun.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/PaintballGun.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/PaintballGun.java index 34aa6dd5e..da1946bf9 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/PaintballGun.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/PaintballGun.java @@ -85,6 +85,7 @@ public class PaintballGun extends ItemGadget public void Paint(ProjectileHitEvent event) { Location loc = event.getEntity().getLocation().add(event.getEntity().getVelocity()); + loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 49); byte color = 2; double r = Math.random(); @@ -93,6 +94,12 @@ public class PaintballGun extends ItemGadget else if (r > 0.4) color = 9; else if (r > 0.2) color = 14; + for (Block block : UtilBlock.getInRadius(loc, 3d).keySet()) + { + if (block.getType() == Material.PORTAL) + return; + } + for (Block block : UtilBlock.getInRadius(loc, 1.5d).keySet()) { if (!UtilBlock.solid(block)) @@ -100,8 +107,6 @@ public class PaintballGun extends ItemGadget Manager.Manager.GetBlockRestore().Add(block, 35, color, 4000); } - - loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 49); } @EventHandler