CanPlace() public method

public CanPlace ( int i, int j ) : bool
i int
j int
return bool
Ejemplo n.º 1
0
        //in Terraria.Player.PlaceThing after tileObject is initalized add else to if statement and before add
        //  if(!TileLoader.CanPlace(Player.tileTargetX, Player.tileTargetY)) { }
        public static bool CanPlace(int i, int j)
        {
            int type = Main.tile[i, j].type;

            foreach (GlobalTile globalTile in globalTiles)
            {
                if (!globalTile.CanPlace(i, j, type))
                {
                    return(false);
                }
            }
            ModTile modTile = GetTile(type);

            if (modTile != null && !modTile.CanPlace(i, j))
            {
                return(false);
            }
            return(true);
        }