public static void CheckHitTile(Player player) { if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == 437) { int i = Player.tileTargetX; int j = Player.tileTargetY; if (player.InventoryContains(1727) && player.AmountInInventory(1727) >= 76) { if (BuildWickerman(i + 1, j)) { int amountNeeded = 76; for (int k = 0; k < 58; k++) { if (player.inventory[k].type == 1727 && player.inventory[k].stack > 0) { player.inventory[k].stack -= amountNeeded; if (player.inventory[k].stack < 0) { amountNeeded = 0 - player.inventory[k].stack; } } } } else { Main.NewText("There are blocks obstructing the stencil.", Main.errorColor); } } else { Main.NewText("Not enough hay to build structure.", Main.errorColor); Main.NewText("Required: 76 You have: " + player.AmountInInventory(1727), Main.errorColor); } } }