Adds banned items. Delete groups.txt and run server once.

This commit is contained in:
Twitchy 2011-06-22 19:51:10 +12:00
parent 2807bb70ab
commit d2c1082c59
9 changed files with 119 additions and 23 deletions

View file

@ -105,6 +105,8 @@ namespace TShockAPI
WarpsManager.ReadAllSettings();
ItemManager.LoadBans();
Backups.KeepFor = ConfigurationManager.BackupKeepFor;
Backups.Interval = ConfigurationManager.BackupInterval;
@ -211,6 +213,18 @@ namespace TShockAPI
player.TileThreshold = 0;
player.TilesDestroyed.Clear();
}
if (!player.Group.HasPermission("usebanneditem"))
{
for (int i = 0; i < Main.player[player.Index].inventory.Length; i++)
{
if (ItemManager.ItemIsBanned(Main.player[player.Index].inventory[i].name))
{
player.Disconnect("Using banned item: " + Main.player[player.Index].inventory[i].name);
break;
}
}
}
}
}
}