Fixy fix
-/item now works
This commit is contained in:
parent
cd7198599d
commit
e539080625
4 changed files with 11 additions and 24 deletions
|
|
@ -145,21 +145,8 @@ namespace TShockAPI
|
|||
int plr = args.Data.ReadInt8();
|
||||
int slot = args.Data.ReadInt8();
|
||||
int stack = args.Data.ReadInt8();
|
||||
int namelength = (int)(args.Data.Length - args.Data.Position - 1);
|
||||
|
||||
if (namelength > 0)
|
||||
{
|
||||
string itemname = Encoding.ASCII.GetString(args.Data.ReadBytes(namelength));
|
||||
|
||||
if (!args.Player.Group.HasPermission(Permissions.usebanneditem) && TShock.Itembans.ItemIsBanned(itemname))
|
||||
args.Player.Disconnect("Using banned item: " + itemname + ", remove it and rejoin");
|
||||
if (itemname == "KANNIBALE BLADE"
|
||||
|| itemname == "Super Gel")
|
||||
return TShock.Utils.HandleCheater(args.Player, string.Format(TShock.Config.GriefClientReason, "KANNIBALE"));
|
||||
if (TShock.Utils.GetItemByName(itemname).Count == 0 && !args.Player.Group.HasPermission(Permissions.ignorecheatdetection)
|
||||
&& TShock.Config.KickCustomItems)
|
||||
args.Player.Disconnect("Using custom item: " + itemname + ", remove it and region");
|
||||
}
|
||||
short prefix = (short) args.Data.ReadInt8();
|
||||
int type = (int) args.Data.ReadInt16();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -499,7 +486,7 @@ namespace TShockAPI
|
|||
}
|
||||
|
||||
|
||||
if (type == 29 || type == 28 || type == 37)
|
||||
if (type == 29 || type == 28 || type == 37) //need more explosives from 1.1
|
||||
{
|
||||
Log.Debug(string.Format("Explosive(PlyXY:{0}_{1}, Type:{2})", args.Player.TileX, args.Player.TileY, type));
|
||||
if (TShock.Config.DisableExplosives && (!args.Player.Group.HasPermission(Permissions.useexplosives) || !args.Player.Group.HasPermission(Permissions.ignoregriefdetection)))
|
||||
|
|
|
|||
|
|
@ -36,5 +36,5 @@ using System.Runtime.InteropServices;
|
|||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
|
||||
[assembly: AssemblyVersion("3.3.4.1201")]
|
||||
[assembly: AssemblyFileVersion("3.3.4.1201")]
|
||||
[assembly: AssemblyVersion("3.3.4.1202")]
|
||||
[assembly: AssemblyFileVersion("3.3.4.1202")]
|
||||
|
|
|
|||
|
|
@ -131,9 +131,9 @@ namespace TShockAPI
|
|||
bool flag = false;
|
||||
if (RealPlayer)
|
||||
{
|
||||
for (int i = 0; i < 40; i++)
|
||||
for (int i = 0; i < 45; i++)
|
||||
{
|
||||
if (TPlayer.inventory[i] == null || !TPlayer.inventory[i].active)
|
||||
if (TPlayer.inventory[i] == null || !TPlayer.inventory[i].active || TPlayer.inventory[i].name == "")
|
||||
{
|
||||
flag = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ namespace TShockAPI
|
|||
public Item GetItemById(int id)
|
||||
{
|
||||
Item item = new Item();
|
||||
item.SetDefaults(id);
|
||||
item.netDefaults(id);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ namespace TShockAPI
|
|||
try
|
||||
{
|
||||
Item item = new Item();
|
||||
item.SetDefaults(i);
|
||||
item.netDefaults(i);
|
||||
if (item.name.ToLower() == name.ToLower())
|
||||
return new List<Item> { item };
|
||||
if (item.name.ToLower().StartsWith(name.ToLower()))
|
||||
|
|
@ -277,7 +277,7 @@ namespace TShockAPI
|
|||
public NPC GetNPCById(int id)
|
||||
{
|
||||
NPC npc = new NPC();
|
||||
npc.SetDefaults(id);
|
||||
npc.netDefaults(id);
|
||||
return npc;
|
||||
}
|
||||
|
||||
|
|
@ -296,7 +296,7 @@ namespace TShockAPI
|
|||
for (int i = 1; i < Main.maxNPCTypes; i++)
|
||||
{
|
||||
NPC npc = new NPC();
|
||||
npc.SetDefaults(i);
|
||||
npc.netDefaults(i);
|
||||
if (npc.name.ToLower() == name.ToLower())
|
||||
return new List<NPC> { npc };
|
||||
if (npc.name.ToLower().StartsWith(name.ToLower()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue