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

◆ Place4x2()

static void Terraria.WorldGen.Place4x2 ( int x,
int y,
ushort type,
int direction = -1,
int style = 0 )
inlinestatic

Definition at line 44155 of file WorldGen.cs.

44156 {
44157 if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5)
44158 {
44159 return;
44160 }
44161 bool flag = true;
44162 for (int i = x - 1; i < x + 3; i++)
44163 {
44164 for (int j = y - 1; j < y + 1; j++)
44165 {
44166 if (Main.tile[i, j] == null)
44167 {
44168 Main.tile[i, j] = default(Tile);
44169 }
44170 if (Main.tile[i, j].active())
44171 {
44172 flag = false;
44173 }
44174 }
44175 if (Main.tile[i, y + 1] == null)
44176 {
44177 Main.tile[i, y + 1] = default(Tile);
44178 }
44179 if (!SolidTile2(i, y + 1))
44180 {
44181 flag = false;
44182 }
44183 }
44184 short num = 0;
44185 if (direction == 1)
44186 {
44187 num = 72;
44188 }
44189 int num2 = 36 * style;
44190 if (flag)
44191 {
44192 Main.tile[x - 1, y - 1].active(active: true);
44193 Main.tile[x - 1, y - 1].frameY = (short)num2;
44194 Main.tile[x - 1, y - 1].frameX = num;
44195 Main.tile[x - 1, y - 1].type = type;
44196 Main.tile[x, y - 1].active(active: true);
44197 Main.tile[x, y - 1].frameY = (short)num2;
44198 Main.tile[x, y - 1].frameX = (short)(18 + num);
44199 Main.tile[x, y - 1].type = type;
44200 Main.tile[x + 1, y - 1].active(active: true);
44201 Main.tile[x + 1, y - 1].frameY = (short)num2;
44202 Main.tile[x + 1, y - 1].frameX = (short)(36 + num);
44203 Main.tile[x + 1, y - 1].type = type;
44204 Main.tile[x + 2, y - 1].active(active: true);
44205 Main.tile[x + 2, y - 1].frameY = (short)num2;
44206 Main.tile[x + 2, y - 1].frameX = (short)(54 + num);
44207 Main.tile[x + 2, y - 1].type = type;
44208 Main.tile[x - 1, y].active(active: true);
44209 Main.tile[x - 1, y].frameY = (short)(num2 + 18);
44210 Main.tile[x - 1, y].frameX = num;
44211 Main.tile[x - 1, y].type = type;
44212 Main.tile[x, y].active(active: true);
44213 Main.tile[x, y].frameY = (short)(num2 + 18);
44214 Main.tile[x, y].frameX = (short)(18 + num);
44215 Main.tile[x, y].type = type;
44216 Main.tile[x + 1, y].active(active: true);
44217 Main.tile[x + 1, y].frameY = (short)(num2 + 18);
44218 Main.tile[x + 1, y].frameX = (short)(36 + num);
44219 Main.tile[x + 1, y].type = type;
44220 Main.tile[x + 2, y].active(active: true);
44221 Main.tile[x + 2, y].frameY = (short)(num2 + 18);
44222 Main.tile[x + 2, y].frameX = (short)(54 + num);
44223 Main.tile[x + 2, y].type = type;
44224 }
44225 }
static bool SolidTile2(Tile testTile)

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