diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6382cc88..01735e16 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -18,7 +18,7 @@ Note: This includes the API by default. If you need only the API, you need to cd
- Run ```msbuild TShock.sln``` in the root of the cloned folder on Windows in a 'Developer Command Prompt' OR
- Run ```xbuild TShock.sln``` in the root of the cloned folder on Unix.
-Need help? Drop by Slack and we'll be happy to explain it with more words, step by step.
+Need help? Drop by Discord and we'll be happy to explain it with more words, step by step.
### TShock Additions
@@ -26,7 +26,7 @@ If something is better suited to be a plugin for TShock, rather than a TShock co
_If you are confused, make a suggestion. We will determine scope and relevance for you._
-_If a person makes a suggestion in Slack, capture the suggestion as a Github issue. If a suggestion crops up on the forums, make a Github issue to capture it. If you want, direct the user to make a suggestion on Github, but set an alarm/timer/reminder so that if they don't know how to use Github or they don't have an account, an issue is still made and discussed. Make it clear that the issue is a surrogate issue for a suggestion from Slack/the forums too._
+_If a person makes a suggestion in Discord, capture the suggestion as a Github issue. If a suggestion crops up on the forums, make a Github issue to capture it. If you want, direct the user to make a suggestion on Github, but set an alarm/timer/reminder so that if they don't know how to use Github or they don't have an account, an issue is still made and discussed. Make it clear that the issue is a surrogate issue for a suggestion from Discord/the forums too._
### Pull Request Dev Guidelines
diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 0d1c2bc7..42cd9ef1 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -349,6 +349,7 @@ namespace TShockAPI
ServerApi.Hooks.WorldHalloweenCheck.Register(this, OnHalloweenCheck);
ServerApi.Hooks.NetNameCollision.Register(this, NetHooks_NameCollision);
ServerApi.Hooks.ItemForceIntoChest.Register(this, OnItemForceIntoChest);
+ ServerApi.Hooks.WorldGrassSpread.Register(this, OnWorldGrassSpread);
Hooks.PlayerHooks.PlayerPreLogin += OnPlayerPreLogin;
Hooks.PlayerHooks.PlayerPostLogin += OnPlayerLogin;
Hooks.AccountHooks.AccountDelete += OnAccountDelete;
@@ -419,6 +420,7 @@ namespace TShockAPI
ServerApi.Hooks.WorldHalloweenCheck.Deregister(this, OnHalloweenCheck);
ServerApi.Hooks.NetNameCollision.Deregister(this, NetHooks_NameCollision);
ServerApi.Hooks.ItemForceIntoChest.Deregister(this, OnItemForceIntoChest);
+ ServerApi.Hooks.WorldGrassSpread.Deregister(this, OnWorldGrassSpread);
TShockAPI.Hooks.PlayerHooks.PlayerPostLogin -= OnPlayerLogin;
if (File.Exists(Path.Combine(SavePath, "tshock.pid")))
@@ -1208,24 +1210,50 @@ namespace TShockAPI
if (args.Handled)
return;
- if (!Config.AllowCrimsonCreep && (args.Type == TileID.Dirt || args.Type == TileID.FleshWeeds
- || TileID.Sets.Crimson[args.Type]))
+ if (!OnCreep(args.Type))
{
args.Handled = true;
+ }
+ }
+
+ /// OnWorldGrassSpread - Fired when grass is attempting to spread.
+ /// args - The GrassSpreadEventArgs object.
+ private void OnWorldGrassSpread(GrassSpreadEventArgs args)
+ {
+ if (args.Handled)
return;
+
+ if(!OnCreep(args.Grass))
+ {
+ args.Handled = true;
+ }
+ }
+
+ ///
+ /// Checks if the tile type is allowed to creep
+ ///
+ /// Tile id
+ /// True if allowed, otherwise false
+ private bool OnCreep(int tileType)
+ {
+ if (!Config.AllowCrimsonCreep && (tileType == TileID.Dirt || tileType == TileID.FleshWeeds
+ || TileID.Sets.Crimson[tileType]))
+ {
+ return false;
}
- if (!Config.AllowCorruptionCreep && (args.Type == TileID.Dirt || args.Type == TileID.CorruptThorns
- || TileID.Sets.Corrupt[args.Type]))
+ if (!Config.AllowCorruptionCreep && (tileType == TileID.Dirt || tileType == TileID.CorruptThorns
+ || TileID.Sets.Corrupt[tileType]))
{
- args.Handled = true;
- return;
+ return false;
}
- if (!Config.AllowHallowCreep && (TileID.Sets.Hallow[args.Type]))
+ if (!Config.AllowHallowCreep && (TileID.Sets.Hallow[tileType]))
{
- args.Handled = true;
+ return false;
}
+
+ return true;
}
/// OnStatueSpawn - Fired when a statue spawns.
diff --git a/TerrariaServerAPI b/TerrariaServerAPI
index a9d1b0e4..d3b7d9f4 160000
--- a/TerrariaServerAPI
+++ b/TerrariaServerAPI
@@ -1 +1 @@
-Subproject commit a9d1b0e4e096ecbd0b2033ce4ff636759c9448c3
+Subproject commit d3b7d9f4575602f468cf1e009ebc4bc5b79547c4