mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 11:36:11 +01:00
Add denial messages to region protection. Changed use-protected-regions to use-regions and turned it on by default.
This commit is contained in:
parent
2e225a9452
commit
953d1f0aed
@ -175,7 +175,7 @@ public void loadConfiguration() {
|
|||||||
recentLogins.clear();
|
recentLogins.clear();
|
||||||
|
|
||||||
// Load basic options
|
// Load basic options
|
||||||
useRegions = properties.getBoolean("use-protected-regions", false);
|
useRegions = properties.getBoolean("use-regions", true);
|
||||||
enforceOneSession = properties.getBoolean("enforce-single-session", true);
|
enforceOneSession = properties.getBoolean("enforce-single-session", true);
|
||||||
blockCreepers = properties.getBoolean("block-creepers", false);
|
blockCreepers = properties.getBoolean("block-creepers", false);
|
||||||
blockTNT = properties.getBoolean("block-tnt", false);
|
blockTNT = properties.getBoolean("block-tnt", false);
|
||||||
@ -710,6 +710,7 @@ public boolean onItemUse(Player player, Block blockPlaced,
|
|||||||
LocalPlayer localPlayer = new HMPlayer(player);
|
LocalPlayer localPlayer = new HMPlayer(player);
|
||||||
|
|
||||||
if (!regionManager.getApplicableRegions(pt).canBuild(localPlayer)) {
|
if (!regionManager.getApplicableRegions(pt).canBuild(localPlayer)) {
|
||||||
|
player.sendMessage(Colors.Red + "You don't have permission for this area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -738,6 +739,7 @@ public boolean onBlockPlace(Player player, Block blockPlaced,
|
|||||||
LocalPlayer localPlayer = new HMPlayer(player);
|
LocalPlayer localPlayer = new HMPlayer(player);
|
||||||
|
|
||||||
if (!regionManager.getApplicableRegions(pt).canBuild(localPlayer)) {
|
if (!regionManager.getApplicableRegions(pt).canBuild(localPlayer)) {
|
||||||
|
player.sendMessage(Colors.Red + "You don't have permission for this area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -811,6 +813,7 @@ public boolean onBlockBreak(Player player, Block block) {
|
|||||||
LocalPlayer localPlayer = new HMPlayer(player);
|
LocalPlayer localPlayer = new HMPlayer(player);
|
||||||
|
|
||||||
if (!regionManager.getApplicableRegions(pt).canBuild(localPlayer)) {
|
if (!regionManager.getApplicableRegions(pt).canBuild(localPlayer)) {
|
||||||
|
player.sendMessage(Colors.Red + "You don't have permission for this area.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -840,6 +843,19 @@ public boolean onOpenInventory(Player player, Inventory inventory) {
|
|||||||
return true;
|
return true;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
if (useRegions && (inventory instanceof Chest
|
||||||
|
|| inventory instanceof DoubleChest
|
||||||
|
|| inventory instanceof Furnace)) {
|
||||||
|
ComplexBlock chest = (ComplexBlock)inventory;
|
||||||
|
Vector pt = new Vector(chest.getX(), chest.getY(), chest.getZ());
|
||||||
|
LocalPlayer localPlayer = new HMPlayer(player);
|
||||||
|
|
||||||
|
if (!regionManager.getApplicableRegions(pt).canBuild(localPlayer)) {
|
||||||
|
player.sendMessage(Colors.Red + "You don't have permission for this area.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user