Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex
This commit is contained in:
commit
a7cc3e1aa6
@ -18,9 +18,15 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.event.GadgetBlockEvent;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
@ -36,10 +42,11 @@ public class ItemPaintballGun extends ItemGadget
|
||||
super(manager, "Paintball Gun", new String[]
|
||||
{
|
||||
C.cWhite + "PEW PEW PEW PEW!",
|
||||
},
|
||||
-1,
|
||||
Material.GOLD_BARDING, (byte)0,
|
||||
200, new Ammo("Paintball Gun", "100 Paintballs", Material.GOLD_BARDING, (byte)0, new String[] { C.cWhite + "100 Paintballs for you to shoot!" }, 500, 100));
|
||||
}, -1, Material.GOLD_BARDING, (byte) 0, 200, new Ammo("Paintball Gun", "100 Paintballs", Material.GOLD_BARDING,
|
||||
(byte) 0, new String[]
|
||||
{
|
||||
C.cWhite + "100 Paintballs for you to shoot!"
|
||||
}, 500, 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -59,8 +66,26 @@ public class ItemPaintballGun extends ItemGadget
|
||||
if (!_balls.remove(event.getEntity()))
|
||||
return;
|
||||
|
||||
Location loc = event.getEntity().getLocation().add(event.getEntity().getVelocity());
|
||||
loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 49);
|
||||
Location loc = event.getEntity().getLocation();
|
||||
|
||||
Vector vec = event.getEntity().getVelocity().normalize().multiply(0.05);
|
||||
|
||||
if (vec.length() > 0)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while (UtilBlock.airFoliage(loc.getBlock()))
|
||||
{
|
||||
loc.add(vec);
|
||||
|
||||
if (i++ > 50)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
loc.getWorld().playSound(loc, Sound.DIG_STONE, 1.3F, 1.3F);
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.RED_DUST, loc, 0.2F, 0.2F, 0.2F, 1, 70, ViewDist.LONG, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
Loading…
Reference in New Issue
Block a user