Improved Smasher

This commit is contained in:
fooify 2015-09-25 20:21:06 -07:00
parent 2de409c2f2
commit 1e018cf74a
2 changed files with 37 additions and 28 deletions

View File

@ -7,6 +7,26 @@ import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.EntityEffect;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowman;
import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
@ -36,25 +56,6 @@ import nautilus.game.arcade.game.games.monstermaze.events.SafepadBuildEvent;
import nautilus.game.arcade.game.games.monstermaze.events.SnowmanHitEvent;
import nautilus.game.arcade.game.games.monstermaze.kits.KitSmasher;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowman;
import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
public class Maze implements Listener
{
private MonsterMaze Host;
@ -819,7 +820,7 @@ public class Maze implements Listener
if (event.getPlayer().getItemInHand() == null)
return;
if (event.getPlayer().getItemInHand().getType() != Material.ANVIL)
if (event.getPlayer().getItemInHand().getType() != Material.COAL)
return;
Player player = event.getPlayer();
@ -833,18 +834,26 @@ public class Maze implements Listener
event.setCancelled(true);
UtilInv.remove(player, Material.ANVIL, (byte)0, 1);
UtilInv.remove(player, Material.COAL, (byte)0, 1);
UtilInv.Update(player);
for(Entity ent : UtilEnt.getInRadius(player.getLocation(), 3).keySet())
for(final Entity ent : UtilEnt.getInRadius(player.getLocation(), 3).keySet())
{
if(_ents.containsKey(ent))
{
Location loc = ent.getLocation();
final Location loc = ent.getLocation();
UtilFirework.playFirework(loc, Type.BURST, Color.BLACK, false, false);
ent.playEffect(EntityEffect.HURT);
UtilAction.velocity(ent, UtilAlg.getTrajectory(player, ent), 1, false, 0, 0.5, 1.2, true);
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Host.getArcadeManager().getPlugin(), new Runnable() {
@Override
public void run() {
UtilFirework.playFirework(loc, Type.BALL_LARGE, Color.BLACK, false, false);
ent.teleport(UtilAlg.Random(_spawns));
}
}, 0L, 2000L);
}
}
Bukkit.getPluginManager().callEvent(new AbilityUseEvent(player));

View File

@ -35,13 +35,13 @@ public class KitSmasher extends Kit
}
},
EntityType.SKELETON,
new ItemStack(Material.ANVIL));
new ItemStack(Material.COAL));
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.ANVIL, (byte)0, 3,
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.COAL, (byte)0, 3,
C.cYellow + C.Bold + "Right Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Smash"));
}
}