From 33ee39fe019ecac538159e58d911dd405cee3c82 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 10 Nov 2017 00:26:02 +0000 Subject: [PATCH] Don't allow people to place blocks when respawning --- .../game/games/cakewars/general/CakePlayerModule.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 0da39b6d0..1e5cb9a58 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 @@ -131,10 +131,16 @@ public class CakePlayerModule extends CakeModule @EventHandler public void blockPlacePrevent(BlockPlaceEvent event) { - if (event.getItemInHand().getType() == RUNE_OF_HOLDING.getType()) + Player player = event.getPlayer(); + + if (UtilPlayer.isSpectator(player)) { event.setCancelled(true); - event.getPlayer().sendMessage(F.main("Game", "You cannot place a " + F.name(RUNE_OF_HOLDING.getItemMeta().getDisplayName()) + ".")); + } + else if (event.getItemInHand().getType() == RUNE_OF_HOLDING.getType()) + { + event.setCancelled(true); + player.sendMessage(F.main("Game", "You cannot place a " + F.name(RUNE_OF_HOLDING.getItemMeta().getDisplayName()) + ".")); } }