From 7b1251018216c8aac0a62828fb5723f4c80c53d0 Mon Sep 17 00:00:00 2001 From: Wizjany Date: Tue, 16 Aug 2011 19:21:54 -0400 Subject: [PATCH] Made sleep flag proactive enough to keep them from blowing the nether up. --- .../worldguard/bukkit/WorldGuardPlayerListener.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java index 7bb52566..294438dd 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java @@ -548,6 +548,16 @@ private void handleBlockRightClick(PlayerInteractEvent event) { } } + if (type == Material.BED_BLOCK) { + if (!plugin.getGlobalRegionManager().hasBypass(player, world) + && !set.allows(DefaultFlag.SLEEP)) { + player.sendMessage(ChatColor.DARK_RED + "You're not allowed to use that bed."); + event.setUseInteractedBlock(Result.DENY); + event.setCancelled(true); + return; + } + } + if (type == Material.CHEST || type == Material.JUKEBOX //stores the (arguably) most valuable item || type == Material.DISPENSER