diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java index 7a8a8d839..f9eea818b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/Achievement.java @@ -164,24 +164,24 @@ public enum Achievement new int[]{10}, AchievementCategory.UHC), - //Minecraft League - MINECRAFT_LEAGUE_STRIKE("First Strike", 600, - new String[] {"Minecraft League.FirstStrike"}, + //MC League + MC_LEAGUE_STRIKE("First Strike", 600, + new String[] {"MC League.FirstStrike"}, new String[] {"Earn 30 First Bloods"}, new int[] {30}, - AchievementCategory.MINECRAFT_LEAGUE), + AchievementCategory.MC_LEAGUE), - MINECRAFT_LEAGUE_HEAD("Head Hunter", 600, - new String[] {"Minecraft League.HeadHunter"}, + MC_LEAGUE_HEAD("Head Hunter", 600, + new String[] {"MC League.HeadHunter"}, new String[] {"Grab 25 Wither Skulls"}, new int[] {25}, - AchievementCategory.MINECRAFT_LEAGUE), + AchievementCategory.MC_LEAGUE), - MINECRAFT_LEAGUE_ALTAR("Altar Builder", 600, - new String[] {"Minecraft League.AltarBuilder"}, + MC_LEAGUE_ALTAR("Altar Builder", 600, + new String[] {"MC League.AltarBuilder"}, new String[] {"Place 50 Wither Skulls", "on your Altar"}, new int[] {50}, - AchievementCategory.MINECRAFT_LEAGUE), + AchievementCategory.MC_LEAGUE), //UHC WIZARDS_WINS("Supreme Wizard", 600, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java index 784ed7aa4..2cea19ee0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/achievement/AchievementCategory.java @@ -50,7 +50,7 @@ public enum AchievementCategory new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, Material.GOLDEN_APPLE, 0, GameCategory.SURVIVAL, "None"), - MINECRAFT_LEAGUE("Minecraft League", null, + MC_LEAGUE("MC League", null, new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED }, Material.IRON_CHESTPLATE, 0, GameCategory.SURVIVAL, "None"), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java index 51bb9f662..7a14f7c44 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/game/GameDisplay.java @@ -68,7 +68,7 @@ public enum GameDisplay Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54), - Minecraft_League("Minecraft League", Material.DIAMOND_SWORD, (byte)0, GameCategory.SURVIVAL, 62), + Minecraft_League("MC League", Material.DIAMOND_SWORD, (byte)0, GameCategory.SURVIVAL, 62), ChampionsCTF("Champions CTF", "Champions", Material.BANNER, DyeColor.RED.getDyeData(), GameCategory.CHAMPIONS, 56), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/MinecraftLeague.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/MinecraftLeague.java index 2e659e938..4679a4e05 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/MinecraftLeague.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/MinecraftLeague.java @@ -396,9 +396,9 @@ public class MinecraftLeague extends TeamGame return ids; } - //public TeamTowerBase getActiveTower(GameTeam team) + public TeamTowerBase getActiveTower(GameTeam team) { - //return _tower.getVulnerable(team); + return _tower.getVulnerable(team); } public TowerManager getTowerManager() @@ -538,12 +538,6 @@ public class MinecraftLeague extends TeamGame Scoreboard.Reset(); - Scoreboard.WriteBlank(); - Scoreboard.Write(C.cYellowB + "Time Elapsed"); - Scoreboard.Write(UtilTime.MakeStr(_liveTime)); - if (OverTime) - Scoreboard.Write(C.cDRedB + "Overtime"); - Scoreboard.WriteBlank(); Scoreboard.Write(C.cRedB + "Red Team"); Scoreboard.Write("Towers: " + reds); @@ -570,6 +564,12 @@ public class MinecraftLeague extends TeamGame i++; } + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cYellowB + "Time Elapsed"); + Scoreboard.Write(UtilTime.MakeStr(_liveTime)); + if (OverTime) + Scoreboard.Write(C.cDRedB + "Overtime"); + Scoreboard.Draw(); } @@ -797,7 +797,7 @@ public class MinecraftLeague extends TeamGame if (UtilTime.elapsed(GetStateTime(), UtilTime.convert(15, TimeUnit.MINUTES, TimeUnit.MILLISECONDS))) { OverTime = true; - UtilTextMiddle.display(C.cGold + "Overtime", C.cGold + "Dying will now cause your crystal to lose 20 health!"); + UtilTextMiddle.display(C.cGold + "Overtime", C.cGold + "Dying will now cause your crystal to lose 50 health!"); } } @@ -956,7 +956,7 @@ public class MinecraftLeague extends TeamGame { if (!tower.damage(1, player)) { - player.playSound(tower.getLocation(), Sound.ZOMBIE_WOODBREAK, 1, 0); + player.getWorld().playSound(tower.getLocation(), Sound.ZOMBIE_METAL, 1, 1.5f); Alert.alert(tower.getTeam(), tower); } return; @@ -968,7 +968,7 @@ public class MinecraftLeague extends TeamGame if (!tower.damage(damage, player)) { - player.playSound(tower.getLocation(), Sound.ZOMBIE_WOODBREAK, 1, 0); + player.getWorld().playSound(tower.getLocation(), Sound.ZOMBIE_METAL, 1, 1.5f); Alert.alert(tower.getTeam(), tower); } @@ -1325,7 +1325,7 @@ public class MinecraftLeague extends TeamGame } if (event.getInventory().getResult().getType() == Material.ARROW) { - event.getInventory().setResult(new ItemStack(Material.ARROW, (event.getInventory().getResult().getAmount() * 4))); + event.getInventory().setResult(new ItemStack(Material.ARROW, ((event.getInventory().getResult().getAmount() / 4) * 6))); } if (event.getInventory().getResult().getType() == Material.FLINT_AND_STEEL) { @@ -1507,7 +1507,7 @@ public class MinecraftLeague extends TeamGame } } - if (UtilInv.getAmount(player, Material.FISHING_ROD) >= 1) + /*if (UtilInv.getAmount(player, Material.FISHING_ROD) >= 1) { for (ItemStack poss : UtilInv.getItems(player)) { @@ -1517,16 +1517,16 @@ public class MinecraftLeague extends TeamGame break; } } - } + }*/ - //int arrowsToAdd = UtilInv.getAmount(player, Material.ARROW) / 2; - //while (arrowsToAdd >= 1) - //{ - //int subtract = Math.min(64, arrowsToAdd); - //gear.add(new ItemStack(Material.ARROW, subtract)); - //arrowsToAdd -= subtract; - //} - if (UtilInv.getAmount(player, Material.ARROW) >= 1) + int arrowsToAdd = UtilInv.getAmount(player, Material.ARROW) / 2; + while (arrowsToAdd >= 1) + { + int subtract = Math.min(64, arrowsToAdd); + gear.add(new ItemStack(Material.ARROW, subtract)); + arrowsToAdd -= subtract; + } + /*if (UtilInv.getAmount(player, Material.ARROW) >= 1) { for (ItemStack arrow : UtilInv.getItems(player)) { @@ -1535,7 +1535,7 @@ public class MinecraftLeague extends TeamGame gear.add(arrow); } } - } + }*/ _gear.put(player, gear); } @@ -1638,13 +1638,14 @@ public class MinecraftLeague extends TeamGame { if (tb.Alive) { - tb.damage(20, null); + tb.damage(50, null); break; } } if (_tower.getAmountAlive(GetTeam(event.GetPlayer())) >= 1) { event.setCancelled(true); + UtilPlayer.message(event.GetPlayer(), F.main("Game", "Your Tower lost 50 HP on your Respawn!")); } } else diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/commands/DebugCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/commands/DebugCommand.java new file mode 100644 index 000000000..a6b7929dc --- /dev/null +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/commands/DebugCommand.java @@ -0,0 +1,23 @@ +package nautilus.game.arcade.game.games.minecraftleague.commands; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import nautilus.game.arcade.ArcadeManager; + +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; + +public class DebugCommand extends CommandBase +{ + public DebugCommand(ArcadeManager plugin) + { + super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "debug"); + } + + @Override + public void Execute(Player caller, String[] args) + { + caller.getWorld().spawnEntity(caller.getLocation(), EntityType.ENDER_CRYSTAL); + } + +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/commands/MinecraftLeagueCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/commands/MinecraftLeagueCommand.java index 4a054edf6..17e41d437 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/commands/MinecraftLeagueCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/commands/MinecraftLeagueCommand.java @@ -21,6 +21,7 @@ public class MinecraftLeagueCommand extends MultiCommandBase AddCommand(new GUICommand(plugin, host)); AddCommand(new FreezeCommand(plugin, host)); AddCommand(new StatusCommand(plugin, host)); + AddCommand(new DebugCommand(plugin)); _host = host; } @@ -31,5 +32,6 @@ public class MinecraftLeagueCommand extends MultiCommandBase UtilPlayer.message(caller, F.help("/mcLeague gui", "Opens a GUI for controlling Respawn Crystals", Rank.ADMIN)); UtilPlayer.message(caller, F.help("/mcLeague freeze ", "Freezes or unfreezes a player [for cheaters]", Rank.ADMIN)); UtilPlayer.message(caller, F.help("/mcLeague status", "Gets statistics about both Respawn Crystals", Rank.DEVELOPER)); + UtilPlayer.message(caller, F.help("/mcLeague debug", "Spawns a Tower Mob at your position", Rank.DEVELOPER)); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/DefenderAI.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/DefenderAI.java index ee1d7f1c6..63d17444a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/DefenderAI.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/DefenderAI.java @@ -169,7 +169,7 @@ public class DefenderAI private void drawBeam() { Location base = _base.clone().add(0, 10, 0); - Location target = _manager.getTeamTowers(_tower.getTeam()).getLast().getLocation().clone().add(0, 10, 0);//_manager.getTeamTowers(_tower.getTeam()).get(_number).getLocation().clone().add(0, 10, 0); + Location target = _manager.getTeamTowers(_tower.getTeam()).get(_number).getLocation().clone().add(0, 10, 0); Location display = base.clone(); while (UtilMath.offset(base, target) > UtilMath.offset(base, display)) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TeamBeacon.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TeamBeacon.java index 55d16241c..0432c46be 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TeamBeacon.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TeamBeacon.java @@ -35,16 +35,16 @@ public class TeamBeacon return false; }*/ - /*public void setBlock(Block block) - { - _block = block; - }*/ - public Block getBlock() { return _block; } + /*public void setBlock(Block block) + { + _block = block; + }*/ + public void update() { if (_block.getType() != Material.BEACON) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TeamTowerBase.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TeamTowerBase.java index 4edfa82b5..9965f80f7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TeamTowerBase.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TeamTowerBase.java @@ -48,7 +48,7 @@ public abstract class TeamTowerBase { _host = host; _manager = manager; - _spawn = spawn.clone().add(-0.5, 1.2, -0.5); + _spawn = spawn.clone().add(-0.5, 3.2, -0.5); _team = team; _maxHealth = 11111D; _health = 11111D; @@ -74,9 +74,9 @@ public abstract class TeamTowerBase { String message = ""; if (player != null) - message = _host.GetTeam(player).GetColor() + player.getName() + _team.GetColor() + " has destroyed " + _team.getDisplayName() + "'s " + C.cDPurpleB + _type + _team.GetColor() + "!"; + message = _host.GetTeam(player).GetColor() + player.getName() + _team.GetColor() + " has destroyed " + _team.getDisplayName() + "'s " + _type + "!"; else - message = _team.GetColor() + _team.getDisplayName() + "'s " + C.cDPurpleB + _type + _team.GetColor() + " has been destroyed!"; + message = _team.GetColor() + _team.getDisplayName() + "'s " + _type + " has been destroyed!"; //Bukkit.broadcastMessage(message); UtilTextMiddle.display("", message); @@ -131,7 +131,7 @@ public abstract class TeamTowerBase { UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, _spawn, null, 0, 2, ViewDist.NORMAL); _spawn.getWorld().playSound(_spawn, Sound.EXPLODE, 10, 0); - for (Block b : UtilBlock.getExplosionBlocks(_spawn, 2, false)) + for (Block b : UtilBlock.getExplosionBlocks(_spawn, 5, false)) { b.setType(Material.AIR); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TowerManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TowerManager.java index ec9b188bd..e9b9ec482 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TowerManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/data/TowerManager.java @@ -18,17 +18,15 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.Listener; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; public class TowerManager implements Listener { public MinecraftLeague Host; private ConcurrentHashMap _towers = new ConcurrentHashMap(); - //private ConcurrentHashMap _vulnerableTower = new ConcurrentHashMap(); + private ConcurrentHashMap _vulnerableTower = new ConcurrentHashMap(); private ConcurrentHashMap _def = new ConcurrentHashMap(); //private ConcurrentHashMap _mapZone = new ConcurrentHashMap(); - private ConcurrentHashMap> _beacons = new ConcurrentHashMap>(); + //private ConcurrentHashMap _beacons = new ConcurrentHashMap(); private OreGenerator _ore; public boolean Attack = false; @@ -38,49 +36,22 @@ public class TowerManager implements Listener _ore = new OreGenerator(); } - private void makeVulnerable(/*TeamTowerBase base*/GameTeam team, boolean core) + private void makeVulnerable(TeamTowerBase base) { - /*if (base instanceof TeamTower) + if (base instanceof TeamTower) _vulnerableTower.put(base.getTeam(), ((TeamTower)base).Number); else - _vulnerableTower.put(base.getTeam(), 3);*/ + _vulnerableTower.put(base.getTeam(), 3); - List beacon = new ArrayList(); - if (core) - { - for (TeamBeacon tb : _beacons.get(team)) - Host.Beacons.remove(tb.getBlock()); - _beacons.remove(team); - } - - for (TeamTowerBase base : getTeamTowers(team)) - { - if (base instanceof TeamTower) - { - base.setVulnerable(!core); - if (!core) - { - beacon.add(new TeamBeacon(team, base.getBeacon().getBlock())); - } - } - } - if (core) - { - getTeamTowers(team).getLast().setVulnerable(true); - beacon.add(new TeamBeacon(team, getTeamTowers(team).getLast().getBeacon().getBlock())); - } - _beacons.put(team, beacon); - for (TeamBeacon tb : beacon) - { - Host.Beacons.put(tb.getBlock(), tb); - } + base.Vulnerable = true; + //_beacons.get(base.getTeam()).setBlock(getVulnerable(base.getTeam()).getBeacon().getBlock()); } public void ironOreGen(GameTeam team, boolean start) { int amount = 20; if (start) - amount = 40; + amount = 80; for (Location loc : Host.WorldData.GetCustomLocs(DataLoc.DIAMOND_ORE.getKey())) { @@ -169,10 +140,10 @@ public class TowerManager implements Listener return i; } - /*public TeamTowerBase getVulnerable(GameTeam team) + public TeamTowerBase getVulnerable(GameTeam team) { return getTeamTowers(team).get(_vulnerableTower.get(team) - 1); - }*/ + } public void parseTowers(WorldData data) { @@ -203,12 +174,13 @@ public class TowerManager implements Listener _mapZone.put(tower, zone);*/ } - makeVulnerable(red, false); - makeVulnerable(blue, false); - /*_beacons.put(red, new TeamBeacon(red, getTeamTowers(red).getFirst().getBeacon().getBlock())); - _beacons.put(blue, new TeamBeacon(blue, getTeamTowers(blue).getFirst().getBeacon().getBlock())); - Host.Beacons.put(red, _beacons.get(red)); - Host.Beacons.put(blue, _beacons.get(blue));*/ + makeVulnerable(getTeamTowers(red).getFirst()); + makeVulnerable(getTeamTowers(blue).getFirst()); + for (TeamTowerBase tb : _towers.keySet()) + { + TeamBeacon b = new TeamBeacon(tb.getTeam(), tb.getBeacon().getBlock()); + Host.Beacons.put(b.getBlock(), b); + } ironOreGen(red, true); ironOreGen(blue, true); } @@ -231,12 +203,12 @@ public class TowerManager implements Listener public void handleTowerDeath(TeamTowerBase towerBase) { - //towerBase.setVulnerable(false); + towerBase.setVulnerable(false); //ironOreGen(towerBase.getTeam()); - for (Player player : towerBase.getTeam().GetPlayers(true)) + /*for (Player player : towerBase.getTeam().GetPlayers(true)) { player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20 * 60, 1)); - } + }*/ /*Bukkit.getScheduler().runTaskLater(Host.Manager.getPlugin(), new Runnable() { public void run() @@ -277,9 +249,7 @@ public class TowerManager implements Listener return; } - if (getTeamTowers(towerBase.getTeam()).getFirst().Alive || getTeamTowers(towerBase.getTeam()).get(1).Alive) - return; - makeVulnerable(towerBase.getTeam(), true); + makeVulnerable(getTeamTowers(towerBase.getTeam()).get(_vulnerableTower.get(towerBase.getTeam()))); } public void toggleAttack() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/WitherVariation.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/WitherVariation.java index 7ac0dd513..48005333e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/WitherVariation.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/WitherVariation.java @@ -80,7 +80,7 @@ public class WitherVariation extends GameVariation @Override public String[] getTeamScoreboardAdditions(GameTeam team) { - String skulls = "☠ ☠ ☠"; + String skulls = ""; for (int i = 1; i < 4; i++) { if (!skulls.equalsIgnoreCase("")) @@ -92,7 +92,7 @@ public class WitherVariation extends GameVariation skulls = skulls + ChatColor.GRAY + "☠"; } - return new String[] {"Altar Skulls: " + skulls}; + return new String[] {"Skulls: " + skulls}; } private Location getNearest(Location to, ConcurrentHashMap options) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/data/WitherMinionManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/data/WitherMinionManager.java index 8f51d79ef..0bcd0bcd6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/data/WitherMinionManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minecraftleague/variation/wither/data/WitherMinionManager.java @@ -29,7 +29,6 @@ import nautilus.game.arcade.game.games.minecraftleague.variation.wither.WitherVa import org.bukkit.Bukkit; import org.bukkit.ChatColor; -import org.bukkit.Color; import org.bukkit.FireworkEffect.Type; import org.bukkit.Location; import org.bukkit.Material; @@ -37,6 +36,7 @@ import org.bukkit.block.Block; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSkeleton; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; import org.bukkit.entity.Skeleton.SkeletonType; @@ -47,6 +47,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.EntityChangeBlockEvent; +import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.player.PlayerDropItemEvent; @@ -246,18 +247,11 @@ public class WitherMinionManager implements Listener { if (UtilInv.contains(player, Material.SKULL_ITEM, (byte) 1, 1)) { - for (Location loc : UtilShapes.getSphereBlocks(player.getLocation(), 3, 3, true)) - { - UtilParticle.PlayParticleToAll(ParticleType.PORTAL, loc, null, 0, 2, ViewDist.MAX); - } - for (Location loc : UtilShapes.getCircle(player.getLocation(), true, 1)) - { - UtilParticle.PlayParticleToAll(ParticleType.DRIP_LAVA, loc, null, 0, 1, ViewDist.MAX); - } + UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation(), new Random().nextFloat(), new Random().nextFloat(), new Random().nextFloat(), 0, 1, ViewDist.MAX); if (Recharge.Instance.usable(player, "FIREWORK_ALERT", false)) { - Recharge.Instance.use(player, "FIREWORK_ALERT", UtilTime.convert(5, TimeUnit.SECONDS, TimeUnit.MILLISECONDS), false, false); - UtilFirework.playFirework(player.getEyeLocation().add(0, 3, 0), Type.BALL_LARGE, Color.PURPLE, false, true); + Recharge.Instance.use(player, "FIREWORK_ALERT", UtilTime.convert(2, TimeUnit.SECONDS, TimeUnit.MILLISECONDS), false, false); + UtilFirework.playFirework(player.getEyeLocation().add(0, 3, 0), Type.BURST, _host.Host.GetTeam(player).GetColorBase(), false, true); } } else @@ -469,4 +463,22 @@ public class WitherMinionManager implements Listener event.setCancelled(true); } } + + @EventHandler + public void fixDamage(EntityDamageEvent event) + { + if (!_host.Host.IsLive()) + return; + + if (_entity == null) + return; + if (event.getEntity().getEntityId() != _entity.getEntityId()) + return; + + event.setCancelled(true); + LivingEntity e = (LivingEntity)event.getEntity(); + double newHealth = Math.max(0, e.getHealth() - event.getDamage()); + newHealth = Math.min(e.getMaxHealth(), newHealth); + e.setHealth(newHealth); + } }