Add support for prefixes in /item and /give
This commit is contained in:
parent
3f0d82e5be
commit
a2a1486ea1
3 changed files with 73 additions and 20 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue