From 9caf91d42927b2b8c4fc1285cb7e1dd2e54271ca Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 17 Sep 2018 01:05:23 +0100 Subject: [PATCH] Make some changes to Nano Wizards --- .../components/currency/GameCurrencyManager.java | 2 +- .../game/nano/game/games/wizards/Wizards.java | 15 +++++++++++++-- .../game/games/wizards/spells/SpellFireball.java | 2 +- .../nano/game/games/wizards/spells/SpellTNT.java | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/currency/GameCurrencyManager.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/currency/GameCurrencyManager.java index b95bc2309..47db090e6 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/currency/GameCurrencyManager.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/components/currency/GameCurrencyManager.java @@ -140,7 +140,7 @@ public class GameCurrencyManager extends GameManager implements CurrencyComponen { GameSessionData data = _sessionData.get(player); - if (data == null || data.Games == 0 || !_manager.getServerGroup().getRewardGems()) + if (data == null || data.Games == 0) { return; } diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/Wizards.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/Wizards.java index f108f7eeb..8ef3de75e 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/Wizards.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/Wizards.java @@ -21,6 +21,7 @@ import com.mineplex.anticheat.checks.move.Speed; import mineplex.core.common.util.C; import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; @@ -185,9 +186,19 @@ public class Wizards extends ScoredSoloGame UtilParticle.PlayParticleToAll(ParticleType.HUGE_EXPLOSION, location, null, 0.1F, 1, ViewDist.LONG); location.getWorld().playSound(location, Sound.EXPLODE, 1, 0.7F); - for (Block block : UtilBlock.getBlocksInRadius(location, radius)) + blockLoop: for (Block block : UtilBlock.getBlocksInRadius(location, radius)) { - MapUtil.QuickChangeBlockAt(block.getLocation(), Material.AIR); + Location blockLocation = block.getLocation(); + + for (Location spawn : _playersTeam.getSpawns()) + { + if (UtilMath.offset2dSquared(spawn, blockLocation) < 9) + { + continue blockLoop; + } + } + + MapUtil.QuickChangeBlockAt(blockLocation, Material.AIR); } UtilPlayer.getInRadius(location, radius + 2).forEach((player, scale) -> _manager.getDamageManager().NewDamageEvent(player, source, null, DamageCause.CUSTOM, damage, true, true, false, source.getName(), reason)); diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/spells/SpellFireball.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/spells/SpellFireball.java index a8abec286..cebc300cd 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/spells/SpellFireball.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/spells/SpellFireball.java @@ -42,6 +42,6 @@ public class SpellFireball extends Spell Player damager = (Player) ((Fireball) event.getEntity()).getShooter(); - _game.createExplosion(damager, getName(), event.getEntity().getLocation(), 3, 14); + _game.createExplosion(damager, getName(), event.getEntity().getLocation(), 2, 14); } } diff --git a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/spells/SpellTNT.java b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/spells/SpellTNT.java index 5aeebc660..4e1a062bd 100644 --- a/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/spells/SpellTNT.java +++ b/Plugins/Mineplex.Game.Nano/src/mineplex/game/nano/game/games/wizards/spells/SpellTNT.java @@ -51,6 +51,6 @@ public class SpellTNT extends Spell } event.setCancelled(true); - _game.createExplosion(damager, getName(), event.getEntity().getLocation(), 5, 25); + _game.createExplosion(damager, getName(), event.getEntity().getLocation(), 4, 25); } }