diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/SpiderBoss.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/SpiderBoss.java index 612113429..124a924aa 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/SpiderBoss.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/SpiderBoss.java @@ -1,6 +1,7 @@ package mineplex.minecraft.game.core.boss.broodmother; import mineplex.core.blockrestore.BlockRestore; +import mineplex.core.common.util.UtilMath; import mineplex.core.disguise.DisguiseManager; import mineplex.core.projectile.ProjectileManager; import mineplex.minecraft.game.core.boss.EventCreature; @@ -21,8 +22,7 @@ public class SpiderBoss extends WorldEvent { public SpiderBoss(DamageManager damageManager, BlockRestore blockRestore, ConditionManager conditionManager, ProjectileManager projectileManager, Location cornerLocation) { - super(DisguiseManager.INSTANCE, projectileManager, damageManager, blockRestore, conditionManager, "Brood Mother", cornerLocation, - "schematic/Golem.schematic"); + super(DisguiseManager.INSTANCE, projectileManager, damageManager, blockRestore, conditionManager, "Brood Mother", cornerLocation); } @EventHandler @@ -30,7 +30,7 @@ public class SpiderBoss extends WorldEvent { Block block = event.getBlock(); - if (!getEventMap().isInMap(block.getLocation())) + if (UtilMath.offset2d(event.getBlock().getLocation(), getCenterLocation()) > 40) { return; } @@ -44,22 +44,6 @@ public class SpiderBoss extends WorldEvent event.getBlock().setType(Material.AIR); } - @EventHandler - public void onString(ItemSpawnEvent event) - { - if (!getEventMap().isInMap(event.getLocation())) - { - return; - } - - if (event.getEntity().getItemStack().getType() != Material.STRING) - { - return; - } - - event.setCancelled(true); - } - @Override protected void customStart() { diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/SpiderCreature.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/SpiderCreature.java index b17578cd7..a4b657260 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/SpiderCreature.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/SpiderCreature.java @@ -8,24 +8,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map.Entry; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.boss.BossAbility; -import mineplex.minecraft.game.core.boss.EventCreature; -import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderCocoon; -import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderEggScatter; -import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderEggplosm; -import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderPoisonBarrage; -import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderWebBarrage; -import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderWebStomp; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; - import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -40,6 +22,24 @@ import org.bukkit.util.Vector; import com.google.common.collect.Lists; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.boss.BossAbility; +import mineplex.minecraft.game.core.boss.EventCreature; +import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderCeilingCling; +import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderEggScatter; +import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderEggplosm; +import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderPoisonBarrage; +import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderWebBarrage; +import mineplex.minecraft.game.core.boss.broodmother.attacks.SpiderWebStomp; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; + public class SpiderCreature extends EventCreature { private ArrayList _currentAbilities = new ArrayList(); @@ -50,7 +50,6 @@ public class SpiderCreature extends EventCreature private Vector _afkWalk = new Vector(); private HashMap _cooldowns = new HashMap(); private long _lastAttack; - public List Webs = Lists.newArrayList(); public SpiderCreature(SpiderBoss boss, Location location, double maxHealth) { @@ -68,10 +67,10 @@ public class SpiderCreature extends EventCreature @Override public void dieCustom() { - for (Block block : Webs) + /*for (Block block : Webs) { block.setType(Material.AIR); - } + }*/ } @EventHandler @@ -131,10 +130,10 @@ public class SpiderCreature extends EventCreature } } - { // Cocoon + { // Ceiling Cling if (getEvent().getCreatures().size() < 5) { - weight.put(SpiderCocoon.class, 2); + weight.put(SpiderCeilingCling.class, 2); } } @@ -242,7 +241,14 @@ public class SpiderCreature extends EventCreature for (BossAbility ability : _currentAbilities) { - ability.tick(); + try + { + ability.tick(); + } + catch (Exception e) + { + e.printStackTrace(); + } if (!ability.canMove()) { diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderCeilingCling.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderCeilingCling.java index b041e1ecf..ec6d85ad3 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderCeilingCling.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderCeilingCling.java @@ -41,7 +41,7 @@ public class SpiderCeilingCling extends SpiderEggAbility for (int i = 0; i < 10; i++) { - Location loc = getBoss().getSpawnLocation().clone().add(0, -27, 0).add(UtilMath.rr(5, true), 12, UtilMath.rr(5, true)); + Location loc = getLocation().add(UtilMath.rr(10, true), 12, UtilMath.rr(10, true)); if (UtilAlg.HasSight(getLocation(), loc)) { @@ -215,4 +215,4 @@ public class SpiderCeilingCling extends SpiderEggAbility event.SetCancelled("Cancelled"); } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderWebBarrage.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderWebBarrage.java index 7ec04a2e8..103f8258e 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderWebBarrage.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderWebBarrage.java @@ -11,6 +11,7 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.boss.BossAbility; import mineplex.minecraft.game.core.boss.broodmother.SpiderCreature; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; @@ -127,8 +128,8 @@ public class SpiderWebBarrage extends BossAbility if (UtilBlock.airFoliage(block) || block.getType() == Material.WEB) { - block.setType(Material.WEB); - getBoss().Webs.add(block); + Bukkit.broadcastMessage("Setting Web"); + getBoss().getEvent().setBlock(block, Material.WEB); } // Expire diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderWebStomp.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderWebStomp.java index d209c671d..45a8359d7 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderWebStomp.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderWebStomp.java @@ -5,6 +5,7 @@ import mineplex.core.common.util.UtilMath; import mineplex.minecraft.game.core.boss.BossAbility; import mineplex.minecraft.game.core.boss.broodmother.SpiderCreature; +import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.block.Block; @@ -78,10 +79,10 @@ public class SpiderWebStomp extends BossAbility { continue; } - - block.setType(Material.WEB); + + Bukkit.broadcastMessage("Setting Web"); + getBoss().getEvent().setBlock(block, Material.WEB); block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.WEB); - getBoss().Webs.add(block); } } } diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/GolemCreature.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/GolemCreature.java index 6133a6426..be4e87f8c 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/GolemCreature.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/GolemCreature.java @@ -409,7 +409,14 @@ public class GolemCreature extends EventCreature for (BossAbility ability : _currentAbilities) { - ability.tick(); + try + { + ability.tick(); + } + catch (Exception e) + { + e.printStackTrace(); //Keeps the boss from getting stuck if one of the moves throws an error in progression + } if (!ability.canMove()) { @@ -618,25 +625,4 @@ public class GolemCreature extends EventCreature endAbility(); } } - - @EventHandler - public void onPlayerDamage(CustomDamageEvent event) - { - if (!(event.GetDamageeEntity() instanceof Player)) - { - return; - } - - if (event.GetCause() != DamageCause.FALL) - { - return; - } - - if (!getEvent().getEventMap().isInMap(event.GetDamageeEntity().getLocation())) - { - return; - } - - event.AddMod("Fall negation", 0.5); - } } diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/abilities/GroundSpike.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/abilities/GroundSpike.java index 8aedd94de..3cac28e69 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/abilities/GroundSpike.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/abilities/GroundSpike.java @@ -2,10 +2,12 @@ package mineplex.minecraft.game.core.boss.ironwizard.abilities; import java.util.LinkedList; -import mineplex.core.common.util.UtilTime; - import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.entity.Player; + +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTime; public class GroundSpike { @@ -29,13 +31,17 @@ public class GroundSpike _finished = false; } + @SuppressWarnings("deprecation") private void raise() { if ((_height + 1) < _max) { _lastTick = System.currentTimeMillis(); Block b = _initial.getRelative(0, _height, 0); - b.setType(_type); + for (Player player : UtilServer.getPlayers()) + { + player.sendBlockChange(b.getLocation(), _type, (byte)0); + } _blocks.add(b); _height++; } @@ -49,13 +55,17 @@ public class GroundSpike } } + @SuppressWarnings("deprecation") private void lower() { _height = Math.min(_blocks.size() - 1, _height); if ((_height - 1) >= 0) { _lastTick = System.currentTimeMillis(); - _blocks.get(_height).setType(Material.AIR); + for (Player player : UtilServer.getPlayers()) + { + player.sendBlockChange(_blocks.get(_height).getLocation(), Material.AIR, (byte)0); + } _blocks.remove(_height); _height--; } @@ -73,12 +83,16 @@ public class GroundSpike return _finished; } + @SuppressWarnings("deprecation") public void finish() { _finished = true; for (Block block : _blocks) { - block.setType(Material.AIR); + for (Player player : UtilServer.getPlayers()) + { + player.sendBlockChange(block.getLocation(), Material.AIR, (byte)0); + } } _blocks.clear(); } diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/skeletonking/SkeletonCreature.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/skeletonking/SkeletonCreature.java index 885e1814a..45cae347e 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/skeletonking/SkeletonCreature.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/skeletonking/SkeletonCreature.java @@ -315,7 +315,14 @@ public class SkeletonCreature extends EventCreature for (BossAbility ability : _currentAbilities) { - ability.tick(); + try + { + ability.tick(); + } + catch (Exception e) + { + e.printStackTrace(); + } } boolean canMove = true;