From fa59ed52b98bcfdaa5b1f7d588a01417f8410a52 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 11 Jan 2015 09:49:46 +1300 Subject: [PATCH] Fixed arrow count not updating on shoot cancel Spectators are now permitted to walk on enemy turf --- .../game/arcade/game/games/turfforts/TurfForts.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java index 1e22d7524..f817a328a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java @@ -13,6 +13,7 @@ import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -24,9 +25,9 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.ProjectileHitEvent; + import net.minecraft.server.v1_7_R4.EntityArrow; import net.minecraft.server.v1_7_R4.Item; - import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.MapUtil; @@ -275,6 +276,8 @@ public class TurfForts extends TeamGame { UtilPlayer.message(event.getEntity(), F.main("Game", "You cannot attack during Build Time!")); event.setCancelled(true); + + ((Player) event.getEntity()).updateInventory(); } } @@ -599,6 +602,9 @@ public class TurfForts extends TeamGame { for (Player player : team.GetPlayers(true)) { + if (((CraftPlayer) player).getHandle().spectating) + continue; + Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN); while (block.getTypeId() != 159 && block.getY() > 0) block = block.getRelative(BlockFace.DOWN);