Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex

This commit is contained in:
Mini-Chiss 2015-08-11 21:13:59 +02:00
commit a7cc3e1aa6

View File

@ -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;
@ -34,12 +40,13 @@ public class ItemPaintballGun extends ItemGadget
public ItemPaintballGun(GadgetManager manager)
{
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
@ -49,7 +56,7 @@ public class ItemPaintballGun extends ItemGadget
proj.setVelocity(proj.getVelocity().multiply(2));
_balls.add(proj);
//Sound
// Sound
player.getWorld().playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 1.5f, 1.2f);
}
@ -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