Made sleep flag proactive enough to keep them from blowing the nether up.

This commit is contained in:
Wizjany 2011-08-16 19:21:54 -04:00
parent e2fc6a3ff0
commit 7b12510182

View File

@ -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