Missed a class

This commit is contained in:
Sam 2017-03-25 16:05:58 +00:00
parent 02a6f34bd3
commit 60231c817f

View File

@ -32,6 +32,7 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
@ -49,10 +50,12 @@ public class PerkDestructor extends Perk
private long _fallTime;
private double _damage;
private HashSet<String> _preparing = new HashSet<String>();
private HashMap<Block, Long> _blocks = new HashMap<Block, Long>();
public PerkDestructor(int spawnRate, int max, long fallTime, boolean enabled)
public PerkDestructor(int spawnRate, int max, long fallTime, double damage, boolean enabled)
{
super("Seismic Charge", new String[]
{
@ -64,7 +67,8 @@ public class PerkDestructor extends Perk
_spawnRate = spawnRate;
_max = max;
_fallTime = fallTime;
_damage = damage;
_enabled = enabled;
}
@ -203,7 +207,17 @@ public class PerkDestructor extends Perk
if (!proj.hasMetadata("Destructor"))
return;
for (Player hit : UtilPlayer.getNearby(proj.getLocation(), 3))
{
if (player.equals(hit))
{
continue;
}
Manager.GetDamage().NewDamageEvent(hit, player, proj, EntityDamageEvent.DamageCause.CUSTOM, _damage, true, true, true, proj.getName(), GetName());
}
for (Block block : UtilBlock.getInRadius(proj.getLocation(), 4).keySet())
{
if (block.getType() == Material.AIR || block.getType() == Material.BEDROCK || block.getType() == Material.BARRIER || block.isLiquid())
@ -226,49 +240,6 @@ public class PerkDestructor extends Perk
proj.getWorld().playSound(proj.getLocation(), Sound.EXPLODE, 1f, 0.5f);
proj.getWorld().playSound(proj.getLocation(), Sound.FIREWORK_TWINKLE, 2f, 0.5f);
}
// @EventHandler
// public void collide(PlayerTeleportEvent event)
// {
// if (Manager.GetGame() == null || !Manager.GetGame().IsLive())
// return;
//
// if (event.getCause() != TeleportCause.ENDER_PEARL)
// return;
//
// if (!Manager.IsAlive(event.getPlayer()))
// return;
//
// if (!Kit.HasKit(event.getPlayer()))
// return;
//
//
//
// for (Block block : UtilBlock.getInRadius(event.getTo(), 4).keySet())
// {
// if (block.getType() == Material.AIR || block.getType() == Material.BEDROCK || block.isLiquid())
// continue;
//
// //Event
// PerkDestructorBlockEvent blockEvent = new PerkDestructorBlockEvent(event.getPlayer(), block);
// UtilServer.getServer().getPluginManager().callEvent(blockEvent);
//
// if (!blockEvent.isCancelled())
// {
// _blocks.put(block, System.currentTimeMillis());
//
// block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
// }
// }
//
// UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, event.getTo(), 0f, 0f, 0f, 0f, 1,
// ViewDist.MAX, UtilServer.getPlayers());
//
// event.getTo().getWorld().playSound(event.getTo(), Sound.EXPLODE, 1f, 0.5f);
// event.getTo().getWorld().playSound(event.getTo(), Sound.FIREWORK_TWINKLE, 2f, 0.5f);
//
// event.setCancelled(true);
// }
@SuppressWarnings("deprecation")
@EventHandler