Allow breaking/placing blocks when in creative
This commit is contained in:
parent
7a66a8dad9
commit
14f5cb4704
@ -506,7 +506,7 @@ public class ClansGame extends MiniPlugin
|
||||
//Block Placement
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK)
|
||||
if (player.getItemInHand().getType() != Material.AIR)
|
||||
if (Clans.getClanBlocks().denyUsePlace(player.getItemInHand().getTypeId()))
|
||||
if (player.getGameMode() != GameMode.CREATIVE && Clans.getClanBlocks().denyUsePlace(player.getItemInHand().getTypeId()))
|
||||
{
|
||||
//Disallow
|
||||
event.setCancelled(true);
|
||||
|
@ -3,6 +3,7 @@ package mineplex.game.clans.spawn;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -157,11 +158,11 @@ public class Spawn extends MiniPlugin
|
||||
@EventHandler
|
||||
public void onBlockBreak(BlockBreakEvent event)
|
||||
{
|
||||
if (isInSpawn(event.getBlock().getLocation()))
|
||||
if (isInSpawn(event.getBlock().getLocation()) && event.getPlayer().getGameMode() != GameMode.CREATIVE)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
else if (isInSpawn(event.getPlayer()))
|
||||
else if (isInSpawn(event.getPlayer()) && event.getPlayer().getGameMode() != GameMode.CREATIVE)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user