Merge remote-tracking branch 'origin/general-devel' into oop

This commit is contained in:
Lucas Nicodemus 2017-12-27 19:03:03 -07:00
commit f74a0f6a70
9 changed files with 13 additions and 202 deletions

View file

@ -1312,27 +1312,6 @@ namespace TShockAPI
return true;
}
/// <summary>
/// Gives an item to the player. Includes banned item spawn prevention to check if the player can spawn the item.
/// </summary>
/// <param name="type">The item ID.</param>
/// <param name="name">The item name.</param>
/// <param name="width">The width of the receiver.</param>
/// <param name="height">The height of the receiver.</param>
/// <param name="stack">The item stack.</param>
/// <param name="prefix">The item prefix.</param>
/// <returns>True or false, depending if the item passed the check or not.</returns>
[Obsolete("Use the GiveItemCheck overload with fewer parameters.")]
public bool GiveItemCheck(int type, string name, int width, int height, int stack, int prefix = 0)
{
if ((TShock.Itembans.ItemIsBanned(name) && TShock.Config.PreventBannedItemSpawn) &&
(TShock.Itembans.ItemIsBanned(name, this) || !TShock.Config.AllowAllowedGroupsToSpawnBannedItems))
return false;
GiveItem(type, name, width, height, stack, prefix);
return true;
}
/// <summary>
/// Gives an item to the player.
/// </summary>
@ -1345,22 +1324,6 @@ namespace TShockAPI
SendData(PacketTypes.ItemDrop, "", itemIndex);
}
/// <summary>
/// Gives an item to the player.
/// </summary>
/// <param name="type">The item ID.</param>
/// <param name="name">The item name. This parameter is unused.</param>
/// <param name="width">The width of the receiver.</param>
/// <param name="height">The height of the receiver.</param>
/// <param name="stack">The item stack.</param>
/// <param name="prefix">The item prefix.</param>
[Obsolete("Use the GiveItem overload with fewer parameters.")]
public virtual void GiveItem(int type, string name, int width, int height, int stack, int prefix = 0)
{
int itemIndex = Item.NewItem((int)X, (int)Y, width, height, type, stack, true, prefix, true);
SendData(PacketTypes.ItemDrop, "", itemIndex);
}
/// <summary>
/// Sends an information message to the player.
/// </summary>