mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-08 11:59:43 +01:00
Fixed 1.8 chests not being blocked and future-proofed some other things.
This commit is contained in:
parent
a1427e7743
commit
b884787377
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user