Fixed 1.8 chests not being blocked and future-proofed some other things.

This commit is contained in:
Wizjany 2011-09-21 15:29:45 -04:00
parent a1427e7743
commit b884787377

View File

@ -460,6 +460,8 @@ private void handleBlockLeftClick(PlayerInteractEvent event) {
new BlockBreakBlacklistEvent(plugin.wrapPlayer(player),
toVector(event.getClickedBlock()),
event.getClickedBlock().getTypeId()), false, false)) {
event.setUseInteractedBlock(Result.DENY);
event.setUseItemInHand(Result.DENY);
event.setCancelled(true);
return;
}
@ -590,6 +592,7 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
&& !set.allows(DefaultFlag.CHEST_ACCESS)
&& !set.canBuild(localPlayer)) {
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to open that in this area.");
event.setUseInteractedBlock(Result.DENY);
event.setCancelled(true);
return;
}
@ -630,6 +633,7 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
&& !set.canBuild(localPlayer)
&& !set.allows(DefaultFlag.PLACE_VEHICLE)) {
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to place vehicles here.");
event.setUseItemInHand(Result.DENY);
event.setCancelled(true);
return;
}
@ -640,6 +644,7 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
&& !set.canBuild(localPlayer)
&& !set.allows(DefaultFlag.PLACE_VEHICLE)) {
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to place vehicles here.");
event.setUseItemInHand(Result.DENY);
event.setCancelled(true);
return;
}
@ -677,6 +682,7 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
if (wcfg.isChestProtected(block, player)) {
player.sendMessage(ChatColor.DARK_RED + "The chest is protected.");
event.setUseInteractedBlock(Result.DENY);
event.setCancelled(true);
return;
}