Add support for prefixes in /item and /give

This commit is contained in:
Deathmax 2011-12-15 21:28:46 +08:00
parent 3f0d82e5be
commit a2a1486ea1
3 changed files with 73 additions and 20 deletions

View file

@ -268,9 +268,9 @@ namespace TShockAPI
return false;
}
public virtual void GiveItem(int type, string name, int width, int height, int stack)
public virtual void GiveItem(int type, string name, int width, int height, int stack, int prefix = 0)
{
int itemid = Item.NewItem((int)X, (int)Y, width, height, type, stack, true);
int itemid = Item.NewItem((int)X, (int)Y, width, height, type, stack, true, prefix);
// This is for special pickaxe/hammers/swords etc
Main.item[itemid].SetDefaults(name);
// The set default overrides the wet and stack set by NewItem