paintballs wont change near portals.
This commit is contained in:
parent
935599030b
commit
d4affc8bb6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user