From b84756ef7a1ba2ee9ae33cd4e998495328db2229 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 27 Mar 2015 22:13:50 +1300 Subject: [PATCH] Revert wizard commits --- .../mineplex/core/explosion/Explosion.java | 11 +-- .../game/core/explosion/CustomExplosion.java | 17 +--- .../game/games/wizards/SpellButton.java | 48 +++++----- .../game/games/wizards/SpellMenuPage.java | 10 +-- .../wizards/spells/SpellLightningStrike.java | 88 ++++++++----------- .../games/wizards/spells/SpellSpeedBoost.java | 16 ++-- .../wizards/spells/SpellSummonWolves.java | 9 +- 7 files changed, 76 insertions(+), 123 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/explosion/Explosion.java b/Plugins/Mineplex.Core/src/mineplex/core/explosion/Explosion.java index b53fccd66..f07adb266 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/explosion/Explosion.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/explosion/Explosion.java @@ -25,6 +25,7 @@ import org.bukkit.block.Block; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; @@ -302,11 +303,6 @@ public class Explosion extends MiniPlugin } public void BlockExplosion(Collection blockSet, Location mid, boolean onlyAbove) - { - BlockExplosion(blockSet, mid, onlyAbove, true); - } - - public void BlockExplosion(Collection blockSet, Location mid, boolean onlyAbove, boolean removeBlock) { if (blockSet.isEmpty()) return; @@ -324,10 +320,7 @@ public class Explosion extends MiniPlugin blocks.put(cur, new AbstractMap.SimpleEntry(cur.getTypeId(), cur.getData())); - if (removeBlock) - { - cur.setType(Material.AIR); - } + cur.setType(Material.AIR); } //DELAY diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java index 3465a1b65..181a230db 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java @@ -45,10 +45,8 @@ public class CustomExplosion extends Explosion private boolean _createFire; private boolean _ignoreRate = true; private float _blockExplosionSize; - private boolean _fallingBlockExplosion; - private mineplex.core.explosion.Explosion _explosion; - public CustomExplosion(DamageManager manager, mineplex.core.explosion.Explosion explosion, Location loc, float explosionSize, String deathCause) + public CustomExplosion(DamageManager manager, Location loc, float explosionSize, String deathCause) { super(((CraftWorld) loc.getWorld()).getHandle(), null, loc.getX(), loc.getY(), loc.getZ(), explosionSize); @@ -56,7 +54,6 @@ public class CustomExplosion extends Explosion _manager = manager; _damageReason = deathCause; _blockExplosionSize = explosionSize; - _explosion = explosion; } public CustomExplosion setBlockExplosionSize(float explosionSize) @@ -73,13 +70,6 @@ public class CustomExplosion extends Explosion return this; } - public CustomExplosion setFallingBlockExplosion(boolean fallingBlockExplosion) - { - _fallingBlockExplosion = fallingBlockExplosion; - - return this; - } - public CustomExplosion setDamageBlocks(boolean damageBlocks) { b = damageBlocks; @@ -292,11 +282,6 @@ public class CustomExplosion extends Explosion return; } - if (_fallingBlockExplosion) - { - _explosion.BlockExplosion(event.GetBlocks(), new Location(_world.getWorld(), posX, posY, posZ), false, false); - } - Iterator iterator = this.blocks.iterator(); while (iterator.hasNext()) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellButton.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellButton.java index e5a122a07..8069d6ddf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellButton.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellButton.java @@ -10,39 +10,31 @@ import org.bukkit.event.inventory.ClickType; public class SpellButton implements IButton { - private SpellType _spell; - private SpellMenuPage _spellPage; + private SpellType _spell; + private SpellMenuPage _spellPage; - public SpellButton(SpellMenuPage spellPage, SpellType spell) - { - _spell = spell; - _spellPage = spellPage; - } + public SpellButton(SpellMenuPage spellPage, SpellType spell) + { + _spell = spell; + _spellPage = spellPage; + } - @Override - public void onClick(Player player, ClickType clickType) - { - Wizard wizard = _spellPage.getWizards().getWizard(player); + @Override + public void onClick(Player player, ClickType clickType) + { + Wizard wizard = _spellPage.getWizards().getWizard(player); - if (wizard != null) - { - if (clickType.isLeftClick()) - { - wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell); + if (wizard != null) + { + wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell); - player.sendMessage(C.cBlue + "Set spell on wand to " + _spell.getElement().getColor() + _spell.getSpellName()); + player.sendMessage(C.cBlue + "Set spell on wand to " + _spell.getElement().getColor() + _spell.getSpellName()); - player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1); - } - else - { - _spellPage.getWizards().castSpell(player, wizard, _spell, null); - } + player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1); - _spellPage.getWizards().drawUtilTextBottom(player); - _spellPage.getWizards().changeWandsTitles(player); - player.closeInventory(); - } - } + _spellPage.getWizards().drawUtilTextBottom(player); + _spellPage.getWizards().changeWandsTitles(player); + } + } } \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java index 1f824827b..a623eb102 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java @@ -73,14 +73,10 @@ public class SpellMenuPage extends ShopPageBase list = p.getLastTwoTargetBlocks(UtilBlock.blockAirFoliageSet, 150); - if (list.size() > 1) - { - final Location loc = list.get(0).getLocation().add(0.5, 0, 0.5); + @Override + public void castSpell(Player p) + { + List list = p.getLastTwoTargetBlocks(UtilBlock.blockAirFoliageSet, 150); + if (list.size() > 1) + { + Location loc = list.get(0).getLocation(); - while (UtilBlock.solid(loc.getBlock().getRelative(BlockFace.UP))) - { - loc.add(0, 1, 0); - } + while (UtilBlock.solid(loc.getBlock().getRelative(BlockFace.UP))) + { + loc.add(0, 1, 0); + } - UtilParticle.PlayParticle(ParticleType.ANGRY_VILLAGER, loc.clone().add(0, 1.3, 0), 0.5F, 0.3F, 0.5F, 0, 7); + LightningStrike lightning = p.getWorld().strikeLightning(loc); - Bukkit.getScheduler().scheduleSyncDelayedTask(Wizards.getArcadeManager().getPlugin(), new Runnable() - { + lightning.setMetadata("Damager", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), p)); - @Override - public void run() - { - LightningStrike lightning = p.getWorld().strikeLightning(loc); + charge(p); + } + } - lightning.setMetadata("Damager", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), p)); - } + @EventHandler + public void onEntityDamage(EntityDamageByEntityEvent event) + { + if (event.getDamager() instanceof LightningStrike && event.getEntity() instanceof LivingEntity) + { + LightningStrike lightning = (LightningStrike) event.getDamager(); + if (lightning.hasMetadata("Damager")) + { + event.setCancelled(true); - }, 20); + if (!lightning.hasMetadata("IgnoreDamage")) + { + lightning.setMetadata("IgnoreDamage", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), null)); - charge(p); - } - } - - @EventHandler - public void onEntityDamage(EntityDamageByEntityEvent event) - { - if (event.getDamager() instanceof LightningStrike && event.getEntity() instanceof LivingEntity) - { - LightningStrike lightning = (LightningStrike) event.getDamager(); - if (lightning.hasMetadata("Damager")) - { - event.setCancelled(true); - - if (!lightning.hasMetadata("IgnoreDamage")) - { - lightning.setMetadata("IgnoreDamage", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), null)); - - Wizards.getArcadeManager() - .GetDamage() - .NewDamageEvent((LivingEntity) event.getEntity(), - (Player) lightning.getMetadata("Damager").get(0).value(), null, DamageCause.LIGHTNING, - event.getDamage(), false, true, false, "Lightning Strike", "Lightning Strike"); - } - } - } - } + Wizards.getArcadeManager() + .GetDamage() + .NewDamageEvent((LivingEntity) event.getEntity(), + (Player) lightning.getMetadata("Damager").get(0).value(), null, DamageCause.LIGHTNING, + event.getDamage(), false, true, false, "Lightning Strike", "Lightning Strike"); + } + } + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSpeedBoost.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSpeedBoost.java index af04c4a06..0892dfa4c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSpeedBoost.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSpeedBoost.java @@ -7,14 +7,14 @@ import org.bukkit.entity.Player; public class SpellSpeedBoost extends Spell implements SpellClick { - @Override - public void castSpell(Player p) - { - int ticks = 20 * 20; - int potionLevel = getSpellLevel(p); + @Override + public void castSpell(Player p) + { + int ticks = 30 * getSpellLevel(p) * 20; + int potionLevel = getSpellLevel(p); - Wizards.getArcadeManager().GetCondition().Factory().Speed("Speed Boost", p, p, ticks, potionLevel, false, false, false); + Wizards.getArcadeManager().GetCondition().Factory().Speed("Speed Boost", p, p, ticks, potionLevel, false, false, false); - charge(p); - } + charge(p); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java index 0e6a12300..00b9e58be 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java @@ -43,7 +43,7 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl Location loc = block.getLocation().add(0.5, 0, 0.5); - for (int i = 0; i < getSpellLevel(player); i++) + for (int i = 0; i < 2 + getSpellLevel(player); i++) { Wizards.CreatureAllowOverride = true; @@ -57,10 +57,11 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl wolf.setBreed(false); wolf.setCustomName(player.getDisplayName() + "'s Wolf"); wolf.setRemoveWhenFarAway(false); - wolf.setMaxHealth(0.5); - wolf.setHealth(0.5); + wolf.setMaxHealth(2); + wolf.setHealth(2); + // wolf.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 9001, 0)); - _summonedWolves.put(wolf, System.currentTimeMillis() + (30L * 1000L)); + this._summonedWolves.put(wolf, System.currentTimeMillis() + (30L * 1000L)); } UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, loc, 0.8F, 0, 0.8F, 0, 4);