Added DisableExplosives along with the permission useexplosives to bypass it.
This commit is contained in:
parent
8037fd67db
commit
1f7d3eb5e6
3 changed files with 15 additions and 1 deletions
|
|
@ -34,6 +34,7 @@ namespace TShockAPI
|
|||
public bool KickKillTileAbusers = true;
|
||||
public bool BanExplosives = true;
|
||||
public bool KickExplosives = true;
|
||||
public bool DisableExplosives = true;
|
||||
public bool SpawnProtection = true;
|
||||
public int SpawnProtectionRadius = 5;
|
||||
public string DistributationAgent = "facepunch";
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ namespace TShockAPI
|
|||
public static bool KickTnt = true;
|
||||
public static bool BanBoom = true;
|
||||
public static bool KickBoom = true;
|
||||
public static bool DisableBoom = true;
|
||||
public static bool SpawnProtect = true;
|
||||
public static bool RangeChecks = true;
|
||||
public static int SpawnProtectRadius = 5;
|
||||
|
|
@ -97,6 +98,7 @@ namespace TShockAPI
|
|||
KickTnt = cfg.KickKillTileAbusers;
|
||||
BanBoom = cfg.BanExplosives;
|
||||
KickBoom = cfg.KickExplosives;
|
||||
DisableBoom = cfg.DisableExplosives;
|
||||
SpawnProtect = cfg.SpawnProtection;
|
||||
SpawnProtectRadius = cfg.SpawnProtectionRadius;
|
||||
DistributationAgent = cfg.DistributationAgent;
|
||||
|
|
@ -136,6 +138,7 @@ namespace TShockAPI
|
|||
cfg.KickKillTileAbusers = KickTnt;
|
||||
cfg.BanExplosives = BanBoom;
|
||||
cfg.KickExplosives = KickBoom;
|
||||
cfg.DisableExplosives = DisableBoom;
|
||||
cfg.SpawnProtection = SpawnProtect;
|
||||
cfg.SpawnProtectionRadius = SpawnProtectRadius;
|
||||
cfg.MaxSlots = MaxSlots;
|
||||
|
|
|
|||
|
|
@ -318,7 +318,17 @@ namespace TShockAPI
|
|||
if (type == 29 || type == 28 || type == 37)
|
||||
{
|
||||
Log.Debug(string.Format("Explosive(PlyXY:{0}_{1}, Type:{2})", args.Player.TileX, args.Player.TileY, type));
|
||||
return Tools.HandleExplosivesUser(args.Player, "Throwing an explosive device.");
|
||||
if (ConfigurationManager.DisableBoom && (!args.Player.Group.HasPermission("useexplosives") || !args.Player.Group.HasPermission("ignoregriefdetection")))
|
||||
{
|
||||
//Lag will still allow the projectile to detonate.
|
||||
//TODO: Stop KillTile for x period of time after projectile packet is received.
|
||||
Main.projectile[ident].type = 0;
|
||||
NetMessage.SendData((int)PacketTypes.ProjectileNew, args.Player.Index, -1, "", ident);
|
||||
args.Player.SendMessage("Explosives are disabled!", Color.Red);
|
||||
//return true;
|
||||
}
|
||||
else
|
||||
return Tools.HandleExplosivesUser(args.Player, "Throwing an explosive device.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue