From 8a77f53314bf5a0002a5da46b8e113a0096b9cc3 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 20 Jan 2018 13:37:13 +0000 Subject: [PATCH] Fixed a couple of bugs --- .../arcade/game/games/cakewars/general/CakeBatModule.java | 2 +- .../game/games/cakewars/general/CakePlayerModule.java | 3 ++- .../arcade/game/games/cakewars/shop/CakeShopModule.java | 2 +- .../arcade/game/games/cakewars/team/CakeTeamModule.java | 7 +++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakeBatModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakeBatModule.java index 3ea556f4e..e276db528 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakeBatModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakeBatModule.java @@ -125,7 +125,7 @@ public class CakeBatModule extends CakeModule _game.CreatureAllowOverride = true; - Bat bat = location.getWorld().spawn(location.add(0, 1.2, 0), Bat.class); + Bat bat = location.getWorld().spawn(location.add(Math.random() - 0.5, 1.2, Math.random() - 0.5), Bat.class); bat.setAwake(true); _bats.add(bat); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakePlayerModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakePlayerModule.java index 98b9764e1..1ba201d84 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakePlayerModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/general/CakePlayerModule.java @@ -14,6 +14,7 @@ import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.PlayerDeathEvent; @@ -352,7 +353,7 @@ public class CakePlayerModule extends CakeModule } } } - else if (itemStack.getType() == INSTA_WALL.getType()) + else if (itemStack.getType() == INSTA_WALL.getType() && event.getAction() == Action.RIGHT_CLICK_BLOCK) { event.setCancelled(true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/shop/CakeShopModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/shop/CakeShopModule.java index db28fb9f2..df03346c8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/shop/CakeShopModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/shop/CakeShopModule.java @@ -286,7 +286,7 @@ public class CakeShopModule extends CakeModule cakeTeam.getUpgrades().forEach((item, level) -> { - if (_game.getCakeTeamModule().hasCakeRot() && item == CakeTeamItem.REGENERATION)) + if (_game.getCakeTeamModule().hasCakeRot() && item == CakeTeamItem.REGENERATION) { return; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/team/CakeTeamModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/team/CakeTeamModule.java index f48377cb0..264c57fd8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/team/CakeTeamModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/team/CakeTeamModule.java @@ -315,6 +315,11 @@ public class CakeTeamModule extends CakeModule _teams.forEach((team, cakeTeam) -> { + if (!cakeTeam.canRespawn()) + { + return; + } + module.getOwnedItems(team).removeIf(item -> { if (!(item instanceof CakeTrapItem)) @@ -570,6 +575,8 @@ public class CakeTeamModule extends CakeModule { MapUtil.QuickChangeBlockAt(cakeTeam.getCake(), Material.AIR); } + + cakeTeam.getCakeHologram().stop(); }); _game.getModule(CompassModule.class)