This commit is contained in:
alisolarflare 2016-11-04 23:49:30 -04:00
parent 7cc32b84a4
commit f151c54c98

View file

@ -54,7 +54,7 @@ public class BoomBowListener implements Listener {
if(tntStack.getAmount() > 3){ if(tntStack.getAmount() > 3){
tntStack.setAmount(tntStack.getAmount()-3); tntStack.setAmount(tntStack.getAmount()-3);
}else{ }else{
tntStack.setAmount(0);; player.getInventory().remove(tntStack);
} }
}else{ }else{
@ -64,11 +64,11 @@ public class BoomBowListener implements Listener {
@SuppressWarnings("deprecation")
public void Activate(PlayerInteractEvent event){ public void Activate(PlayerInteractEvent event){
//INIT - Player variables //INIT - Player variables
Player player = event.getPlayer(); Player player = event.getPlayer();
Location playerLocation = player.getLocation(); Location playerLocation = player.getLocation();
ItemStack boomBow = player.getInventory().getItemInMainHand();
//TODO: NERF - boomDecay //TODO: NERF - boomDecay
//TODO: NERF - endCrystal //TODO: NERF - endCrystal
@ -85,19 +85,19 @@ public class BoomBowListener implements Listener {
//SET - Player Velocity //SET - Player Velocity
player.setVelocity(event.getPlayer().getLocation().getDirection().normalize().multiply(2.5)); player.setVelocity(playerLocation.getDirection().normalize().multiply(2.5));
player.sendMessage("" + event.getPlayer().getVelocity().length());
//CREATE - Explosion + damage //CREATE - Explosion + damage
player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20); player.getWorld().playSound(playerLocation, Sound.ENTITY_GENERIC_EXPLODE, 10, -20);
event.getPlayer().getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2); player.getWorld().spawnParticle(Particle.EXPLOSION_HUGE, playerLocation, 2);
player.damage(9.0, player); player.damage(9.0, player);
player.getItemInHand().setDurability((short) (player.getItemInHand().getDurability() + 3)); boomBow.setDurability((short) (boomBow.getDurability() + 3));
} }
@EventHandler
public void FlyBowBoostDeath(PlayerDeathEvent event){ public void FlyBowBoostDeath(PlayerDeathEvent event){
event.getEntity().getServer().broadcastMessage("[boombow debug]: "+event.getEntity().getLastDamageCause().getCause().toString()); event.getEntity().getServer().broadcastMessage("[boombow debug]: "+event.getEntity().getLastDamageCause().getCause().toString());