diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 9bcd30f6..428f1d8e 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -181,6 +181,9 @@ namespace TShockAPI [Description("This will save the world if Terraria crashes from an unhandled exception.")] public bool SaveWorldOnCrash = true; + [Description("This is kick players who have custom items in their inventory (via a mod)")] + public bool KickCustomItems = false; + public static ConfigFile Read(string path) { if (!File.Exists(path)) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 63681896..d487bbfa 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -156,6 +156,9 @@ namespace TShockAPI if (itemname == "KANNIBALE BLADE" || itemname == "Super Gel") return Tools.HandleCheater(args.Player, string.Format(TShock.Config.GriefClientReason, "KANNIBALE")); + if (Tools.GetItemByName(itemname).Count == 0 && !args.Player.Group.HasPermission(Permissions.ignorecheatdetection) + && TShock.Config.KickCustomItems) + args.Player.Disconnect("Using custom item: " + itemname + ", remove it and region"); } return false;