Don't allow people to place blocks when respawning
This commit is contained in:
parent
ceb82b4d89
commit
33ee39fe01
@ -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()) + "."));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user