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

◆ CanPlace()

static bool Terraria.TileObject.CanPlace ( int x,
int y,
int type,
int style,
int dir,
out TileObject objectData,
bool onlyCheck = false,
int? forcedRandom = null )
inlinestatic

Definition at line 174 of file TileObject.cs.

175 {
177 objectData = Empty;
178 if (tileData == null)
179 {
180 return false;
181 }
182 int num = x - tileData.Origin.X;
183 int num2 = y - tileData.Origin.Y;
184 if (num < 0 || num + tileData.Width >= Main.maxTilesX || num2 < 0 || num2 + tileData.Height >= Main.maxTilesY)
185 {
186 return false;
187 }
188 bool flag = tileData.RandomStyleRange > 0;
190 {
191 TileObjectPreviewData.placementCache = new TileObjectPreviewData();
192 }
194 int num3 = 0;
195 if (tileData.AlternatesCount != 0)
196 {
197 num3 = tileData.AlternatesCount;
198 }
199 float num4 = -1f;
200 float num5 = -1f;
201 int num6 = 0;
202 TileObjectData tileObjectData = null;
203 int num7 = -1;
204 while (num7 < num3)
205 {
206 num7++;
208 if (tileData2.Direction != 0 && ((tileData2.Direction == TileObjectDirection.PlaceLeft && dir == 1) || (tileData2.Direction == TileObjectDirection.PlaceRight && dir == -1)))
209 {
210 continue;
211 }
212 int num8 = x - tileData2.Origin.X;
213 int num9 = y - tileData2.Origin.Y;
214 if (num8 < 5 || num8 + tileData2.Width > Main.maxTilesX - 5 || num9 < 5 || num9 + tileData2.Height > Main.maxTilesY - 5)
215 {
216 return false;
217 }
218 Rectangle rectangle = new Rectangle(0, 0, tileData2.Width, tileData2.Height);
219 int num10 = 0;
220 int num11 = 0;
221 if (tileData2.AnchorTop.tileCount != 0)
222 {
223 if (rectangle.Y == 0)
224 {
225 rectangle.Y = -1;
226 rectangle.Height++;
227 num11++;
228 }
229 int checkStart = tileData2.AnchorTop.checkStart;
230 if (checkStart < rectangle.X)
231 {
232 rectangle.Width += rectangle.X - checkStart;
233 num10 += rectangle.X - checkStart;
234 rectangle.X = checkStart;
235 }
236 int num12 = checkStart + tileData2.AnchorTop.tileCount - 1;
237 int num13 = rectangle.X + rectangle.Width - 1;
238 if (num12 > num13)
239 {
240 rectangle.Width += num12 - num13;
241 }
242 }
243 if (tileData2.AnchorBottom.tileCount != 0)
244 {
245 if (rectangle.Y + rectangle.Height == tileData2.Height)
246 {
247 rectangle.Height++;
248 }
249 int checkStart2 = tileData2.AnchorBottom.checkStart;
250 if (checkStart2 < rectangle.X)
251 {
252 rectangle.Width += rectangle.X - checkStart2;
253 num10 += rectangle.X - checkStart2;
254 rectangle.X = checkStart2;
255 }
256 int num14 = checkStart2 + tileData2.AnchorBottom.tileCount - 1;
257 int num15 = rectangle.X + rectangle.Width - 1;
258 if (num14 > num15)
259 {
260 rectangle.Width += num14 - num15;
261 }
262 }
263 if (tileData2.AnchorLeft.tileCount != 0)
264 {
265 if (rectangle.X == 0)
266 {
267 rectangle.X = -1;
268 rectangle.Width++;
269 num10++;
270 }
271 int num16 = tileData2.AnchorLeft.checkStart;
272 if ((tileData2.AnchorLeft.type & AnchorType.Tree) == AnchorType.Tree)
273 {
274 num16--;
275 }
276 if (num16 < rectangle.Y)
277 {
278 rectangle.Width += rectangle.Y - num16;
279 num11 += rectangle.Y - num16;
280 rectangle.Y = num16;
281 }
282 int num17 = num16 + tileData2.AnchorLeft.tileCount - 1;
283 if ((tileData2.AnchorLeft.type & AnchorType.Tree) == AnchorType.Tree)
284 {
285 num17 += 2;
286 }
287 int num18 = rectangle.Y + rectangle.Height - 1;
288 if (num17 > num18)
289 {
290 rectangle.Height += num17 - num18;
291 }
292 }
293 if (tileData2.AnchorRight.tileCount != 0)
294 {
295 if (rectangle.X + rectangle.Width == tileData2.Width)
296 {
297 rectangle.Width++;
298 }
299 int num19 = tileData2.AnchorLeft.checkStart;
300 if ((tileData2.AnchorRight.type & AnchorType.Tree) == AnchorType.Tree)
301 {
302 num19--;
303 }
304 if (num19 < rectangle.Y)
305 {
306 rectangle.Width += rectangle.Y - num19;
307 num11 += rectangle.Y - num19;
308 rectangle.Y = num19;
309 }
310 int num20 = num19 + tileData2.AnchorRight.tileCount - 1;
311 if ((tileData2.AnchorRight.type & AnchorType.Tree) == AnchorType.Tree)
312 {
313 num20 += 2;
314 }
315 int num21 = rectangle.Y + rectangle.Height - 1;
316 if (num20 > num21)
317 {
318 rectangle.Height += num20 - num21;
319 }
320 }
321 if (onlyCheck)
322 {
323 objectPreview.Reset();
324 objectPreview.Active = true;
325 objectPreview.Type = (ushort)type;
326 objectPreview.Style = (short)style;
327 objectPreview.Alternate = num7;
328 objectPreview.Size = new Point16(rectangle.Width, rectangle.Height);
329 objectPreview.ObjectStart = new Point16(num10, num11);
330 objectPreview.Coordinates = new Point16(num8 - num10, num9 - num11);
331 }
332 float num22 = 0f;
333 float num23 = tileData2.Width * tileData2.Height;
334 float num24 = 0f;
335 float num25 = 0f;
336 for (int i = 0; i < tileData2.Width; i++)
337 {
338 for (int j = 0; j < tileData2.Height; j++)
339 {
340 Tile tileSafely = Framing.GetTileSafely(num8 + i, num9 + j);
341 bool flag2 = !tileData2.LiquidPlace(tileSafely);
342 bool flag3 = false;
343 if (tileData2.AnchorWall)
344 {
345 num25 += 1f;
346 if (!tileData2.isValidWallAnchor(tileSafely.wall))
347 {
348 flag3 = true;
349 }
350 else
351 {
352 num24 += 1f;
353 }
354 }
355 bool flag4 = false;
356 if (tileSafely.active() && (!Main.tileCut[tileSafely.type] || tileSafely.type == 484 || tileSafely.type == 654) && !TileID.Sets.BreakableWhenPlacing[tileSafely.type])
357 {
358 flag4 = true;
359 }
360 if (flag4 || flag2 || flag3)
361 {
362 if (onlyCheck)
363 {
364 objectPreview[i + num10, j + num11] = 2;
365 }
366 continue;
367 }
368 if (onlyCheck)
369 {
370 objectPreview[i + num10, j + num11] = 1;
371 }
372 num22 += 1f;
373 }
374 }
375 AnchorData anchorBottom = tileData2.AnchorBottom;
376 if (anchorBottom.tileCount != 0)
377 {
378 num25 += (float)anchorBottom.tileCount;
379 int height = tileData2.Height;
380 for (int k = 0; k < anchorBottom.tileCount; k++)
381 {
382 int num26 = anchorBottom.checkStart + k;
383 Tile tileSafely = Framing.GetTileSafely(num8 + num26, num9 + height);
384 bool flag5 = false;
385 if (tileSafely.nactive())
386 {
387 if ((anchorBottom.type & AnchorType.SolidTile) == AnchorType.SolidTile && Main.tileSolid[tileSafely.type] && !Main.tileSolidTop[tileSafely.type] && !Main.tileNoAttach[tileSafely.type] && (tileData2.FlattenAnchors || tileSafely.blockType() == 0))
388 {
389 flag5 = tileData2.isValidTileAnchor(tileSafely.type);
390 }
391 if (!flag5 && ((anchorBottom.type & AnchorType.SolidWithTop) == AnchorType.SolidWithTop || (anchorBottom.type & AnchorType.Table) == AnchorType.Table))
392 {
393 if (TileID.Sets.Platforms[tileSafely.type])
394 {
395 _ = tileSafely.frameX / TileObjectData.PlatformFrameWidth();
396 if (!tileSafely.halfBrick() && WorldGen.PlatformProperTopFrame(tileSafely.frameX))
397 {
398 flag5 = true;
399 }
400 }
401 else if (Main.tileSolid[tileSafely.type] && Main.tileSolidTop[tileSafely.type])
402 {
403 flag5 = true;
404 }
405 }
406 if (!flag5 && (anchorBottom.type & AnchorType.Table) == AnchorType.Table && !TileID.Sets.Platforms[tileSafely.type] && Main.tileTable[tileSafely.type] && tileSafely.blockType() == 0)
407 {
408 flag5 = true;
409 }
410 if (!flag5 && (anchorBottom.type & AnchorType.SolidSide) == AnchorType.SolidSide && Main.tileSolid[tileSafely.type] && !Main.tileSolidTop[tileSafely.type])
411 {
412 int num27 = tileSafely.blockType();
413 if ((uint)(num27 - 4) <= 1u)
414 {
415 flag5 = tileData2.isValidTileAnchor(tileSafely.type);
416 }
417 }
418 if (!flag5 && (anchorBottom.type & AnchorType.AlternateTile) == AnchorType.AlternateTile && tileData2.isValidAlternateAnchor(tileSafely.type))
419 {
420 flag5 = true;
421 }
422 }
423 else if (!flag5 && (anchorBottom.type & AnchorType.EmptyTile) == AnchorType.EmptyTile)
424 {
425 flag5 = true;
426 }
427 if (!flag5)
428 {
429 if (onlyCheck)
430 {
431 objectPreview[num26 + num10, height + num11] = 2;
432 }
433 continue;
434 }
435 if (onlyCheck)
436 {
437 objectPreview[num26 + num10, height + num11] = 1;
438 }
439 num24 += 1f;
440 }
441 }
442 anchorBottom = tileData2.AnchorTop;
443 if (anchorBottom.tileCount != 0)
444 {
445 num25 += (float)anchorBottom.tileCount;
446 int num28 = -1;
447 for (int l = 0; l < anchorBottom.tileCount; l++)
448 {
449 int num29 = anchorBottom.checkStart + l;
450 Tile tileSafely = Framing.GetTileSafely(num8 + num29, num9 + num28);
451 bool flag6 = false;
452 if (tileSafely.nactive())
453 {
454 if (Main.tileSolid[tileSafely.type] && !Main.tileSolidTop[tileSafely.type] && !Main.tileNoAttach[tileSafely.type] && (tileData2.FlattenAnchors || tileSafely.blockType() == 0))
455 {
456 flag6 = tileData2.isValidTileAnchor(tileSafely.type);
457 }
458 if (!flag6 && (anchorBottom.type & AnchorType.SolidBottom) == AnchorType.SolidBottom && ((Main.tileSolid[tileSafely.type] && (!Main.tileSolidTop[tileSafely.type] || (TileID.Sets.Platforms[tileSafely.type] && (tileSafely.halfBrick() || tileSafely.topSlope())))) || tileSafely.halfBrick() || tileSafely.topSlope()) && !TileID.Sets.NotReallySolid[tileSafely.type] && !tileSafely.bottomSlope())
459 {
460 flag6 = tileData2.isValidTileAnchor(tileSafely.type);
461 }
462 if (!flag6 && (anchorBottom.type & AnchorType.Platform) == AnchorType.Platform && TileID.Sets.Platforms[tileSafely.type])
463 {
464 flag6 = tileData2.isValidTileAnchor(tileSafely.type);
465 }
466 if (!flag6 && (anchorBottom.type & AnchorType.PlatformNonHammered) == AnchorType.PlatformNonHammered && TileID.Sets.Platforms[tileSafely.type] && tileSafely.slope() == 0 && !tileSafely.halfBrick())
467 {
468 flag6 = tileData2.isValidTileAnchor(tileSafely.type);
469 }
470 if (!flag6 && (anchorBottom.type & AnchorType.PlanterBox) == AnchorType.PlanterBox && tileSafely.type == 380)
471 {
472 flag6 = tileData2.isValidTileAnchor(tileSafely.type);
473 }
474 if (!flag6 && (anchorBottom.type & AnchorType.SolidSide) == AnchorType.SolidSide && Main.tileSolid[tileSafely.type] && !Main.tileSolidTop[tileSafely.type])
475 {
476 int num27 = tileSafely.blockType();
477 if ((uint)(num27 - 2) <= 1u)
478 {
479 flag6 = tileData2.isValidTileAnchor(tileSafely.type);
480 }
481 }
482 if (!flag6 && (anchorBottom.type & AnchorType.AlternateTile) == AnchorType.AlternateTile && tileData2.isValidAlternateAnchor(tileSafely.type))
483 {
484 flag6 = true;
485 }
486 }
487 else if (!flag6 && (anchorBottom.type & AnchorType.EmptyTile) == AnchorType.EmptyTile)
488 {
489 flag6 = true;
490 }
491 if (!flag6)
492 {
493 if (onlyCheck)
494 {
495 objectPreview[num29 + num10, num28 + num11] = 2;
496 }
497 continue;
498 }
499 if (onlyCheck)
500 {
501 objectPreview[num29 + num10, num28 + num11] = 1;
502 }
503 num24 += 1f;
504 }
505 }
506 anchorBottom = tileData2.AnchorRight;
507 if (anchorBottom.tileCount != 0)
508 {
509 num25 += (float)anchorBottom.tileCount;
510 int width = tileData2.Width;
511 for (int m = 0; m < anchorBottom.tileCount; m++)
512 {
513 int num30 = anchorBottom.checkStart + m;
514 Tile tileSafely = Framing.GetTileSafely(num8 + width, num9 + num30);
515 bool flag7 = false;
516 if (tileSafely.nactive())
517 {
518 if (Main.tileSolid[tileSafely.type] && !Main.tileSolidTop[tileSafely.type] && !Main.tileNoAttach[tileSafely.type] && (tileData2.FlattenAnchors || tileSafely.blockType() == 0))
519 {
520 flag7 = tileData2.isValidTileAnchor(tileSafely.type);
521 }
522 if (!flag7 && (anchorBottom.type & AnchorType.SolidSide) == AnchorType.SolidSide && Main.tileSolid[tileSafely.type] && !Main.tileSolidTop[tileSafely.type])
523 {
524 int num27 = tileSafely.blockType();
525 if (num27 == 2 || num27 == 4)
526 {
527 flag7 = tileData2.isValidTileAnchor(tileSafely.type);
528 }
529 }
530 if (!flag7 && (anchorBottom.type & AnchorType.Tree) == AnchorType.Tree && TileID.Sets.IsATreeTrunk[tileSafely.type])
531 {
532 flag7 = true;
533 if (m == 0)
534 {
535 num25 += 1f;
536 Tile tileSafely2 = Framing.GetTileSafely(num8 + width, num9 + num30 - 1);
537 if (tileSafely2.nactive() && TileID.Sets.IsATreeTrunk[tileSafely2.type])
538 {
539 num24 += 1f;
540 if (onlyCheck)
541 {
542 objectPreview[width + num10, num30 + num11 - 1] = 1;
543 }
544 }
545 else if (onlyCheck)
546 {
547 objectPreview[width + num10, num30 + num11 - 1] = 2;
548 }
549 }
550 if (m == anchorBottom.tileCount - 1)
551 {
552 num25 += 1f;
553 Tile tileSafely3 = Framing.GetTileSafely(num8 + width, num9 + num30 + 1);
554 if (tileSafely3.nactive() && TileID.Sets.IsATreeTrunk[tileSafely3.type])
555 {
556 num24 += 1f;
557 if (onlyCheck)
558 {
559 objectPreview[width + num10, num30 + num11 + 1] = 1;
560 }
561 }
562 else if (onlyCheck)
563 {
564 objectPreview[width + num10, num30 + num11 + 1] = 2;
565 }
566 }
567 }
568 if (!flag7 && (anchorBottom.type & AnchorType.AlternateTile) == AnchorType.AlternateTile && tileData2.isValidAlternateAnchor(tileSafely.type))
569 {
570 flag7 = true;
571 }
572 }
573 else if (!flag7 && (anchorBottom.type & AnchorType.EmptyTile) == AnchorType.EmptyTile)
574 {
575 flag7 = true;
576 }
577 if (!flag7)
578 {
579 if (onlyCheck)
580 {
581 objectPreview[width + num10, num30 + num11] = 2;
582 }
583 continue;
584 }
585 if (onlyCheck)
586 {
587 objectPreview[width + num10, num30 + num11] = 1;
588 }
589 num24 += 1f;
590 }
591 }
592 anchorBottom = tileData2.AnchorLeft;
593 if (anchorBottom.tileCount != 0)
594 {
595 num25 += (float)anchorBottom.tileCount;
596 int num31 = -1;
597 for (int n = 0; n < anchorBottom.tileCount; n++)
598 {
599 int num32 = anchorBottom.checkStart + n;
600 Tile tileSafely = Framing.GetTileSafely(num8 + num31, num9 + num32);
601 bool flag8 = false;
602 if (tileSafely.nactive())
603 {
604 if (Main.tileSolid[tileSafely.type] && !Main.tileSolidTop[tileSafely.type] && !Main.tileNoAttach[tileSafely.type] && (tileData2.FlattenAnchors || tileSafely.blockType() == 0))
605 {
606 flag8 = tileData2.isValidTileAnchor(tileSafely.type);
607 }
608 if (!flag8 && (anchorBottom.type & AnchorType.SolidSide) == AnchorType.SolidSide && Main.tileSolid[tileSafely.type] && !Main.tileSolidTop[tileSafely.type])
609 {
610 int num27 = tileSafely.blockType();
611 if (num27 == 3 || num27 == 5)
612 {
613 flag8 = tileData2.isValidTileAnchor(tileSafely.type);
614 }
615 }
616 if (!flag8 && (anchorBottom.type & AnchorType.Tree) == AnchorType.Tree && TileID.Sets.IsATreeTrunk[tileSafely.type])
617 {
618 flag8 = true;
619 if (n == 0)
620 {
621 num25 += 1f;
622 Tile tileSafely4 = Framing.GetTileSafely(num8 + num31, num9 + num32 - 1);
623 if (tileSafely4.nactive() && TileID.Sets.IsATreeTrunk[tileSafely4.type])
624 {
625 num24 += 1f;
626 if (onlyCheck)
627 {
628 objectPreview[num31 + num10, num32 + num11 - 1] = 1;
629 }
630 }
631 else if (onlyCheck)
632 {
633 objectPreview[num31 + num10, num32 + num11 - 1] = 2;
634 }
635 }
636 if (n == anchorBottom.tileCount - 1)
637 {
638 num25 += 1f;
639 Tile tileSafely5 = Framing.GetTileSafely(num8 + num31, num9 + num32 + 1);
640 if (tileSafely5.nactive() && TileID.Sets.IsATreeTrunk[tileSafely5.type])
641 {
642 num24 += 1f;
643 if (onlyCheck)
644 {
645 objectPreview[num31 + num10, num32 + num11 + 1] = 1;
646 }
647 }
648 else if (onlyCheck)
649 {
650 objectPreview[num31 + num10, num32 + num11 + 1] = 2;
651 }
652 }
653 }
654 if (!flag8 && (anchorBottom.type & AnchorType.AlternateTile) == AnchorType.AlternateTile && tileData2.isValidAlternateAnchor(tileSafely.type))
655 {
656 flag8 = true;
657 }
658 }
659 else if (!flag8 && (anchorBottom.type & AnchorType.EmptyTile) == AnchorType.EmptyTile)
660 {
661 flag8 = true;
662 }
663 if (!flag8)
664 {
665 if (onlyCheck)
666 {
667 objectPreview[num31 + num10, num32 + num11] = 2;
668 }
669 continue;
670 }
671 if (onlyCheck)
672 {
673 objectPreview[num31 + num10, num32 + num11] = 1;
674 }
675 num24 += 1f;
676 }
677 }
678 if (tileData2.HookCheckIfCanPlace.hook != null)
679 {
681 {
682 _ = tileData2.Origin;
683 _ = tileData2.Origin;
684 }
685 if (tileData2.HookCheckIfCanPlace.hook(x, y, type, style, dir, num7) == tileData2.HookCheckIfCanPlace.badReturn && tileData2.HookCheckIfCanPlace.badResponse == 0)
686 {
687 num24 = 0f;
688 num22 = 0f;
689 objectPreview.AllInvalid();
690 }
691 }
692 float num33 = num24 / num25;
693 float num34 = num22 / num23;
694 if (num34 == 1f && num25 == 0f)
695 {
696 num23 = 1f;
697 num25 = 1f;
698 num33 = 1f;
699 num34 = 1f;
700 }
701 if (num33 == 1f && num34 == 1f)
702 {
703 num4 = 1f;
704 num5 = 1f;
705 num6 = num7;
706 tileObjectData = tileData2;
707 break;
708 }
709 if (num33 > num4 || (num33 == num4 && num34 > num5))
710 {
712 num4 = num33;
713 num5 = num34;
714 tileObjectData = tileData2;
715 num6 = num7;
716 }
717 }
718 int num35 = -1;
719 if (flag)
720 {
722 {
723 TileObjectPreviewData.randomCache = new TileObjectPreviewData();
724 }
725 bool flag9 = false;
727 {
728 Point16 coordinates = TileObjectPreviewData.randomCache.Coordinates;
729 Point16 objectStart = TileObjectPreviewData.randomCache.ObjectStart;
730 int num36 = coordinates.X + objectStart.X;
731 int num37 = coordinates.Y + objectStart.Y;
732 int num38 = x - tileData.Origin.X;
733 int num39 = y - tileData.Origin.Y;
734 if (num36 != num38 || num37 != num39)
735 {
736 flag9 = true;
737 }
738 }
739 else
740 {
741 flag9 = true;
742 }
743 int randomStyleRange = tileData.RandomStyleRange;
744 int num40 = Main.rand.Next(tileData.RandomStyleRange);
745 if (forcedRandom.HasValue)
746 {
747 num40 = (forcedRandom.Value % randomStyleRange + randomStyleRange) % randomStyleRange;
748 }
749 num35 = ((!flag9 && !forcedRandom.HasValue) ? TileObjectPreviewData.randomCache.Random : num40);
750 }
751 if (tileData.SpecificRandomStyles != null)
752 {
754 {
755 TileObjectPreviewData.randomCache = new TileObjectPreviewData();
756 }
757 bool flag10 = false;
759 {
760 Point16 coordinates2 = TileObjectPreviewData.randomCache.Coordinates;
761 Point16 objectStart2 = TileObjectPreviewData.randomCache.ObjectStart;
762 int num41 = coordinates2.X + objectStart2.X;
763 int num42 = coordinates2.Y + objectStart2.Y;
764 int num43 = x - tileData.Origin.X;
765 int num44 = y - tileData.Origin.Y;
766 if (num41 != num43 || num42 != num44)
767 {
768 flag10 = true;
769 }
770 }
771 else
772 {
773 flag10 = true;
774 }
775 int num45 = tileData.SpecificRandomStyles.Length;
776 int num46 = Main.rand.Next(num45);
777 if (forcedRandom.HasValue)
778 {
779 num46 = (forcedRandom.Value % num45 + num45) % num45;
780 }
781 num35 = ((!flag10 && !forcedRandom.HasValue) ? TileObjectPreviewData.randomCache.Random : (tileData.SpecificRandomStyles[num46] - style));
782 }
783 if (onlyCheck)
784 {
785 if (num4 != 1f || num5 != 1f)
786 {
788 num7 = num6;
789 }
790 objectPreview.Random = num35;
791 if (tileData.RandomStyleRange > 0 || tileData.SpecificRandomStyles != null)
792 {
794 }
795 }
796 if (!onlyCheck)
797 {
798 objectData.xCoord = x - tileObjectData.Origin.X;
799 objectData.yCoord = y - tileObjectData.Origin.Y;
800 objectData.type = type;
801 objectData.style = style;
802 objectData.alternate = num7;
803 objectData.random = num35;
804 }
805 if (num4 == 1f)
806 {
807 return num5 == 1f;
808 }
809 return false;
810 }
static bool[] BreakableWhenPlacing
Definition TileID.cs:277
static bool[] NotReallySolid
Definition TileID.cs:257
static bool[] Platforms
Definition TileID.cs:163
static bool[] IsATreeTrunk
Definition TileID.cs:91
static TileObjectData GetTileData(int type, int style, int alternate=0)
Func< int, int, int, int, int, int, int > hook
static TileObject Empty
Definition TileObject.cs:25
static TileObjectPreviewData objectPreview
Definition TileObject.cs:27

References Terraria.Tile.active(), Terraria.ObjectData.TileObjectData.AlternatesCount, Terraria.ObjectData.TileObjectData.AnchorBottom, Terraria.ObjectData.TileObjectData.AnchorLeft, Terraria.ObjectData.TileObjectData.AnchorRight, Terraria.ObjectData.TileObjectData.AnchorTop, Terraria.ObjectData.TileObjectData.AnchorWall, Terraria.DataStructures.PlacementHook.badResponse, Terraria.DataStructures.PlacementHook.badReturn, Terraria.Tile.blockType(), Terraria.Tile.bottomSlope(), Terraria.ID.TileID.Sets.BreakableWhenPlacing, Terraria.DataStructures.AnchorData.checkStart, Terraria.ObjectData.TileObjectData.Direction, Terraria.TileObject.Empty, Terraria.ObjectData.TileObjectData.FlattenAnchors, Terraria.Tile.frameX, Terraria.ObjectData.TileObjectData.GetTileData(), Terraria.Framing.GetTileSafely(), Terraria.Tile.halfBrick(), Microsoft.Xna.Framework.Rectangle.Height, Terraria.ObjectData.TileObjectData.Height, Terraria.DataStructures.PlacementHook.hook, Terraria.ObjectData.TileObjectData.HookCheckIfCanPlace, Terraria.ID.TileID.Sets.IsATreeTrunk, Terraria.ObjectData.TileObjectData.isValidAlternateAnchor(), Terraria.ObjectData.TileObjectData.isValidTileAnchor(), Terraria.ObjectData.TileObjectData.isValidWallAnchor(), Terraria.ObjectData.TileObjectData.LiquidPlace(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Tile.nactive(), Terraria.ID.TileID.Sets.NotReallySolid, Terraria.TileObject.objectPreview, Terraria.ObjectData.TileObjectData.Origin, Terraria.DataStructures.TileObjectPreviewData.placementCache, Terraria.ObjectData.TileObjectData.PlatformFrameWidth(), Terraria.WorldGen.PlatformProperTopFrame(), Terraria.ID.TileID.Sets.Platforms, Terraria.DataStructures.PlacementHook.processedCoordinates, Terraria.Main.rand, Terraria.DataStructures.TileObjectPreviewData.randomCache, Terraria.ObjectData.TileObjectData.RandomStyleRange, Terraria.Tile.slope(), Terraria.ObjectData.TileObjectData.SpecificRandomStyles, Terraria.TileObject.style, Terraria.DataStructures.AnchorData.tileCount, Terraria.Main.tileCut, Terraria.Main.tileNoAttach, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, Terraria.Main.tileTable, Terraria.Tile.topSlope(), Terraria.DataStructures.AnchorData.type, Terraria.Tile.type, Terraria.TileObject.type, Terraria.Tile.wall, Microsoft.Xna.Framework.Rectangle.Width, Terraria.ObjectData.TileObjectData.Width, Microsoft.Xna.Framework.Rectangle.X, Terraria.DataStructures.Point16.X, Microsoft.Xna.Framework.Rectangle.Y, and Terraria.DataStructures.Point16.Y.

Referenced by Terraria.NPC.AI_003_Fighters(), Terraria.WorldGen.PlaceChest(), Terraria.WorldGen.PlaceObject(), Terraria.Player.PlaceThing_Tiles(), Terraria.Player.TryReplantingTree(), and Terraria.Player.UpdatePlacementPreview().