Added a new Configuration Flag called "DisableBuild".
This commit is contained in:
parent
881ddd5543
commit
2fe906744f
3 changed files with 11 additions and 0 deletions
|
|
@ -40,5 +40,6 @@ namespace TShockAPI
|
||||||
public int MaxSlots = 8;
|
public int MaxSlots = 8;
|
||||||
public bool RangeChecks = true;
|
public bool RangeChecks = true;
|
||||||
public bool SpamChecks = false;
|
public bool SpamChecks = false;
|
||||||
|
public bool DisableBuild = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -49,6 +49,7 @@ namespace TShockAPI
|
||||||
public static int authToken;
|
public static int authToken;
|
||||||
public static int maxSlots = 8;
|
public static int maxSlots = 8;
|
||||||
public static bool spamChecks = false;
|
public static bool spamChecks = false;
|
||||||
|
public static bool disableBuild = false;
|
||||||
|
|
||||||
public enum NPCList
|
public enum NPCList
|
||||||
{
|
{
|
||||||
|
|
@ -84,6 +85,7 @@ namespace TShockAPI
|
||||||
maxSlots = cfg.MaxSlots;
|
maxSlots = cfg.MaxSlots;
|
||||||
rangeChecks = cfg.RangeChecks;
|
rangeChecks = cfg.RangeChecks;
|
||||||
spamChecks = cfg.SpamChecks;
|
spamChecks = cfg.SpamChecks;
|
||||||
|
disableBuild = cfg.DisableBuild;
|
||||||
NPC.maxSpawns = defaultMaxSpawns;
|
NPC.maxSpawns = defaultMaxSpawns;
|
||||||
NPC.defaultSpawnRate = defaultSpawnRate;
|
NPC.defaultSpawnRate = defaultSpawnRate;
|
||||||
}
|
}
|
||||||
|
|
@ -120,6 +122,7 @@ namespace TShockAPI
|
||||||
cfg.MaxSlots = maxSlots;
|
cfg.MaxSlots = maxSlots;
|
||||||
cfg.RangeChecks = rangeChecks;
|
cfg.RangeChecks = rangeChecks;
|
||||||
cfg.SpamChecks = spamChecks;
|
cfg.SpamChecks = spamChecks;
|
||||||
|
cfg.DisableBuild = disableBuild;
|
||||||
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
|
||||||
TextWriter tr = new StreamWriter(FileTools.SaveDir + "config.json");
|
TextWriter tr = new StreamWriter(FileTools.SaveDir + "config.json");
|
||||||
tr.Write(json);
|
tr.Write(json);
|
||||||
|
|
|
||||||
|
|
@ -336,6 +336,13 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
if (type == 0 || type == 1)
|
if (type == 0 || type == 1)
|
||||||
{
|
{
|
||||||
|
if (ConfigurationManager.disableBuild)
|
||||||
|
{
|
||||||
|
if (!players[e.Msg.whoAmI].group.HasPermission("editspawn"))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (ConfigurationManager.spawnProtect)
|
if (ConfigurationManager.spawnProtect)
|
||||||
{
|
{
|
||||||
if (!players[e.Msg.whoAmI].group.HasPermission("editspawn"))
|
if (!players[e.Msg.whoAmI].group.HasPermission("editspawn"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue