Don't allow people to place blocks when respawning

This commit is contained in:
Sam 2017-11-10 00:26:02 +00:00 committed by Alexander Meech
parent ceb82b4d89
commit 33ee39fe01

View File

@ -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()) + "."));
}
}