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

◆ Place3x4()

static void Terraria.WorldGen.Place3x4 ( int x,
int y,
ushort type,
int style )
inlinestatic

Definition at line 45790 of file WorldGen.cs.

45791 {
45792 if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5)
45793 {
45794 return;
45795 }
45796 bool flag = true;
45797 for (int i = x - 1; i < x + 2; i++)
45798 {
45799 for (int j = y - 3; j < y + 1; j++)
45800 {
45801 if (Main.tile[i, j] == null)
45802 {
45803 Main.tile[i, j] = default(Tile);
45804 }
45805 if (Main.tile[i, j].active())
45806 {
45807 flag = false;
45808 }
45809 }
45810 if (Main.tile[i, y + 1] == null)
45811 {
45812 Main.tile[i, y + 1] = default(Tile);
45813 }
45814 if (!SolidTile2(i, y + 1))
45815 {
45816 flag = false;
45817 }
45818 }
45819 if (flag)
45820 {
45821 int num = style * 54;
45822 for (int k = -3; k <= 0; k++)
45823 {
45824 short frameY = (short)((3 + k) * 18);
45825 Main.tile[x - 1, y + k].active(active: true);
45826 Main.tile[x - 1, y + k].frameY = frameY;
45827 Main.tile[x - 1, y + k].frameX = (short)num;
45828 Main.tile[x - 1, y + k].type = type;
45829 Main.tile[x, y + k].active(active: true);
45830 Main.tile[x, y + k].frameY = frameY;
45831 Main.tile[x, y + k].frameX = (short)(num + 18);
45832 Main.tile[x, y + k].type = type;
45833 Main.tile[x + 1, y + k].active(active: true);
45834 Main.tile[x + 1, y + k].frameY = frameY;
45835 Main.tile[x + 1, y + k].frameX = (short)(num + 36);
45836 Main.tile[x + 1, y + k].type = type;
45837 }
45838 }
45839 }
static bool SolidTile2(Tile testTile)

References Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, and Terraria.Main.tile.