Add AllowCrimsonCreep config option

This commit is contained in:
MarioE 2013-11-10 15:55:09 -05:00
parent e5d01b19d6
commit 6a4e7584a0
3 changed files with 37 additions and 28 deletions

View file

@ -223,7 +223,10 @@ namespace TShockAPI
[Description("Allow ice placement even when user does not have canbuild.")] public bool AllowIce = false;
[Description("Allows corrutption to spread when a world is hardmode.")] public bool AllowCorruptionCreep = true;
[Description("Allows crimson to spread when a world is hardmode.")]
public bool AllowCrimsonCreep = true;
[Description("Allows corruption to spread when a world is hardmode.")] public bool AllowCorruptionCreep = true;
[Description("Allows hallow to spread when a world is hardmode.")] public bool AllowHallowCreep = true;

View file

@ -840,35 +840,41 @@ namespace TShockAPI
Config.MaxSlots, Netplay.serverListenIP, Netplay.serverPort, Version);
}
private void OnHardUpdate(HardmodeTileUpdateEventArgs args)
{
if (args.Handled)
return;
private void OnHardUpdate(HardmodeTileUpdateEventArgs args)
{
if (args.Handled)
return;
if (!Config.AllowCorruptionCreep && ( args.Type == 23 || args.Type == 25 || args.Type == 0 ||
args.Type == 112 || args.Type == 23 || args.Type == 32 ) )
{
args.Handled = true;
return;
}
if (!Config.AllowCrimsonCreep && (args.Type == 0 || args.Type == 199 || args.Type == 203 || args.Type == 234))
{
args.Handled = true;
return;
}
if (!Config.AllowHallowCreep && (args.Type == 109 || args.Type == 117 || args.Type == 116 ) )
{
args.Handled = true;
}
}
if (!Config.AllowCorruptionCreep && (args.Type == 23 || args.Type == 25 || args.Type == 0 ||
args.Type == 112 || args.Type == 32))
{
args.Handled = true;
return;
}
private void OnStatueSpawn( StatueSpawnEventArgs args )
{
if( args.Within200 < Config.StatueSpawn200 && args.Within600 < Config.StatueSpawn600 && args.WorldWide < Config.StatueSpawnWorld )
{
args.Handled = true;
}
else
{
args.Handled = false;
}
}
if (!Config.AllowHallowCreep && (args.Type == 109 || args.Type == 117 || args.Type == 116))
{
args.Handled = true;
}
}
private void OnStatueSpawn(StatueSpawnEventArgs args)
{
if (args.Within200 < Config.StatueSpawn200 && args.Within600 < Config.StatueSpawn600 && args.WorldWide < Config.StatueSpawnWorld)
{
args.Handled = true;
}
else
{
args.Handled = false;
}
}
private void OnConnect(ConnectEventArgs args)
{

@ -1 +1 @@
Subproject commit 92aeb65461a164c5a715dd72e8fc7a6e3dfbb24b
Subproject commit 886d5eeb3342d8436f5819d731ae0c8b947955de