mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-30 22:44:07 +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),
|
new BlockBreakBlacklistEvent(plugin.wrapPlayer(player),
|
||||||
toVector(event.getClickedBlock()),
|
toVector(event.getClickedBlock()),
|
||||||
event.getClickedBlock().getTypeId()), false, false)) {
|
event.getClickedBlock().getTypeId()), false, false)) {
|
||||||
|
event.setUseInteractedBlock(Result.DENY);
|
||||||
|
event.setUseItemInHand(Result.DENY);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -590,6 +592,7 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
|
|||||||
&& !set.allows(DefaultFlag.CHEST_ACCESS)
|
&& !set.allows(DefaultFlag.CHEST_ACCESS)
|
||||||
&& !set.canBuild(localPlayer)) {
|
&& !set.canBuild(localPlayer)) {
|
||||||
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to open that in this area.");
|
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to open that in this area.");
|
||||||
|
event.setUseInteractedBlock(Result.DENY);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -630,6 +633,7 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
|
|||||||
&& !set.canBuild(localPlayer)
|
&& !set.canBuild(localPlayer)
|
||||||
&& !set.allows(DefaultFlag.PLACE_VEHICLE)) {
|
&& !set.allows(DefaultFlag.PLACE_VEHICLE)) {
|
||||||
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to place vehicles here.");
|
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to place vehicles here.");
|
||||||
|
event.setUseItemInHand(Result.DENY);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -640,6 +644,7 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
|
|||||||
&& !set.canBuild(localPlayer)
|
&& !set.canBuild(localPlayer)
|
||||||
&& !set.allows(DefaultFlag.PLACE_VEHICLE)) {
|
&& !set.allows(DefaultFlag.PLACE_VEHICLE)) {
|
||||||
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to place vehicles here.");
|
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to place vehicles here.");
|
||||||
|
event.setUseItemInHand(Result.DENY);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -677,6 +682,7 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
|
|||||||
|
|
||||||
if (wcfg.isChestProtected(block, player)) {
|
if (wcfg.isChestProtected(block, player)) {
|
||||||
player.sendMessage(ChatColor.DARK_RED + "The chest is protected.");
|
player.sendMessage(ChatColor.DARK_RED + "The chest is protected.");
|
||||||
|
event.setUseInteractedBlock(Result.DENY);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user