diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 6f66607e..f835105d 100755 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -276,6 +276,8 @@ namespace TShockAPI [Description("Forces your world to be in Halloween mode regardless of the data.")] public bool ForceHalloween = false; + [Description("Allows anyone to break grass, pots, etc.")] public bool AllowCutTilesAndBreakables = false; + /// /// Reads a configuration file from a given path /// diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 1008824b..c62ef3ba 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1948,6 +1948,11 @@ namespace TShockAPI } } + if (TShock.Config.AllowCutTilesAndBreakables && (Main.tileCut[Main.tile[tileX, tileY].type] || breakableTiles.Contains(Main.tile[tileX, tileY].type))) + { + return false; + } + if (TShock.CheckIgnores(args.Player)) { args.Player.SendTileSquare(tileX, tileY, 4);