Add hooks for item/projectile/tile bans
This commit is contained in:
parent
c841a86cdf
commit
81cb1381b4
4 changed files with 30 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using System.Linq;
|
||||
using MySql.Data.MySqlClient;
|
||||
using TShockAPI.Hooks;
|
||||
|
||||
namespace TShockAPI.DB
|
||||
{
|
||||
|
|
@ -200,6 +201,9 @@ namespace TShockAPI.DB
|
|||
if (ply.HasPermission(Permissions.usebanneditem))
|
||||
return true;
|
||||
|
||||
if (PlayerHooks.OnPlayerItembanPermission(ply, this))
|
||||
return true;
|
||||
|
||||
var cur = ply.Group;
|
||||
var traversed = new List<Group>();
|
||||
while (cur != null)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using System.Linq;
|
||||
using MySql.Data.MySqlClient;
|
||||
using TShockAPI.Hooks;
|
||||
|
||||
namespace TShockAPI.DB
|
||||
{
|
||||
|
|
@ -205,6 +206,9 @@ namespace TShockAPI.DB
|
|||
if (ply.HasPermission(Permissions.canusebannedprojectiles))
|
||||
return true;
|
||||
|
||||
if (PlayerHooks.OnPlayerProjbanPermission(ply, this))
|
||||
return true;
|
||||
|
||||
var cur = ply.Group;
|
||||
var traversed = new List<Group>();
|
||||
while (cur != null)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using System.Linq;
|
||||
using MySql.Data.MySqlClient;
|
||||
using TShockAPI.Hooks;
|
||||
|
||||
namespace TShockAPI.DB
|
||||
{
|
||||
|
|
@ -205,6 +206,9 @@ namespace TShockAPI.DB
|
|||
if (ply.HasPermission(Permissions.canusebannedtiles))
|
||||
return true;
|
||||
|
||||
if (PlayerHooks.OnPlayerTilebanPermission(ply, this))
|
||||
return true;
|
||||
|
||||
var cur = ply.Group;
|
||||
var traversed = new List<Group>();
|
||||
while (cur != null)
|
||||
|
|
|
|||
|
|
@ -1253,6 +1253,24 @@ namespace TShockAPI
|
|||
else
|
||||
return Group.HasPermission(permission);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="HasPermission(string)"/>
|
||||
public bool HasPermission(ItemBan bannedItem)
|
||||
{
|
||||
return TShock.Itembans.ItemIsBanned(bannedItem.Name, this);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="HasPermission(string)"/>
|
||||
public bool HasPermission(ProjectileBan bannedProj)
|
||||
{
|
||||
return TShock.ProjectileBans.ProjectileIsBanned(bannedProj.ID, this);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="HasPermission(string)"/>
|
||||
public bool HasPermission(TileBan bannedTile)
|
||||
{
|
||||
return TShock.TileBans.TileIsBanned(bannedTile.ID, this);
|
||||
}
|
||||
}
|
||||
|
||||
public class TSRestPlayer : TSPlayer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue