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

◆ PlaceThing_Tiles_PlaceIt_AutoPaintAndActuate()

void Terraria.Player.PlaceThing_Tiles_PlaceIt_AutoPaintAndActuate ( int typeCaches[,],
int tileToCreate )
inlineprivate

Definition at line 39318 of file Player.cs.

39319 {
39320 if (!autoPaint && !autoActuator)
39321 {
39322 return;
39323 }
39324 int num = 0;
39325 int num2 = 0;
39326 int num3 = 11;
39327 int num4 = 11;
39328 bool flag = TileID.Sets.Platforms[Main.tile[tileTargetX, tileTargetY].type];
39330 if (!Main.tileFrameImportant[Main.tile[tileTargetX, tileTargetY].type] || flag)
39331 {
39332 num = (num2 = 5);
39333 num3 = (num4 = 6);
39334 }
39335 for (int i = num; i < num3; i++)
39336 {
39337 for (int j = num2; j < num4; j++)
39338 {
39339 int num5 = tileTargetX - 5 + i;
39340 int num6 = tileTargetY - 5 + j;
39341 if ((!Main.tile[num5, num6].active() && typeCaches[i, j] == -1) || (Main.tile[num5, num6].active() && !flag2 && (typeCaches[i, j] == Main.tile[num5, num6].type || Main.tile[num5, num6].type != tileToCreate)))
39342 {
39343 continue;
39344 }
39345 if (autoPaint && builderAccStatus[3] == 0)
39346 {
39348 }
39349 if (!autoActuator || builderAccStatus[2] != 0)
39350 {
39351 continue;
39352 }
39353 bool flag3 = Main.tileSolid[Main.tile[num5, num6].type] && !TileID.Sets.NotReallySolid[Main.tile[num5, num6].type];
39354 ushort type = Main.tile[num5, num6].type;
39355 if (type == 314 || (uint)(type - 386) <= 3u)
39356 {
39357 flag3 = false;
39358 }
39359 if (!flag3)
39360 {
39361 continue;
39362 }
39363 int num7 = FindItem(849);
39364 if (num7 > -1 && WorldGen.PlaceActuator(num5, num6))
39365 {
39366 NetMessage.SendData(17, -1, -1, null, 8, num5, num6);
39368 {
39369 inventory[num7].stack--;
39370 }
39371 if (inventory[num7].stack <= 0)
39372 {
39374 }
39375 }
39376 }
39377 }
39378 }
static bool[] NotReallySolid
Definition TileID.cs:324
static bool[] Platforms
Definition TileID.cs:219
int stack
The current stack of the item. F:Terraria.Item.maxStack indicates the max possible stack.
Definition Item.cs:396
void SetDefaults(int Type=0)
Definition Item.cs:48800
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
int FindItem(int netid)
Definition Player.cs:56652
bool autoActuator
Definition Player.cs:2624
void TryPainting(int x, int y, bool paintingAWall=false, bool applyItemAnimation=true)
Definition Player.cs:40659
static int tileTargetY
Definition Player.cs:2652
static int tileTargetX
Definition Player.cs:2650
int[] builderAccStatus
Definition Player.cs:1007
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.autoActuator, Terraria.Player.autoPaint, Terraria.Player.builderAccStatus, Terraria.ModLoader.ItemLoader.ConsumeItem(), Terraria.Player.FindItem(), Terraria.Player.inventory, Terraria.ID.TileID.Sets.NotReallySolid, Terraria.WorldGen.PlaceActuator(), Terraria.ID.TileID.Sets.Platforms, Terraria.NetMessage.SendData(), Terraria.Item.SetDefaults(), Terraria.Item.stack, Terraria.Main.tile, Terraria.Main.tileFrameImportant, Terraria.Main.tileSolid, Terraria.Player.tileTargetX, Terraria.Player.tileTargetY, and Terraria.Player.TryPainting().

Referenced by Terraria.Player.PlaceThing_Tiles_PlaceIt(), and Terraria.Player.PlaceThing_TryReplacingTiles().

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