mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 01:27:40 +01:00
[trunk] add setting warn-on-build-disallow to protect. setting this will give users with build:false a warning
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1189 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
7e93ef0bd0
commit
2b1164f021
@ -438,6 +438,11 @@ public class Settings implements IConf
|
|||||||
|
|
||||||
public Boolean spawnIfNoHome()
|
public Boolean spawnIfNoHome()
|
||||||
{
|
{
|
||||||
return config.getBoolean("spawn-if-no-home", true);
|
return config.getBoolean("spawn-if-no-home", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean warnOnBuildDisallow()
|
||||||
|
{
|
||||||
|
return config.getBoolean("warn-on-build-disallow", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,6 +378,9 @@ protect:
|
|||||||
# Set true to disable building for those people
|
# Set true to disable building for those people
|
||||||
build: true
|
build: true
|
||||||
|
|
||||||
|
#Should we tell people they are not allowed to build
|
||||||
|
warn-on-build-disallow: false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,8 +2,7 @@ package com.earth2me.essentials.protect;
|
|||||||
|
|
||||||
import com.earth2me.essentials.Essentials;
|
import com.earth2me.essentials.Essentials;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import java.util.logging.Level;
|
import org.bukkit.ChatColor;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
@ -46,6 +45,10 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||||||
|
|
||||||
if (EssentialsProtect.playerSettings.get("protect.disable.build") && !user.canBuild())
|
if (EssentialsProtect.playerSettings.get("protect.disable.build") && !user.canBuild())
|
||||||
{
|
{
|
||||||
|
if(Essentials.getSettings().warnOnBuildDisallow())
|
||||||
|
{
|
||||||
|
user.sendMessage(ChatColor.RED + "You are not permitted to build");
|
||||||
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,10 @@ public class EssentialsProtectPlayerListener extends PlayerListener
|
|||||||
|
|
||||||
if (EssentialsProtect.playerSettings.get("protect.disable.build") && !user.canBuild())
|
if (EssentialsProtect.playerSettings.get("protect.disable.build") && !user.canBuild())
|
||||||
{
|
{
|
||||||
|
if(Essentials.getSettings().warnOnBuildDisallow())
|
||||||
|
{
|
||||||
|
user.sendMessage(ChatColor.RED + "You are not permitted to build");
|
||||||
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user