1162 {
1163 int num = 0;
1164 if (Main.tile[i - 1, j - 1] != null && Main.tile[i - 1, j - 1].type == 314)
1165 {
1166 num++;
1167 }
1168 if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].type == 314)
1169 {
1170 num += 2;
1171 }
1172 if (Main.tile[i - 1, j + 1] != null && Main.tile[i - 1, j + 1].type == 314)
1173 {
1174 num += 4;
1175 }
1176 if (Main.tile[i + 1, j - 1] != null && Main.tile[i + 1, j - 1].type == 314)
1177 {
1178 num += 8;
1179 }
1180 if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].type == 314)
1181 {
1182 num += 16;
1183 }
1184 if (Main.tile[i + 1, j + 1] != null && Main.tile[i + 1, j + 1].type == 314)
1185 {
1186 num += 32;
1187 }
1188 return num;
1189 }