Merge branch 'general-devel' into otapi3
This commit is contained in:
commit
dfaad68106
3 changed files with 22 additions and 2 deletions
|
|
@ -3548,6 +3548,11 @@ namespace TShockAPI
|
|||
return true;
|
||||
}
|
||||
|
||||
bool hasPaintSprayerAbilities(Item item) =>
|
||||
item != null
|
||||
&& item.stack > 0
|
||||
&& (item.type == ItemID.PaintSprayer || item.type == ItemID.ArchitectGizmoPack);
|
||||
|
||||
// Not selecting paintbrush or paint scraper or the spectre versions? Hacking.
|
||||
if (args.Player.SelectedItem.type != ItemID.PaintRoller &&
|
||||
args.Player.SelectedItem.type != ItemID.PaintScraper &&
|
||||
|
|
@ -3555,8 +3560,8 @@ namespace TShockAPI
|
|||
args.Player.SelectedItem.type != ItemID.SpectrePaintRoller &&
|
||||
args.Player.SelectedItem.type != ItemID.SpectrePaintScraper &&
|
||||
args.Player.SelectedItem.type != ItemID.SpectrePaintbrush &&
|
||||
!args.Player.Accessories.Any(i => i != null && i.stack > 0 &&
|
||||
(i.type == ItemID.PaintSprayer || i.type == ItemID.ArchitectGizmoPack)))
|
||||
!args.Player.Accessories.Any(hasPaintSprayerAbilities) &&
|
||||
!args.Player.Inventory.Any(hasPaintSprayerAbilities))
|
||||
{
|
||||
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePaintTile rejected select consistency {0}", args.Player.Name);
|
||||
args.Player.SendData(PacketTypes.PaintTile, "", x, y, Main.tile[x, y].color());
|
||||
|
|
|
|||
|
|
@ -897,6 +897,18 @@ namespace TShockAPI
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the player's inventory (first 5 rows)
|
||||
/// </summary>
|
||||
public IEnumerable<Item> Inventory
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = 0; i < 50; i++)
|
||||
yield return TPlayer.inventory[i];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the player's accessories.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue