TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ ApplyPaint()

void Terraria.Player.ApplyPaint ( int x,
int y,
bool paintingAWall,
bool applyItemAnimation,
Item targetItem )
inlineprivate

Definition at line 40707 of file Player.cs.

40708 {
40709 byte paint = targetItem.paint;
40710 if (paintingAWall)
40711 {
40712 if (Main.tile[x, y].wallColor() != paint && WorldGen.paintWall(x, y, paint, broadCast: true))
40713 {
40715 {
40716 targetItem.stack--;
40717 }
40718 if (targetItem.stack <= 0)
40719 {
40720 targetItem.SetDefaults();
40721 }
40723 {
40725 }
40726 }
40727 }
40728 else if (Main.tile[x, y].color() != paint && WorldGen.paintTile(x, y, paint, broadCast: true))
40729 {
40731 {
40732 targetItem.stack--;
40733 }
40734 if (targetItem.stack <= 0)
40735 {
40736 targetItem.SetDefaults();
40737 }
40739 {
40741 }
40742 }
40743 }
static bool ConsumeItem(Item item, Player player)
If ModItem.ConsumeItem or any of the GlobalItem.ConsumeItem hooks returns false, sets consume to fals...
This serves as the central class from which item-related functions are carried out....
Definition ItemLoader.cs:26
float wallSpeed
Definition Player.cs:2618
float tileSpeed
Definition Player.cs:2620
void ApplyItemTime(Item sItem, float multiplier=1f, bool? callUseItem=null)
Definition Player.cs:4907
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
Definition Player.cs:1767

References Terraria.Player.ApplyItemTime(), Terraria.ModLoader.ItemLoader.ConsumeItem(), Terraria.Player.inventory, Terraria.WorldGen.paintTile(), Terraria.WorldGen.paintWall(), Terraria.Player.selectedItem, Terraria.Main.tile, Terraria.Player.tileSpeed, and Terraria.Player.wallSpeed.

Referenced by Terraria.Player.TryPainting().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: