Adds banned items. Delete groups.txt and run server once.
This commit is contained in:
parent
2807bb70ab
commit
d2c1082c59
9 changed files with 119 additions and 23 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue