public static void Load()
{
//Get ready to update to new Commands when TShock releases the next version
TShockAPI.Commands.ChatCommands.Add(new Command("protectchest", Set, "cset", "setchest"));
TShockAPI.Commands.ChatCommands.Add(new Command("protectchest", UnSet, "cunset", "unsetchest"));
TShockAPI.Commands.ChatCommands.Add(new Command("protectchest", CancelSet, "ccset", "ccunset", "cancelsetchest", "cancelunsetchest"));
TShockAPI.Commands.ChatCommands.Add(new Command("protectchest", SetRegionChest, "crset", "rchest", "regionsharechest"));
TShockAPI.Commands.ChatCommands.Add(new Command("protectchest", SetPublicChest, "cpset", "pchest", "setpublicchest"));
TShockAPI.Commands.ChatCommands.Add(new Command("protectchest", SetPasswordChest, "clock", "lockchest", "chestlock") {DoLog = false});
TShockAPI.Commands.ChatCommands.Add(new Command("refillchest", SetRefillChest, "crefill", "refillchest", "chestrefill"));
//everyone can unlock
TShockAPI.Commands.ChatCommands.Add(new Command(UnLockChest, "cunlock", "unlockchest", "chestunlock") {DoLog = false});
//add permissions to db if not exists
bool perm = TShock.Groups.groups.Where(@group => @group.Name != "superadmin").Any(@group => group.HasPermission("protectchest"));
if (!perm)
{
var permissions = new List<string>
{
"protectchest",
"openallchests",
"removechestprotection",
"showchestinfo",
"refillchest"
};
TShock.Groups.AddPermissions("trustedadmin", permissions);
}
}